pub struct TelegramClient { /* private fields */ }Expand description
Telegram REST API client
Implementations§
Source§impl TelegramClient
impl TelegramClient
Sourcepub async fn send_message(
&self,
chat_id: i64,
text: &str,
reply_markup: Option<ReplyMarkup>,
) -> Result<(), BotError>
pub async fn send_message( &self, chat_id: i64, text: &str, reply_markup: Option<ReplyMarkup>, ) -> Result<(), BotError>
Send a text message
Sourcepub async fn edit_message_text(
&self,
chat_id: i64,
message_id: i64,
text: &str,
reply_markup: Option<ReplyMarkup>,
) -> Result<(), BotError>
pub async fn edit_message_text( &self, chat_id: i64, message_id: i64, text: &str, reply_markup: Option<ReplyMarkup>, ) -> Result<(), BotError>
Edit a message
Sourcepub async fn answer_callback_query(
&self,
callback_query_id: &str,
text: Option<&str>,
show_alert: bool,
) -> Result<(), BotError>
pub async fn answer_callback_query( &self, callback_query_id: &str, text: Option<&str>, show_alert: bool, ) -> Result<(), BotError>
Answer a callback query
Sourcepub async fn delete_webhook(&self) -> Result<(), BotError>
pub async fn delete_webhook(&self) -> Result<(), BotError>
Delete webhook
Sourcepub async fn get_updates(
&self,
offset: Option<i64>,
timeout: Option<u32>,
) -> Result<Vec<Update>, BotError>
pub async fn get_updates( &self, offset: Option<i64>, timeout: Option<u32>, ) -> Result<Vec<Update>, BotError>
Get updates using long polling
Sourcepub async fn send_chat_action(
&self,
chat_id: i64,
action: &str,
) -> Result<(), BotError>
pub async fn send_chat_action( &self, chat_id: i64, action: &str, ) -> Result<(), BotError>
Send a chat action (typing, uploading, etc.)
Sourcepub async fn set_my_commands(
&self,
commands: &[BotCommand],
) -> Result<(), BotError>
pub async fn set_my_commands( &self, commands: &[BotCommand], ) -> Result<(), BotError>
Set bot commands for the menu
Registers commands with Telegram so they appear in the command menu.
Trait Implementations§
Source§impl Clone for TelegramClient
impl Clone for TelegramClient
Source§fn clone(&self) -> TelegramClient
fn clone(&self) -> TelegramClient
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TelegramClient
impl RefUnwindSafe for TelegramClient
impl Send for TelegramClient
impl Sync for TelegramClient
impl Unpin for TelegramClient
impl UnsafeUnpin for TelegramClient
impl UnwindSafe for TelegramClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more