pub trait MaxClientSimpleExt {
Show 24 methods
// Required methods
fn send_plain_text_to_chat(
&self,
chat_id: i64,
text: &str,
) -> impl Future<Output = Result<Vec<String>>>;
fn send_markdown_to_chat(
&self,
chat_id: i64,
text: &str,
) -> impl Future<Output = Result<Vec<String>>>;
fn send_html_to_chat(
&self,
chat_id: i64,
text: &str,
) -> impl Future<Output = Result<Vec<String>>>;
fn send_image_to_chat(
&self,
chat_id: i64,
path: &Path,
caption: Option<&str>,
) -> impl Future<Output = Result<Vec<String>>>;
fn send_video_to_chat(
&self,
chat_id: i64,
path: &Path,
caption: Option<&str>,
) -> impl Future<Output = Result<Vec<String>>>;
fn send_audio_to_chat(
&self,
chat_id: i64,
path: &Path,
caption: Option<&str>,
) -> impl Future<Output = Result<Vec<String>>>;
fn send_file_to_chat(
&self,
chat_id: i64,
path: &Path,
caption: Option<&str>,
) -> impl Future<Output = Result<Vec<String>>>;
fn send_sticker_to_chat(
&self,
chat_id: i64,
code: &str,
) -> impl Future<Output = Result<Vec<String>>>;
fn send_location_to_chat(
&self,
chat_id: i64,
latitude: f64,
longitude: f64,
) -> impl Future<Output = Result<Vec<String>>>;
fn send_contact_to_chat(
&self,
chat_id: i64,
contact: ContactData,
) -> impl Future<Output = Result<Vec<String>>>;
fn send_share_to_chat(
&self,
chat_id: i64,
url: &str,
text: Option<&str>,
) -> impl Future<Output = Result<Vec<String>>>;
fn send_keyboard_to_chat(
&self,
chat_id: i64,
text: &str,
keyboard: InlineKeyboard,
) -> impl Future<Output = Result<Vec<String>>>;
fn send_plain_text_to_user(
&self,
user_id: i64,
text: &str,
) -> impl Future<Output = Result<Vec<String>>>;
fn send_markdown_to_user(
&self,
user_id: i64,
text: &str,
) -> impl Future<Output = Result<Vec<String>>>;
fn send_html_to_user(
&self,
user_id: i64,
text: &str,
) -> impl Future<Output = Result<Vec<String>>>;
fn send_image_to_user(
&self,
user_id: i64,
path: &Path,
caption: Option<&str>,
) -> impl Future<Output = Result<Vec<String>>>;
fn send_video_to_user(
&self,
user_id: i64,
path: &Path,
caption: Option<&str>,
) -> impl Future<Output = Result<Vec<String>>>;
fn send_audio_to_user(
&self,
user_id: i64,
path: &Path,
caption: Option<&str>,
) -> impl Future<Output = Result<Vec<String>>>;
fn send_file_to_user(
&self,
user_id: i64,
path: &Path,
caption: Option<&str>,
) -> impl Future<Output = Result<Vec<String>>>;
fn send_sticker_to_user(
&self,
user_id: i64,
code: &str,
) -> impl Future<Output = Result<Vec<String>>>;
fn send_location_to_user(
&self,
user_id: i64,
latitude: f64,
longitude: f64,
) -> impl Future<Output = Result<Vec<String>>>;
fn send_contact_to_user(
&self,
user_id: i64,
contact: ContactData,
) -> impl Future<Output = Result<Vec<String>>>;
fn send_share_to_user(
&self,
user_id: i64,
url: &str,
text: Option<&str>,
) -> impl Future<Output = Result<Vec<String>>>;
fn send_keyboard_to_user(
&self,
user_id: i64,
text: &str,
keyboard: InlineKeyboard,
) -> impl Future<Output = Result<Vec<String>>>;
}Expand description
Расширяющий типаж для MaxClient с быстрыми методами отправки.
Required Methods§
Sourcefn send_plain_text_to_chat(
&self,
chat_id: i64,
text: &str,
) -> impl Future<Output = Result<Vec<String>>>
fn send_plain_text_to_chat( &self, chat_id: i64, text: &str, ) -> impl Future<Output = Result<Vec<String>>>
Sourcefn send_markdown_to_chat(
&self,
chat_id: i64,
text: &str,
) -> impl Future<Output = Result<Vec<String>>>
fn send_markdown_to_chat( &self, chat_id: i64, text: &str, ) -> impl Future<Output = Result<Vec<String>>>
Отправляет текст с Markdown-форматированием в чат.
§Аргументы
chat_id- идентификатор чатаtext- текст сообщения с Markdown-разметкой
§Возвращает
Набор mid фрагментов отправленного сообщения.
§Пример
use maxbot::MaxClientSimpleExt;
client.send_markdown_to_chat(chat_id, "**bold** и *italic*").await?;Sourcefn send_html_to_chat(
&self,
chat_id: i64,
text: &str,
) -> impl Future<Output = Result<Vec<String>>>
fn send_html_to_chat( &self, chat_id: i64, text: &str, ) -> impl Future<Output = Result<Vec<String>>>
Sourcefn send_image_to_chat(
&self,
chat_id: i64,
path: &Path,
caption: Option<&str>,
) -> impl Future<Output = Result<Vec<String>>>
fn send_image_to_chat( &self, chat_id: i64, path: &Path, caption: Option<&str>, ) -> impl Future<Output = Result<Vec<String>>>
Sourcefn send_video_to_chat(
&self,
chat_id: i64,
path: &Path,
caption: Option<&str>,
) -> impl Future<Output = Result<Vec<String>>>
fn send_video_to_chat( &self, chat_id: i64, path: &Path, caption: Option<&str>, ) -> impl Future<Output = Result<Vec<String>>>
Sourcefn send_audio_to_chat(
&self,
chat_id: i64,
path: &Path,
caption: Option<&str>,
) -> impl Future<Output = Result<Vec<String>>>
fn send_audio_to_chat( &self, chat_id: i64, path: &Path, caption: Option<&str>, ) -> impl Future<Output = Result<Vec<String>>>
Sourcefn send_file_to_chat(
&self,
chat_id: i64,
path: &Path,
caption: Option<&str>,
) -> impl Future<Output = Result<Vec<String>>>
fn send_file_to_chat( &self, chat_id: i64, path: &Path, caption: Option<&str>, ) -> impl Future<Output = Result<Vec<String>>>
Sourcefn send_sticker_to_chat(
&self,
chat_id: i64,
code: &str,
) -> impl Future<Output = Result<Vec<String>>>
fn send_sticker_to_chat( &self, chat_id: i64, code: &str, ) -> impl Future<Output = Result<Vec<String>>>
Sourcefn send_location_to_chat(
&self,
chat_id: i64,
latitude: f64,
longitude: f64,
) -> impl Future<Output = Result<Vec<String>>>
fn send_location_to_chat( &self, chat_id: i64, latitude: f64, longitude: f64, ) -> impl Future<Output = Result<Vec<String>>>
Sourcefn send_contact_to_chat(
&self,
chat_id: i64,
contact: ContactData,
) -> impl Future<Output = Result<Vec<String>>>
fn send_contact_to_chat( &self, chat_id: i64, contact: ContactData, ) -> impl Future<Output = Result<Vec<String>>>
Sourcefn send_keyboard_to_chat(
&self,
chat_id: i64,
text: &str,
keyboard: InlineKeyboard,
) -> impl Future<Output = Result<Vec<String>>>
fn send_keyboard_to_chat( &self, chat_id: i64, text: &str, keyboard: InlineKeyboard, ) -> impl Future<Output = Result<Vec<String>>>
Sourcefn send_plain_text_to_user(
&self,
user_id: i64,
text: &str,
) -> impl Future<Output = Result<Vec<String>>>
fn send_plain_text_to_user( &self, user_id: i64, text: &str, ) -> impl Future<Output = Result<Vec<String>>>
Sourcefn send_markdown_to_user(
&self,
user_id: i64,
text: &str,
) -> impl Future<Output = Result<Vec<String>>>
fn send_markdown_to_user( &self, user_id: i64, text: &str, ) -> impl Future<Output = Result<Vec<String>>>
Отправляет текст с Markdown-форматированием пользователю.
§Аргументы
user_id- идентификатор пользователяtext- текст сообщения с Markdown-разметкой
§Возвращает
Набор mid фрагментов отправленного сообщения.
§Пример
use maxbot::MaxClientSimpleExt;
client.send_markdown_to_user(user_id, "**bold** и *italic*").await?;Sourcefn send_html_to_user(
&self,
user_id: i64,
text: &str,
) -> impl Future<Output = Result<Vec<String>>>
fn send_html_to_user( &self, user_id: i64, text: &str, ) -> impl Future<Output = Result<Vec<String>>>
Sourcefn send_image_to_user(
&self,
user_id: i64,
path: &Path,
caption: Option<&str>,
) -> impl Future<Output = Result<Vec<String>>>
fn send_image_to_user( &self, user_id: i64, path: &Path, caption: Option<&str>, ) -> impl Future<Output = Result<Vec<String>>>
Sourcefn send_video_to_user(
&self,
user_id: i64,
path: &Path,
caption: Option<&str>,
) -> impl Future<Output = Result<Vec<String>>>
fn send_video_to_user( &self, user_id: i64, path: &Path, caption: Option<&str>, ) -> impl Future<Output = Result<Vec<String>>>
Sourcefn send_audio_to_user(
&self,
user_id: i64,
path: &Path,
caption: Option<&str>,
) -> impl Future<Output = Result<Vec<String>>>
fn send_audio_to_user( &self, user_id: i64, path: &Path, caption: Option<&str>, ) -> impl Future<Output = Result<Vec<String>>>
Sourcefn send_file_to_user(
&self,
user_id: i64,
path: &Path,
caption: Option<&str>,
) -> impl Future<Output = Result<Vec<String>>>
fn send_file_to_user( &self, user_id: i64, path: &Path, caption: Option<&str>, ) -> impl Future<Output = Result<Vec<String>>>
Sourcefn send_sticker_to_user(
&self,
user_id: i64,
code: &str,
) -> impl Future<Output = Result<Vec<String>>>
fn send_sticker_to_user( &self, user_id: i64, code: &str, ) -> impl Future<Output = Result<Vec<String>>>
Sourcefn send_location_to_user(
&self,
user_id: i64,
latitude: f64,
longitude: f64,
) -> impl Future<Output = Result<Vec<String>>>
fn send_location_to_user( &self, user_id: i64, latitude: f64, longitude: f64, ) -> impl Future<Output = Result<Vec<String>>>
Sourcefn send_contact_to_user(
&self,
user_id: i64,
contact: ContactData,
) -> impl Future<Output = Result<Vec<String>>>
fn send_contact_to_user( &self, user_id: i64, contact: ContactData, ) -> impl Future<Output = Result<Vec<String>>>
Sourcefn send_keyboard_to_user(
&self,
user_id: i64,
text: &str,
keyboard: InlineKeyboard,
) -> impl Future<Output = Result<Vec<String>>>
fn send_keyboard_to_user( &self, user_id: i64, text: &str, keyboard: InlineKeyboard, ) -> impl Future<Output = Result<Vec<String>>>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".