pub struct Bot(/* private fields */);Expand description
Type holding an active connection to telegram API
Implementations§
source§impl Bot
impl Bot
source§impl Bot
impl Bot
sourcepub async fn answer_web_app_query<'a>(
&self,
web_app_query_id: &'a str,
result: &'a InlineQueryResult
) -> BotResult<SentWebAppMessage>
pub async fn answer_web_app_query<'a>( &self, web_app_query_id: &'a str, result: &'a InlineQueryResult ) -> BotResult<SentWebAppMessage>
Use this method to set the result of an interaction with a Web App and send a corresponding message on behalf of the user to the chat from which the query originated. On success, a SentWebAppMessage object is returned.
sourcepub async fn get_me<'a>(&self) -> BotResult<User>
pub async fn get_me<'a>(&self) -> BotResult<User>
A simple method for testing your bot’s authentication token. Requires no parameters. Returns basic information about the bot in form of a User object.
sourcepub async fn delete_webhook<'a>(
&self,
drop_pending_updates: Option<bool>
) -> BotResult<bool>
pub async fn delete_webhook<'a>( &self, drop_pending_updates: Option<bool> ) -> BotResult<bool>
Use this method to remove webhook integration if you decide to switch back to getUpdates. Returns True on success.
sourcepub async fn close_general_forum_topic<'a>(
&self,
chat_id: i64
) -> BotResult<bool>
pub async fn close_general_forum_topic<'a>( &self, chat_id: i64 ) -> BotResult<bool>
Use this method to close an open ‘General’ topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. Returns True on success.
sourcepub async fn reopen_general_forum_topic<'a>(
&self,
chat_id: i64
) -> BotResult<bool>
pub async fn reopen_general_forum_topic<'a>( &self, chat_id: i64 ) -> BotResult<bool>
Use this method to reopen a closed ‘General’ topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. The topic will be automatically unhidden if it was hidden. Returns True on success.
sourcepub async fn get_my_description<'a>(
&self,
language_code: Option<&'a str>
) -> BotResult<BotDescription>
pub async fn get_my_description<'a>( &self, language_code: Option<&'a str> ) -> BotResult<BotDescription>
Use this method to get the current bot description for the given user language. Returns BotDescription on success.
sourcepub async fn delete_sticker_from_set<'a>(
&self,
sticker: &'a str
) -> BotResult<bool>
pub async fn delete_sticker_from_set<'a>( &self, sticker: &'a str ) -> BotResult<bool>
Use this method to delete a sticker from a set created by the bot. Returns True on success.
sourcepub async fn set_sticker_set_thumbnail<'a>(
&self,
name: &'a str,
user_id: i64,
thumbnail: Option<FileData>
) -> BotResult<bool>
pub async fn set_sticker_set_thumbnail<'a>( &self, name: &'a str, user_id: i64, thumbnail: Option<FileData> ) -> BotResult<bool>
Use this method to set the thumbnail of a regular or mask sticker set. The format of the thumbnail file must match the format of the stickers in the set. Returns True on success.
sourcepub async fn copy_message<'a>(
&self,
chat_id: i64,
message_thread_id: Option<i64>,
from_chat_id: i64,
message_id: i64,
caption: Option<&'a str>,
parse_mode: Option<&'a str>,
caption_entities: Option<&'a Vec<MessageEntity>>,
disable_notification: Option<bool>,
protect_content: Option<bool>,
reply_to_message_id: Option<i64>,
allow_sending_without_reply: Option<bool>,
reply_markup: Option<&'a EReplyMarkup>
) -> BotResult<MessageId>
pub async fn copy_message<'a>( &self, chat_id: i64, message_thread_id: Option<i64>, from_chat_id: i64, message_id: i64, caption: Option<&'a str>, parse_mode: Option<&'a str>, caption_entities: Option<&'a Vec<MessageEntity>>, disable_notification: Option<bool>, protect_content: Option<bool>, reply_to_message_id: Option<i64>, allow_sending_without_reply: Option<bool>, reply_markup: Option<&'a EReplyMarkup> ) -> BotResult<MessageId>
Use this method to copy messages of any kind. Service messages and invoice messages can’t be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessage, but the copied message doesn’t have a link to the original message. Returns the MessageId of the sent message on success.
sourcepub async fn get_sticker_set<'a>(&self, name: &'a str) -> BotResult<StickerSet>
pub async fn get_sticker_set<'a>(&self, name: &'a str) -> BotResult<StickerSet>
Use this method to get a sticker set. On success, a StickerSet object is returned.
sourcepub async fn edit_chat_invite_link<'a>(
&self,
chat_id: i64,
invite_link: &'a str,
name: Option<&'a str>,
expire_date: Option<i64>,
member_limit: Option<i64>,
creates_join_request: Option<bool>
) -> BotResult<ChatInviteLink>
pub async fn edit_chat_invite_link<'a>( &self, chat_id: i64, invite_link: &'a str, name: Option<&'a str>, expire_date: Option<i64>, member_limit: Option<i64>, creates_join_request: Option<bool> ) -> BotResult<ChatInviteLink>
Use this method to edit a non-primary invite link created by the bot. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the edited invite link as a ChatInviteLink object.
sourcepub async fn set_webhook<'a>(
&self,
url: &'a str,
certificate: Option<FileData>,
ip_address: Option<&'a str>,
max_connections: Option<i64>,
allowed_updates: Option<&'a Vec<String>>,
drop_pending_updates: Option<bool>,
secret_token: Option<&'a str>
) -> BotResult<bool>
pub async fn set_webhook<'a>( &self, url: &'a str, certificate: Option<FileData>, ip_address: Option<&'a str>, max_connections: Option<i64>, allowed_updates: Option<&'a Vec<String>>, drop_pending_updates: Option<bool>, secret_token: Option<&'a str> ) -> BotResult<bool>
Use this method to specify a URL and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified URL, containing a JSON-serialized Update. In case of an unsuccessful request, we will give up after a reasonable amount of attempts. Returns True on success.If you’d like to make sure that the webhook was set by you, you can specify secret data in the parameter secret_token. If specified, the request will contain a header “X-Telegram-Bot-Api-Secret-Token” with the secret token as content.
sourcepub async fn edit_message_text<'a>(
&self,
chat_id: Option<i64>,
message_id: Option<i64>,
inline_message_id: Option<&'a str>,
text: &'a str,
parse_mode: Option<&'a str>,
entities: Option<&'a Vec<MessageEntity>>,
disable_web_page_preview: Option<bool>,
reply_markup: Option<&'a InlineKeyboardMarkup>
) -> BotResult<MessageBool>
pub async fn edit_message_text<'a>( &self, chat_id: Option<i64>, message_id: Option<i64>, inline_message_id: Option<&'a str>, text: &'a str, parse_mode: Option<&'a str>, entities: Option<&'a Vec<MessageEntity>>, disable_web_page_preview: Option<bool>, reply_markup: Option<&'a InlineKeyboardMarkup> ) -> BotResult<MessageBool>
Use this method to edit text and game messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.
sourcepub async fn set_sticker_position_in_set<'a>(
&self,
sticker: &'a str,
position: i64
) -> BotResult<bool>
pub async fn set_sticker_position_in_set<'a>( &self, sticker: &'a str, position: i64 ) -> BotResult<bool>
Use this method to move a sticker in a set created by the bot to a specific position. Returns True on success.
sourcepub async fn get_custom_emoji_stickers<'a>(
&self,
custom_emoji_ids: &'a Vec<String>
) -> BotResult<Vec<Sticker>>
pub async fn get_custom_emoji_stickers<'a>( &self, custom_emoji_ids: &'a Vec<String> ) -> BotResult<Vec<Sticker>>
Use this method to get information about custom emoji stickers by their identifiers. Returns an Array of Sticker objects.
sourcepub async fn get_chat_member_count<'a>(&self, chat_id: i64) -> BotResult<i64>
pub async fn get_chat_member_count<'a>(&self, chat_id: i64) -> BotResult<i64>
Use this method to get the number of members in a chat. Returns Int on success.
sourcepub async fn create_forum_topic<'a>(
&self,
chat_id: i64,
name: &'a str,
icon_color: Option<i64>,
icon_custom_emoji_id: Option<&'a str>
) -> BotResult<ForumTopic>
pub async fn create_forum_topic<'a>( &self, chat_id: i64, name: &'a str, icon_color: Option<i64>, icon_custom_emoji_id: Option<&'a str> ) -> BotResult<ForumTopic>
Use this method to create a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. Returns information about the created topic as a ForumTopic object.
sourcepub async fn send_invoice<'a>(
&self,
chat_id: i64,
message_thread_id: Option<i64>,
title: &'a str,
description: &'a str,
payload: &'a str,
provider_token: &'a str,
currency: &'a str,
prices: &'a Vec<LabeledPrice>,
max_tip_amount: Option<i64>,
suggested_tip_amounts: Option<Vec<i64>>,
start_parameter: Option<&'a str>,
provider_data: Option<&'a str>,
photo_url: Option<&'a str>,
photo_size: Option<i64>,
photo_width: Option<i64>,
photo_height: Option<i64>,
need_name: Option<bool>,
need_phone_number: Option<bool>,
need_email: Option<bool>,
need_shipping_address: Option<bool>,
send_phone_number_to_provider: Option<bool>,
send_email_to_provider: Option<bool>,
is_flexible: Option<bool>,
disable_notification: Option<bool>,
protect_content: Option<bool>,
reply_to_message_id: Option<i64>,
allow_sending_without_reply: Option<bool>,
reply_markup: Option<&'a InlineKeyboardMarkup>
) -> BotResult<Message>
pub async fn send_invoice<'a>( &self, chat_id: i64, message_thread_id: Option<i64>, title: &'a str, description: &'a str, payload: &'a str, provider_token: &'a str, currency: &'a str, prices: &'a Vec<LabeledPrice>, max_tip_amount: Option<i64>, suggested_tip_amounts: Option<Vec<i64>>, start_parameter: Option<&'a str>, provider_data: Option<&'a str>, photo_url: Option<&'a str>, photo_size: Option<i64>, photo_width: Option<i64>, photo_height: Option<i64>, need_name: Option<bool>, need_phone_number: Option<bool>, need_email: Option<bool>, need_shipping_address: Option<bool>, send_phone_number_to_provider: Option<bool>, send_email_to_provider: Option<bool>, is_flexible: Option<bool>, disable_notification: Option<bool>, protect_content: Option<bool>, reply_to_message_id: Option<i64>, allow_sending_without_reply: Option<bool>, reply_markup: Option<&'a InlineKeyboardMarkup> ) -> BotResult<Message>
Use this method to send invoices. On success, the sent Message is returned.
sourcepub async fn get_chat<'a>(&self, chat_id: i64) -> BotResult<Chat>
pub async fn get_chat<'a>(&self, chat_id: i64) -> BotResult<Chat>
Use this method to get up to date information about the chat (current name of the user for one-on-one conversations, current username of a user, group or channel, etc.). Returns a Chat object on success.
sourcepub async fn send_audio<'a>(
&self,
chat_id: i64,
message_thread_id: Option<i64>,
audio: FileData,
caption: Option<&'a str>,
parse_mode: Option<&'a str>,
caption_entities: Option<&'a Vec<MessageEntity>>,
duration: Option<i64>,
performer: Option<&'a str>,
title: Option<&'a str>,
thumbnail: Option<FileData>,
disable_notification: Option<bool>,
protect_content: Option<bool>,
reply_to_message_id: Option<i64>,
allow_sending_without_reply: Option<bool>,
reply_markup: Option<&'a EReplyMarkup>
) -> BotResult<Message>
pub async fn send_audio<'a>( &self, chat_id: i64, message_thread_id: Option<i64>, audio: FileData, caption: Option<&'a str>, parse_mode: Option<&'a str>, caption_entities: Option<&'a Vec<MessageEntity>>, duration: Option<i64>, performer: Option<&'a str>, title: Option<&'a str>, thumbnail: Option<FileData>, disable_notification: Option<bool>, protect_content: Option<bool>, reply_to_message_id: Option<i64>, allow_sending_without_reply: Option<bool>, reply_markup: Option<&'a EReplyMarkup> ) -> BotResult<Message>
Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .MP3 or .M4A format. On success, the sent Message is returned. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future.For sending voice messages, use the sendVoice method instead.
sourcepub async fn send_video_note<'a>(
&self,
chat_id: i64,
message_thread_id: Option<i64>,
video_note: FileData,
duration: Option<i64>,
length: Option<i64>,
thumbnail: Option<FileData>,
disable_notification: Option<bool>,
protect_content: Option<bool>,
reply_to_message_id: Option<i64>,
allow_sending_without_reply: Option<bool>,
reply_markup: Option<&'a EReplyMarkup>
) -> BotResult<Message>
pub async fn send_video_note<'a>( &self, chat_id: i64, message_thread_id: Option<i64>, video_note: FileData, duration: Option<i64>, length: Option<i64>, thumbnail: Option<FileData>, disable_notification: Option<bool>, protect_content: Option<bool>, reply_to_message_id: Option<i64>, allow_sending_without_reply: Option<bool>, reply_markup: Option<&'a EReplyMarkup> ) -> BotResult<Message>
As of v.4.0, Telegram clients support rounded square MPEG4 videos of up to 1 minute long. Use this method to send video messages. On success, the sent Message is returned.
sourcepub async fn unhide_general_forum_topic<'a>(
&self,
chat_id: i64
) -> BotResult<bool>
pub async fn unhide_general_forum_topic<'a>( &self, chat_id: i64 ) -> BotResult<bool>
Use this method to unhide the ‘General’ topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. Returns True on success.
sourcepub async fn delete_message<'a>(
&self,
chat_id: i64,
message_id: i64
) -> BotResult<bool>
pub async fn delete_message<'a>( &self, chat_id: i64, message_id: i64 ) -> BotResult<bool>
Use this method to delete a message, including service messages, with the following limitations:- A message can only be deleted if it was sent less than 48 hours ago.- Service messages about a supergroup, channel, or forum topic creation can’t be deleted.- A dice message in a private chat can only be deleted if it was sent more than 24 hours ago.- Bots can delete outgoing messages in private chats, groups, and supergroups.- Bots can delete incoming messages in private chats.- Bots granted can_post_messages permissions can delete outgoing messages in channels.- If the bot is an administrator of a group, it can delete any message there.- If the bot has can_delete_messages permission in a supergroup or a channel, it can delete any message there.Returns True on success.
sourcepub async fn export_chat_invite_link<'a>(
&self,
chat_id: i64
) -> BotResult<String>
pub async fn export_chat_invite_link<'a>( &self, chat_id: i64 ) -> BotResult<String>
Use this method to generate a new primary invite link for a chat; any previously generated primary link is revoked. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the new invite link as String on success.
sourcepub async fn send_location<'a>(
&self,
chat_id: i64,
message_thread_id: Option<i64>,
latitude: f64,
longitude: f64,
horizontal_accuracy: Option<f64>,
live_period: Option<i64>,
heading: Option<i64>,
proximity_alert_radius: Option<i64>,
disable_notification: Option<bool>,
protect_content: Option<bool>,
reply_to_message_id: Option<i64>,
allow_sending_without_reply: Option<bool>,
reply_markup: Option<&'a EReplyMarkup>
) -> BotResult<Message>
pub async fn send_location<'a>( &self, chat_id: i64, message_thread_id: Option<i64>, latitude: f64, longitude: f64, horizontal_accuracy: Option<f64>, live_period: Option<i64>, heading: Option<i64>, proximity_alert_radius: Option<i64>, disable_notification: Option<bool>, protect_content: Option<bool>, reply_to_message_id: Option<i64>, allow_sending_without_reply: Option<bool>, reply_markup: Option<&'a EReplyMarkup> ) -> BotResult<Message>
Use this method to send point on the map. On success, the sent Message is returned.
sourcepub async fn send_venue<'a>(
&self,
chat_id: i64,
message_thread_id: Option<i64>,
latitude: f64,
longitude: f64,
title: &'a str,
address: &'a str,
foursquare_id: Option<&'a str>,
foursquare_type: Option<&'a str>,
google_place_id: Option<&'a str>,
google_place_type: Option<&'a str>,
disable_notification: Option<bool>,
protect_content: Option<bool>,
reply_to_message_id: Option<i64>,
allow_sending_without_reply: Option<bool>,
reply_markup: Option<&'a EReplyMarkup>
) -> BotResult<Message>
pub async fn send_venue<'a>( &self, chat_id: i64, message_thread_id: Option<i64>, latitude: f64, longitude: f64, title: &'a str, address: &'a str, foursquare_id: Option<&'a str>, foursquare_type: Option<&'a str>, google_place_id: Option<&'a str>, google_place_type: Option<&'a str>, disable_notification: Option<bool>, protect_content: Option<bool>, reply_to_message_id: Option<i64>, allow_sending_without_reply: Option<bool>, reply_markup: Option<&'a EReplyMarkup> ) -> BotResult<Message>
Use this method to send information about a venue. On success, the sent Message is returned.
sourcepub async fn set_chat_photo<'a>(
&self,
chat_id: i64,
photo: FileData
) -> BotResult<bool>
pub async fn set_chat_photo<'a>( &self, chat_id: i64, photo: FileData ) -> BotResult<bool>
Use this method to set a new profile photo for the chat. Photos can’t be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success.
sourcepub async fn edit_forum_topic<'a>(
&self,
chat_id: i64,
message_thread_id: i64,
name: Option<&'a str>,
icon_custom_emoji_id: Option<&'a str>
) -> BotResult<bool>
pub async fn edit_forum_topic<'a>( &self, chat_id: i64, message_thread_id: i64, name: Option<&'a str>, icon_custom_emoji_id: Option<&'a str> ) -> BotResult<bool>
Use this method to edit name and icon of a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success.
sourcepub async fn edit_message_reply_markup<'a>(
&self,
chat_id: Option<i64>,
message_id: Option<i64>,
inline_message_id: Option<&'a str>,
reply_markup: Option<&'a InlineKeyboardMarkup>
) -> BotResult<MessageBool>
pub async fn edit_message_reply_markup<'a>( &self, chat_id: Option<i64>, message_id: Option<i64>, inline_message_id: Option<&'a str>, reply_markup: Option<&'a InlineKeyboardMarkup> ) -> BotResult<MessageBool>
Use this method to edit only the reply markup of messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.
sourcepub async fn set_sticker_set_title<'a>(
&self,
name: &'a str,
title: &'a str
) -> BotResult<bool>
pub async fn set_sticker_set_title<'a>( &self, name: &'a str, title: &'a str ) -> BotResult<bool>
Use this method to set the title of a created sticker set. Returns True on success.
sourcepub async fn promote_chat_member<'a>(
&self,
chat_id: i64,
user_id: i64,
is_anonymous: Option<bool>,
can_manage_chat: Option<bool>,
can_post_messages: Option<bool>,
can_edit_messages: Option<bool>,
can_delete_messages: Option<bool>,
can_post_stories: Option<bool>,
can_edit_stories: Option<bool>,
can_delete_stories: Option<bool>,
can_manage_video_chats: Option<bool>,
can_restrict_members: Option<bool>,
can_promote_members: Option<bool>,
can_change_info: Option<bool>,
can_invite_users: Option<bool>,
can_pin_messages: Option<bool>,
can_manage_topics: Option<bool>
) -> BotResult<bool>
pub async fn promote_chat_member<'a>( &self, chat_id: i64, user_id: i64, is_anonymous: Option<bool>, can_manage_chat: Option<bool>, can_post_messages: Option<bool>, can_edit_messages: Option<bool>, can_delete_messages: Option<bool>, can_post_stories: Option<bool>, can_edit_stories: Option<bool>, can_delete_stories: Option<bool>, can_manage_video_chats: Option<bool>, can_restrict_members: Option<bool>, can_promote_members: Option<bool>, can_change_info: Option<bool>, can_invite_users: Option<bool>, can_pin_messages: Option<bool>, can_manage_topics: Option<bool> ) -> BotResult<bool>
Use this method to promote or demote a user in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Pass False for all boolean parameters to demote a user. Returns True on success.
sourcepub async fn edit_general_forum_topic<'a>(
&self,
chat_id: i64,
name: &'a str
) -> BotResult<bool>
pub async fn edit_general_forum_topic<'a>( &self, chat_id: i64, name: &'a str ) -> BotResult<bool>
Use this method to edit the name of the ‘General’ topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have can_manage_topics administrator rights. Returns True on success.
sourcepub async fn delete_chat_sticker_set<'a>(&self, chat_id: i64) -> BotResult<bool>
pub async fn delete_chat_sticker_set<'a>(&self, chat_id: i64) -> BotResult<bool>
Use this method to delete a group sticker set from a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Use the field can_set_sticker_set optionally returned in getChat requests to check if the bot can use this method. Returns True on success.
sourcepub async fn pin_chat_message<'a>(
&self,
chat_id: i64,
message_id: i64,
disable_notification: Option<bool>
) -> BotResult<bool>
pub async fn pin_chat_message<'a>( &self, chat_id: i64, message_id: i64, disable_notification: Option<bool> ) -> BotResult<bool>
Use this method to add a message to the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the ‘can_pin_messages’ administrator right in a supergroup or ‘can_edit_messages’ administrator right in a channel. Returns True on success.
sourcepub async fn delete_sticker_set<'a>(&self, name: &'a str) -> BotResult<bool>
pub async fn delete_sticker_set<'a>(&self, name: &'a str) -> BotResult<bool>
Use this method to delete a sticker set that was created by the bot. Returns True on success.
sourcepub async fn set_chat_title<'a>(
&self,
chat_id: i64,
title: &'a str
) -> BotResult<bool>
pub async fn set_chat_title<'a>( &self, chat_id: i64, title: &'a str ) -> BotResult<bool>
Use this method to change the title of a chat. Titles can’t be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success.
sourcepub async fn set_custom_emoji_sticker_set_thumbnail<'a>(
&self,
name: &'a str,
custom_emoji_id: Option<&'a str>
) -> BotResult<bool>
pub async fn set_custom_emoji_sticker_set_thumbnail<'a>( &self, name: &'a str, custom_emoji_id: Option<&'a str> ) -> BotResult<bool>
Use this method to set the thumbnail of a custom emoji sticker set. Returns True on success.
sourcepub async fn send_media_group<'a>(
&self,
chat_id: i64,
message_thread_id: Option<i64>,
media: &'a Vec<EMedia>,
disable_notification: Option<bool>,
protect_content: Option<bool>,
reply_to_message_id: Option<i64>,
allow_sending_without_reply: Option<bool>
) -> BotResult<Vec<Message>>
pub async fn send_media_group<'a>( &self, chat_id: i64, message_thread_id: Option<i64>, media: &'a Vec<EMedia>, disable_notification: Option<bool>, protect_content: Option<bool>, reply_to_message_id: Option<i64>, allow_sending_without_reply: Option<bool> ) -> BotResult<Vec<Message>>
Use this method to send a group of photos, videos, documents or audios as an album. Documents and audio files can be only grouped in an album with messages of the same type. On success, an array of Messages that were sent is returned.
sourcepub async fn get_my_short_description<'a>(
&self,
language_code: Option<&'a str>
) -> BotResult<BotShortDescription>
pub async fn get_my_short_description<'a>( &self, language_code: Option<&'a str> ) -> BotResult<BotShortDescription>
Use this method to get the current bot short description for the given user language. Returns BotShortDescription on success.
sourcepub async fn upload_sticker_file<'a>(
&self,
user_id: i64,
sticker: FileData,
sticker_format: &'a str
) -> BotResult<File>
pub async fn upload_sticker_file<'a>( &self, user_id: i64, sticker: FileData, sticker_format: &'a str ) -> BotResult<File>
Use this method to upload a file with a sticker for later use in the createNewStickerSet and addStickerToSet methods (the file can be used multiple times). Returns the uploaded File on success.
sourcepub async fn edit_message_live_location<'a>(
&self,
chat_id: Option<i64>,
message_id: Option<i64>,
inline_message_id: Option<&'a str>,
latitude: f64,
longitude: f64,
horizontal_accuracy: Option<f64>,
heading: Option<i64>,
proximity_alert_radius: Option<i64>,
reply_markup: Option<&'a InlineKeyboardMarkup>
) -> BotResult<MessageBool>
pub async fn edit_message_live_location<'a>( &self, chat_id: Option<i64>, message_id: Option<i64>, inline_message_id: Option<&'a str>, latitude: f64, longitude: f64, horizontal_accuracy: Option<f64>, heading: Option<i64>, proximity_alert_radius: Option<i64>, reply_markup: Option<&'a InlineKeyboardMarkup> ) -> BotResult<MessageBool>
Use this method to edit live location messages. A location can be edited until its live_period expires or editing is explicitly disabled by a call to stopMessageLiveLocation. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.
sourcepub async fn set_sticker_mask_position<'a>(
&self,
sticker: &'a str,
mask_position: Option<&'a MaskPosition>
) -> BotResult<bool>
pub async fn set_sticker_mask_position<'a>( &self, sticker: &'a str, mask_position: Option<&'a MaskPosition> ) -> BotResult<bool>
Use this method to change the mask position of a mask sticker. The sticker must belong to a sticker set that was created by the bot. Returns True on success.
sourcepub async fn decline_chat_join_request<'a>(
&self,
chat_id: i64,
user_id: i64
) -> BotResult<bool>
pub async fn decline_chat_join_request<'a>( &self, chat_id: i64, user_id: i64 ) -> BotResult<bool>
Use this method to decline a chat join request. The bot must be an administrator in the chat for this to work and must have the can_invite_users administrator right. Returns True on success.
sourcepub async fn get_my_name<'a>(
&self,
language_code: Option<&'a str>
) -> BotResult<BotName>
pub async fn get_my_name<'a>( &self, language_code: Option<&'a str> ) -> BotResult<BotName>
Use this method to get the current bot name for the given user language. Returns BotName on success.
sourcepub async fn close_forum_topic<'a>(
&self,
chat_id: i64,
message_thread_id: i64
) -> BotResult<bool>
pub async fn close_forum_topic<'a>( &self, chat_id: i64, message_thread_id: i64 ) -> BotResult<bool>
Use this method to close an open topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success.
sourcepub async fn leave_chat<'a>(&self, chat_id: i64) -> BotResult<bool>
pub async fn leave_chat<'a>(&self, chat_id: i64) -> BotResult<bool>
Use this method for your bot to leave a group, supergroup or channel. Returns True on success.
sourcepub async fn log_out<'a>(&self) -> BotResult<bool>
pub async fn log_out<'a>(&self) -> BotResult<bool>
Use this method to log out from the cloud Bot API server before launching the bot locally. You must log out the bot before running it locally, otherwise there is no guarantee that the bot will receive updates. After a successful call, you can immediately log in on a local server, but will not be able to log in back to the cloud Bot API server for 10 minutes. Returns True on success. Requires no parameters.
sourcepub async fn send_contact<'a>(
&self,
chat_id: i64,
message_thread_id: Option<i64>,
phone_number: &'a str,
first_name: &'a str,
last_name: Option<&'a str>,
vcard: Option<&'a str>,
disable_notification: Option<bool>,
protect_content: Option<bool>,
reply_to_message_id: Option<i64>,
allow_sending_without_reply: Option<bool>,
reply_markup: Option<&'a EReplyMarkup>
) -> BotResult<Message>
pub async fn send_contact<'a>( &self, chat_id: i64, message_thread_id: Option<i64>, phone_number: &'a str, first_name: &'a str, last_name: Option<&'a str>, vcard: Option<&'a str>, disable_notification: Option<bool>, protect_content: Option<bool>, reply_to_message_id: Option<i64>, allow_sending_without_reply: Option<bool>, reply_markup: Option<&'a EReplyMarkup> ) -> BotResult<Message>
Use this method to send phone contacts. On success, the sent Message is returned.
sourcepub async fn delete_forum_topic<'a>(
&self,
chat_id: i64,
message_thread_id: i64
) -> BotResult<bool>
pub async fn delete_forum_topic<'a>( &self, chat_id: i64, message_thread_id: i64 ) -> BotResult<bool>
Use this method to delete a forum topic along with all its messages in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_delete_messages administrator rights. Returns True on success.
sourcepub async fn revoke_chat_invite_link<'a>(
&self,
chat_id: i64,
invite_link: &'a str
) -> BotResult<ChatInviteLink>
pub async fn revoke_chat_invite_link<'a>( &self, chat_id: i64, invite_link: &'a str ) -> BotResult<ChatInviteLink>
Use this method to revoke an invite link created by the bot. If the primary link is revoked, a new link is automatically generated. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the revoked invite link as ChatInviteLink object.
sourcepub async fn set_chat_description<'a>(
&self,
chat_id: i64,
description: Option<&'a str>
) -> BotResult<bool>
pub async fn set_chat_description<'a>( &self, chat_id: i64, description: Option<&'a str> ) -> BotResult<bool>
Use this method to change the description of a group, a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success.
sourcepub async fn create_invoice_link<'a>(
&self,
title: &'a str,
description: &'a str,
payload: &'a str,
provider_token: &'a str,
currency: &'a str,
prices: &'a Vec<LabeledPrice>,
max_tip_amount: Option<i64>,
suggested_tip_amounts: Option<Vec<i64>>,
provider_data: Option<&'a str>,
photo_url: Option<&'a str>,
photo_size: Option<i64>,
photo_width: Option<i64>,
photo_height: Option<i64>,
need_name: Option<bool>,
need_phone_number: Option<bool>,
need_email: Option<bool>,
need_shipping_address: Option<bool>,
send_phone_number_to_provider: Option<bool>,
send_email_to_provider: Option<bool>,
is_flexible: Option<bool>
) -> BotResult<String>
pub async fn create_invoice_link<'a>( &self, title: &'a str, description: &'a str, payload: &'a str, provider_token: &'a str, currency: &'a str, prices: &'a Vec<LabeledPrice>, max_tip_amount: Option<i64>, suggested_tip_amounts: Option<Vec<i64>>, provider_data: Option<&'a str>, photo_url: Option<&'a str>, photo_size: Option<i64>, photo_width: Option<i64>, photo_height: Option<i64>, need_name: Option<bool>, need_phone_number: Option<bool>, need_email: Option<bool>, need_shipping_address: Option<bool>, send_phone_number_to_provider: Option<bool>, send_email_to_provider: Option<bool>, is_flexible: Option<bool> ) -> BotResult<String>
Use this method to create a link for an invoice. Returns the created invoice link as String on success.
sourcepub async fn create_chat_invite_link<'a>(
&self,
chat_id: i64,
name: Option<&'a str>,
expire_date: Option<i64>,
member_limit: Option<i64>,
creates_join_request: Option<bool>
) -> BotResult<ChatInviteLink>
pub async fn create_chat_invite_link<'a>( &self, chat_id: i64, name: Option<&'a str>, expire_date: Option<i64>, member_limit: Option<i64>, creates_join_request: Option<bool> ) -> BotResult<ChatInviteLink>
Use this method to create an additional invite link for a chat. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. The link can be revoked using the method revokeChatInviteLink. Returns the new invite link as ChatInviteLink object.
sourcepub async fn get_chat_administrators<'a>(
&self,
chat_id: i64
) -> BotResult<Vec<ChatMember>>
pub async fn get_chat_administrators<'a>( &self, chat_id: i64 ) -> BotResult<Vec<ChatMember>>
Use this method to get a list of administrators in a chat, which aren’t bots. Returns an Array of ChatMember objects.
sourcepub async fn hide_general_forum_topic<'a>(
&self,
chat_id: i64
) -> BotResult<bool>
pub async fn hide_general_forum_topic<'a>( &self, chat_id: i64 ) -> BotResult<bool>
Use this method to hide the ‘General’ topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. The topic will be automatically closed if it was open. Returns True on success.
sourcepub async fn send_chat_action<'a>(
&self,
chat_id: i64,
message_thread_id: Option<i64>,
action: &'a str
) -> BotResult<bool>
pub async fn send_chat_action<'a>( &self, chat_id: i64, message_thread_id: Option<i64>, action: &'a str ) -> BotResult<bool>
Use this method when you need to tell the user that something is happening on the bot’s side. The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status). Returns True on success.We only recommend using this method when a response from the bot will take a noticeable amount of time to arrive.
Use this method to get the current value of the bot’s menu button in a private chat, or the default menu button. Returns MenuButton on success.
sourcepub async fn edit_message_caption<'a>(
&self,
chat_id: Option<i64>,
message_id: Option<i64>,
inline_message_id: Option<&'a str>,
caption: Option<&'a str>,
parse_mode: Option<&'a str>,
caption_entities: Option<&'a Vec<MessageEntity>>,
reply_markup: Option<&'a InlineKeyboardMarkup>
) -> BotResult<MessageBool>
pub async fn edit_message_caption<'a>( &self, chat_id: Option<i64>, message_id: Option<i64>, inline_message_id: Option<&'a str>, caption: Option<&'a str>, parse_mode: Option<&'a str>, caption_entities: Option<&'a Vec<MessageEntity>>, reply_markup: Option<&'a InlineKeyboardMarkup> ) -> BotResult<MessageBool>
Use this method to edit captions of messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.
sourcepub async fn unpin_all_general_forum_topic_messages<'a>(
&self,
chat_id: i64
) -> BotResult<bool>
pub async fn unpin_all_general_forum_topic_messages<'a>( &self, chat_id: i64 ) -> BotResult<bool>
Use this method to clear the list of pinned messages in a General forum topic. The bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator right in the supergroup. Returns True on success.
sourcepub async fn get_game_high_scores<'a>(
&self,
user_id: i64,
chat_id: Option<i64>,
message_id: Option<i64>,
inline_message_id: Option<&'a str>
) -> BotResult<Vec<GameHighScore>>
pub async fn get_game_high_scores<'a>( &self, user_id: i64, chat_id: Option<i64>, message_id: Option<i64>, inline_message_id: Option<&'a str> ) -> BotResult<Vec<GameHighScore>>
Use this method to get data for high score tables. Will return the score of the specified user and several of their neighbors in a game. Returns an Array of GameHighScore objects.
sourcepub async fn get_updates<'a>(
&self,
offset: Option<i64>,
limit: Option<i64>,
timeout: Option<i64>,
allowed_updates: Option<&'a Vec<String>>
) -> BotResult<Vec<Update>>
pub async fn get_updates<'a>( &self, offset: Option<i64>, limit: Option<i64>, timeout: Option<i64>, allowed_updates: Option<&'a Vec<String>> ) -> BotResult<Vec<Update>>
Use this method to receive incoming updates using long polling (wiki). Returns an Array of Update objects.
sourcepub async fn send_message<'a>(
&self,
chat_id: i64,
message_thread_id: Option<i64>,
text: &'a str,
parse_mode: Option<&'a str>,
entities: Option<&'a Vec<MessageEntity>>,
disable_web_page_preview: Option<bool>,
disable_notification: Option<bool>,
protect_content: Option<bool>,
reply_to_message_id: Option<i64>,
allow_sending_without_reply: Option<bool>,
reply_markup: Option<&'a EReplyMarkup>
) -> BotResult<Message>
pub async fn send_message<'a>( &self, chat_id: i64, message_thread_id: Option<i64>, text: &'a str, parse_mode: Option<&'a str>, entities: Option<&'a Vec<MessageEntity>>, disable_web_page_preview: Option<bool>, disable_notification: Option<bool>, protect_content: Option<bool>, reply_to_message_id: Option<i64>, allow_sending_without_reply: Option<bool>, reply_markup: Option<&'a EReplyMarkup> ) -> BotResult<Message>
Use this method to send text messages. On success, the sent Message is returned.
sourcepub async fn delete_my_commands<'a>(
&self,
scope: Option<&'a BotCommandScope>,
language_code: Option<&'a str>
) -> BotResult<bool>
pub async fn delete_my_commands<'a>( &self, scope: Option<&'a BotCommandScope>, language_code: Option<&'a str> ) -> BotResult<bool>
Use this method to delete the list of the bot’s commands for the given scope and user language. After deletion, higher level commands will be shown to affected users. Returns True on success.
sourcepub async fn unpin_all_chat_messages<'a>(&self, chat_id: i64) -> BotResult<bool>
pub async fn unpin_all_chat_messages<'a>(&self, chat_id: i64) -> BotResult<bool>
Use this method to clear the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the ‘can_pin_messages’ administrator right in a supergroup or ‘can_edit_messages’ administrator right in a channel. Returns True on success.
sourcepub async fn stop_poll<'a>(
&self,
chat_id: i64,
message_id: i64,
reply_markup: Option<&'a InlineKeyboardMarkup>
) -> BotResult<Poll>
pub async fn stop_poll<'a>( &self, chat_id: i64, message_id: i64, reply_markup: Option<&'a InlineKeyboardMarkup> ) -> BotResult<Poll>
Use this method to stop a poll which was sent by the bot. On success, the stopped Poll is returned.
sourcepub async fn send_game<'a>(
&self,
chat_id: i64,
message_thread_id: Option<i64>,
game_short_name: &'a str,
disable_notification: Option<bool>,
protect_content: Option<bool>,
reply_to_message_id: Option<i64>,
allow_sending_without_reply: Option<bool>,
reply_markup: Option<&'a InlineKeyboardMarkup>
) -> BotResult<Message>
pub async fn send_game<'a>( &self, chat_id: i64, message_thread_id: Option<i64>, game_short_name: &'a str, disable_notification: Option<bool>, protect_content: Option<bool>, reply_to_message_id: Option<i64>, allow_sending_without_reply: Option<bool>, reply_markup: Option<&'a InlineKeyboardMarkup> ) -> BotResult<Message>
Use this method to send a game. On success, the sent Message is returned.
sourcepub async fn create_new_sticker_set<'a>(
&self,
user_id: i64,
name: &'a str,
title: &'a str,
stickers: &'a Vec<InputSticker>,
sticker_format: &'a str,
sticker_type: Option<&'a str>,
needs_repainting: Option<bool>
) -> BotResult<bool>
pub async fn create_new_sticker_set<'a>( &self, user_id: i64, name: &'a str, title: &'a str, stickers: &'a Vec<InputSticker>, sticker_format: &'a str, sticker_type: Option<&'a str>, needs_repainting: Option<bool> ) -> BotResult<bool>
Use this method to create a new sticker set owned by a user. The bot will be able to edit the sticker set thus created. Returns True on success.
sourcepub async fn unban_chat_sender_chat<'a>(
&self,
chat_id: i64,
sender_chat_id: i64
) -> BotResult<bool>
pub async fn unban_chat_sender_chat<'a>( &self, chat_id: i64, sender_chat_id: i64 ) -> BotResult<bool>
Use this method to unban a previously banned channel chat in a supergroup or channel. The bot must be an administrator for this to work and must have the appropriate administrator rights. Returns True on success.
sourcepub async fn send_sticker<'a>(
&self,
chat_id: i64,
message_thread_id: Option<i64>,
sticker: FileData,
emoji: Option<&'a str>,
disable_notification: Option<bool>,
protect_content: Option<bool>,
reply_to_message_id: Option<i64>,
allow_sending_without_reply: Option<bool>,
reply_markup: Option<&'a EReplyMarkup>
) -> BotResult<Message>
pub async fn send_sticker<'a>( &self, chat_id: i64, message_thread_id: Option<i64>, sticker: FileData, emoji: Option<&'a str>, disable_notification: Option<bool>, protect_content: Option<bool>, reply_to_message_id: Option<i64>, allow_sending_without_reply: Option<bool>, reply_markup: Option<&'a EReplyMarkup> ) -> BotResult<Message>
Use this method to send static .WEBP, animated .TGS, or video .WEBM stickers. On success, the sent Message is returned.
sourcepub async fn send_animation<'a>(
&self,
chat_id: i64,
message_thread_id: Option<i64>,
animation: FileData,
duration: Option<i64>,
width: Option<i64>,
height: Option<i64>,
thumbnail: Option<FileData>,
caption: Option<&'a str>,
parse_mode: Option<&'a str>,
caption_entities: Option<&'a Vec<MessageEntity>>,
has_spoiler: Option<bool>,
disable_notification: Option<bool>,
protect_content: Option<bool>,
reply_to_message_id: Option<i64>,
allow_sending_without_reply: Option<bool>,
reply_markup: Option<&'a EReplyMarkup>
) -> BotResult<Message>
pub async fn send_animation<'a>( &self, chat_id: i64, message_thread_id: Option<i64>, animation: FileData, duration: Option<i64>, width: Option<i64>, height: Option<i64>, thumbnail: Option<FileData>, caption: Option<&'a str>, parse_mode: Option<&'a str>, caption_entities: Option<&'a Vec<MessageEntity>>, has_spoiler: Option<bool>, disable_notification: Option<bool>, protect_content: Option<bool>, reply_to_message_id: Option<i64>, allow_sending_without_reply: Option<bool>, reply_markup: Option<&'a EReplyMarkup> ) -> BotResult<Message>
Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). On success, the sent Message is returned. Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future.
sourcepub async fn set_my_commands<'a>(
&self,
commands: &'a Vec<BotCommand>,
scope: Option<&'a BotCommandScope>,
language_code: Option<&'a str>
) -> BotResult<bool>
pub async fn set_my_commands<'a>( &self, commands: &'a Vec<BotCommand>, scope: Option<&'a BotCommandScope>, language_code: Option<&'a str> ) -> BotResult<bool>
Use this method to change the list of the bot’s commands. See this manual for more details about bot commands. Returns True on success.
sourcepub async fn get_webhook_info<'a>(&self) -> BotResult<WebhookInfo>
pub async fn get_webhook_info<'a>(&self) -> BotResult<WebhookInfo>
Use this method to get current webhook status. Requires no parameters. On success, returns a WebhookInfo object. If the bot is using getUpdates, will return an object with the url field empty.
sourcepub async fn answer_inline_query<'a>(
&self,
inline_query_id: &'a str,
results: &'a Vec<InlineQueryResult>,
cache_time: Option<i64>,
is_personal: Option<bool>,
next_offset: Option<&'a str>,
button: Option<&'a InlineQueryResultsButton>
) -> BotResult<bool>
pub async fn answer_inline_query<'a>( &self, inline_query_id: &'a str, results: &'a Vec<InlineQueryResult>, cache_time: Option<i64>, is_personal: Option<bool>, next_offset: Option<&'a str>, button: Option<&'a InlineQueryResultsButton> ) -> BotResult<bool>
Use this method to send answers to an inline query. On success, True is returned.No more than 50 results per query are allowed.
sourcepub async fn set_chat_permissions<'a>(
&self,
chat_id: i64,
permissions: &'a ChatPermissions,
use_independent_chat_permissions: Option<bool>
) -> BotResult<bool>
pub async fn set_chat_permissions<'a>( &self, chat_id: i64, permissions: &'a ChatPermissions, use_independent_chat_permissions: Option<bool> ) -> BotResult<bool>
Use this method to set default chat permissions for all members. The bot must be an administrator in the group or a supergroup for this to work and must have the can_restrict_members administrator rights. Returns True on success.
sourcepub async fn set_sticker_keywords<'a>(
&self,
sticker: &'a str,
keywords: Option<&'a Vec<String>>
) -> BotResult<bool>
pub async fn set_sticker_keywords<'a>( &self, sticker: &'a str, keywords: Option<&'a Vec<String>> ) -> BotResult<bool>
Use this method to change search keywords assigned to a regular or custom emoji sticker. The sticker must belong to a sticker set created by the bot. Returns True on success.
sourcepub async fn edit_message_media<'a>(
&self,
chat_id: Option<i64>,
message_id: Option<i64>,
inline_message_id: Option<&'a str>,
media: &'a InputMedia,
reply_markup: Option<&'a InlineKeyboardMarkup>
) -> BotResult<MessageBool>
pub async fn edit_message_media<'a>( &self, chat_id: Option<i64>, message_id: Option<i64>, inline_message_id: Option<&'a str>, media: &'a InputMedia, reply_markup: Option<&'a InlineKeyboardMarkup> ) -> BotResult<MessageBool>
Use this method to edit animation, audio, document, photo, or video messages. If a message is part of a message album, then it can be edited only to an audio for audio albums, only to a document for document albums and to a photo or a video otherwise. When an inline message is edited, a new file can’t be uploaded; use a previously uploaded file via its file_id or specify a URL. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.
sourcepub async fn set_sticker_emoji_list<'a>(
&self,
sticker: &'a str,
emoji_list: &'a Vec<String>
) -> BotResult<bool>
pub async fn set_sticker_emoji_list<'a>( &self, sticker: &'a str, emoji_list: &'a Vec<String> ) -> BotResult<bool>
Use this method to change the list of emoji assigned to a regular or custom emoji sticker. The sticker must belong to a sticker set created by the bot. Returns True on success.
sourcepub async fn answer_callback_query<'a>(
&self,
callback_query_id: &'a str,
text: Option<&'a str>,
show_alert: Option<bool>,
url: Option<&'a str>,
cache_time: Option<i64>
) -> BotResult<bool>
pub async fn answer_callback_query<'a>( &self, callback_query_id: &'a str, text: Option<&'a str>, show_alert: Option<bool>, url: Option<&'a str>, cache_time: Option<i64> ) -> BotResult<bool>
Use this method to send answers to callback queries sent from inline keyboards. The answer will be displayed to the user as a notification at the top of the chat screen or as an alert. On success, True is returned.
sourcepub async fn answer_pre_checkout_query<'a>(
&self,
pre_checkout_query_id: &'a str,
ok: bool,
error_message: Option<&'a str>
) -> BotResult<bool>
pub async fn answer_pre_checkout_query<'a>( &self, pre_checkout_query_id: &'a str, ok: bool, error_message: Option<&'a str> ) -> BotResult<bool>
Once the user has confirmed their payment and shipping details, the Bot API sends the final confirmation in the form of an Update with the field pre_checkout_query. Use this method to respond to such pre-checkout queries. On success, True is returned. Note: The Bot API must receive an answer within 10 seconds after the pre-checkout query was sent.
sourcepub async fn unban_chat_member<'a>(
&self,
chat_id: i64,
user_id: i64,
only_if_banned: Option<bool>
) -> BotResult<bool>
pub async fn unban_chat_member<'a>( &self, chat_id: i64, user_id: i64, only_if_banned: Option<bool> ) -> BotResult<bool>
Use this method to unban a previously banned user in a supergroup or channel. The user will not return to the group or channel automatically, but will be able to join via link, etc. The bot must be an administrator for this to work. By default, this method guarantees that after the call the user is not a member of the chat, but will be able to join it. So if the user is a member of the chat they will also be removed from the chat. If you don’t want this, use the parameter only_if_banned. Returns True on success.
sourcepub async fn forward_message<'a>(
&self,
chat_id: i64,
message_thread_id: Option<i64>,
from_chat_id: i64,
disable_notification: Option<bool>,
protect_content: Option<bool>,
message_id: i64
) -> BotResult<Message>
pub async fn forward_message<'a>( &self, chat_id: i64, message_thread_id: Option<i64>, from_chat_id: i64, disable_notification: Option<bool>, protect_content: Option<bool>, message_id: i64 ) -> BotResult<Message>
Use this method to forward messages of any kind. Service messages can’t be forwarded. On success, the sent Message is returned.
sourcepub async fn get_my_commands<'a>(
&self,
scope: Option<&'a BotCommandScope>,
language_code: Option<&'a str>
) -> BotResult<Vec<BotCommand>>
pub async fn get_my_commands<'a>( &self, scope: Option<&'a BotCommandScope>, language_code: Option<&'a str> ) -> BotResult<Vec<BotCommand>>
Use this method to get the current list of the bot’s commands for the given scope and user language. Returns an Array of BotCommand objects. If commands aren’t set, an empty list is returned.
sourcepub async fn unpin_all_forum_topic_messages<'a>(
&self,
chat_id: i64,
message_thread_id: i64
) -> BotResult<bool>
pub async fn unpin_all_forum_topic_messages<'a>( &self, chat_id: i64, message_thread_id: i64 ) -> BotResult<bool>
Use this method to clear the list of pinned messages in a forum topic. The bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator right in the supergroup. Returns True on success.
sourcepub async fn get_forum_topic_icon_stickers<'a>(&self) -> BotResult<Vec<Sticker>>
pub async fn get_forum_topic_icon_stickers<'a>(&self) -> BotResult<Vec<Sticker>>
Use this method to get custom emoji stickers, which can be used as a forum topic icon by any user. Requires no parameters. Returns an Array of Sticker objects.
sourcepub async fn unpin_chat_message<'a>(
&self,
chat_id: i64,
message_id: Option<i64>
) -> BotResult<bool>
pub async fn unpin_chat_message<'a>( &self, chat_id: i64, message_id: Option<i64> ) -> BotResult<bool>
Use this method to remove a message from the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the ‘can_pin_messages’ administrator right in a supergroup or ‘can_edit_messages’ administrator right in a channel. Returns True on success.
sourcepub async fn send_voice<'a>(
&self,
chat_id: i64,
message_thread_id: Option<i64>,
voice: FileData,
caption: Option<&'a str>,
parse_mode: Option<&'a str>,
caption_entities: Option<&'a Vec<MessageEntity>>,
duration: Option<i64>,
disable_notification: Option<bool>,
protect_content: Option<bool>,
reply_to_message_id: Option<i64>,
allow_sending_without_reply: Option<bool>,
reply_markup: Option<&'a EReplyMarkup>
) -> BotResult<Message>
pub async fn send_voice<'a>( &self, chat_id: i64, message_thread_id: Option<i64>, voice: FileData, caption: Option<&'a str>, parse_mode: Option<&'a str>, caption_entities: Option<&'a Vec<MessageEntity>>, duration: Option<i64>, disable_notification: Option<bool>, protect_content: Option<bool>, reply_to_message_id: Option<i64>, allow_sending_without_reply: Option<bool>, reply_markup: Option<&'a EReplyMarkup> ) -> BotResult<Message>
Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS (other formats may be sent as Audio or Document). On success, the sent Message is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future.
sourcepub async fn set_my_name<'a>(
&self,
name: Option<&'a str>,
language_code: Option<&'a str>
) -> BotResult<bool>
pub async fn set_my_name<'a>( &self, name: Option<&'a str>, language_code: Option<&'a str> ) -> BotResult<bool>
Use this method to change the bot’s name. Returns True on success.
sourcepub async fn ban_chat_sender_chat<'a>(
&self,
chat_id: i64,
sender_chat_id: i64
) -> BotResult<bool>
pub async fn ban_chat_sender_chat<'a>( &self, chat_id: i64, sender_chat_id: i64 ) -> BotResult<bool>
Use this method to ban a channel chat in a supergroup or a channel. Until the chat is unbanned, the owner of the banned chat won’t be able to send messages on behalf of any of their channels. The bot must be an administrator in the supergroup or channel for this to work and must have the appropriate administrator rights. Returns True on success.
sourcepub async fn send_document<'a>(
&self,
chat_id: i64,
message_thread_id: Option<i64>,
document: FileData,
thumbnail: Option<FileData>,
caption: Option<&'a str>,
parse_mode: Option<&'a str>,
caption_entities: Option<&'a Vec<MessageEntity>>,
disable_content_type_detection: Option<bool>,
disable_notification: Option<bool>,
protect_content: Option<bool>,
reply_to_message_id: Option<i64>,
allow_sending_without_reply: Option<bool>,
reply_markup: Option<&'a EReplyMarkup>
) -> BotResult<Message>
pub async fn send_document<'a>( &self, chat_id: i64, message_thread_id: Option<i64>, document: FileData, thumbnail: Option<FileData>, caption: Option<&'a str>, parse_mode: Option<&'a str>, caption_entities: Option<&'a Vec<MessageEntity>>, disable_content_type_detection: Option<bool>, disable_notification: Option<bool>, protect_content: Option<bool>, reply_to_message_id: Option<i64>, allow_sending_without_reply: Option<bool>, reply_markup: Option<&'a EReplyMarkup> ) -> BotResult<Message>
Use this method to send general files. On success, the sent Message is returned. Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future.
sourcepub async fn ban_chat_member<'a>(
&self,
chat_id: i64,
user_id: i64,
until_date: Option<i64>,
revoke_messages: Option<bool>
) -> BotResult<bool>
pub async fn ban_chat_member<'a>( &self, chat_id: i64, user_id: i64, until_date: Option<i64>, revoke_messages: Option<bool> ) -> BotResult<bool>
Use this method to ban a user in a group, a supergroup or a channel. In the case of supergroups and channels, the user will not be able to return to the chat on their own using invite links, etc., unless unbanned first. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success.
sourcepub async fn set_game_score<'a>(
&self,
user_id: i64,
score: i64,
force: Option<bool>,
disable_edit_message: Option<bool>,
chat_id: Option<i64>,
message_id: Option<i64>,
inline_message_id: Option<&'a str>
) -> BotResult<MessageBool>
pub async fn set_game_score<'a>( &self, user_id: i64, score: i64, force: Option<bool>, disable_edit_message: Option<bool>, chat_id: Option<i64>, message_id: Option<i64>, inline_message_id: Option<&'a str> ) -> BotResult<MessageBool>
Use this method to set the score of the specified user in a game message. On success, if the message is not an inline message, the Message is returned, otherwise True is returned. Returns an error, if the new score is not greater than the user’s current score in the chat and force is False.
sourcepub async fn answer_shipping_query<'a>(
&self,
shipping_query_id: &'a str,
ok: bool,
shipping_options: Option<&'a Vec<ShippingOption>>,
error_message: Option<&'a str>
) -> BotResult<bool>
pub async fn answer_shipping_query<'a>( &self, shipping_query_id: &'a str, ok: bool, shipping_options: Option<&'a Vec<ShippingOption>>, error_message: Option<&'a str> ) -> BotResult<bool>
If you sent an invoice requesting a shipping address and the parameter is_flexible was specified, the Bot API will send an Update with a shipping_query field to the bot. Use this method to reply to shipping queries. On success, True is returned.
sourcepub async fn close<'a>(&self) -> BotResult<bool>
pub async fn close<'a>(&self) -> BotResult<bool>
Use this method to close the bot instance before moving it from one local server to another. You need to delete the webhook before calling this method to ensure that the bot isn’t launched again after server restart. The method will return error 429 in the first 10 minutes after the bot is launched. Returns True on success. Requires no parameters.
sourcepub async fn get_my_default_administrator_rights<'a>(
&self,
for_channels: Option<bool>
) -> BotResult<ChatAdministratorRights>
pub async fn get_my_default_administrator_rights<'a>( &self, for_channels: Option<bool> ) -> BotResult<ChatAdministratorRights>
Use this method to get the current default administrator rights of the bot. Returns ChatAdministratorRights on success.
sourcepub async fn set_my_default_administrator_rights<'a>(
&self,
rights: Option<&'a ChatAdministratorRights>,
for_channels: Option<bool>
) -> BotResult<bool>
pub async fn set_my_default_administrator_rights<'a>( &self, rights: Option<&'a ChatAdministratorRights>, for_channels: Option<bool> ) -> BotResult<bool>
Use this method to change the default administrator rights requested by the bot when it’s added as an administrator to groups or channels. These rights will be suggested to users, but they are free to modify the list before adding the bot. Returns True on success.
sourcepub async fn restrict_chat_member<'a>(
&self,
chat_id: i64,
user_id: i64,
permissions: &'a ChatPermissions,
use_independent_chat_permissions: Option<bool>,
until_date: Option<i64>
) -> BotResult<bool>
pub async fn restrict_chat_member<'a>( &self, chat_id: i64, user_id: i64, permissions: &'a ChatPermissions, use_independent_chat_permissions: Option<bool>, until_date: Option<i64> ) -> BotResult<bool>
Use this method to restrict a user in a supergroup. The bot must be an administrator in the supergroup for this to work and must have the appropriate administrator rights. Pass True for all permissions to lift restrictions from a user. Returns True on success.
sourcepub async fn set_passport_data_errors<'a>(
&self,
user_id: i64,
errors: &'a Vec<PassportElementError>
) -> BotResult<bool>
pub async fn set_passport_data_errors<'a>( &self, user_id: i64, errors: &'a Vec<PassportElementError> ) -> BotResult<bool>
Informs a user that some of the Telegram Passport elements they provided contains errors. The user will not be able to re-submit their Passport to you until the errors are fixed (the contents of the field for which you returned the error must change). Returns True on success.Use this if the data submitted by the user doesn’t satisfy the standards your service requires for any reason. For example, if a birthday date seems invalid, a submitted document is blurry, a scan shows evidence of tampering, etc. Supply some details in the error message to make sure the user knows how to correct the issues.
sourcepub async fn get_user_profile_photos<'a>(
&self,
user_id: i64,
offset: Option<i64>,
limit: Option<i64>
) -> BotResult<UserProfilePhotos>
pub async fn get_user_profile_photos<'a>( &self, user_id: i64, offset: Option<i64>, limit: Option<i64> ) -> BotResult<UserProfilePhotos>
Use this method to get a list of profile pictures for a user. Returns a UserProfilePhotos object.
sourcepub async fn get_file<'a>(&self, file_id: &'a str) -> BotResult<File>
pub async fn get_file<'a>(&self, file_id: &'a str) -> BotResult<File>
Use this method to get basic information about a file and prepare it for downloading. For the moment, bots can download files of up to 20MB in size. On success, a File object is returned. The file can then be downloaded via the link https://api.telegram.org/file/bot
sourcepub async fn get_chat_member<'a>(
&self,
chat_id: i64,
user_id: i64
) -> BotResult<ChatMember>
pub async fn get_chat_member<'a>( &self, chat_id: i64, user_id: i64 ) -> BotResult<ChatMember>
Use this method to get information about a member of a chat. The method is only guaranteed to work for other users if the bot is an administrator in the chat. Returns a ChatMember object on success.
sourcepub async fn stop_message_live_location<'a>(
&self,
chat_id: Option<i64>,
message_id: Option<i64>,
inline_message_id: Option<&'a str>,
reply_markup: Option<&'a InlineKeyboardMarkup>
) -> BotResult<MessageBool>
pub async fn stop_message_live_location<'a>( &self, chat_id: Option<i64>, message_id: Option<i64>, inline_message_id: Option<&'a str>, reply_markup: Option<&'a InlineKeyboardMarkup> ) -> BotResult<MessageBool>
Use this method to stop updating a live location message before live_period expires. On success, if the message is not an inline message, the edited Message is returned, otherwise True is returned.
sourcepub async fn set_my_description<'a>(
&self,
description: Option<&'a str>,
language_code: Option<&'a str>
) -> BotResult<bool>
pub async fn set_my_description<'a>( &self, description: Option<&'a str>, language_code: Option<&'a str> ) -> BotResult<bool>
Use this method to change the bot’s description, which is shown in the chat with the bot if the chat is empty. Returns True on success.
sourcepub async fn delete_chat_photo<'a>(&self, chat_id: i64) -> BotResult<bool>
pub async fn delete_chat_photo<'a>(&self, chat_id: i64) -> BotResult<bool>
Use this method to delete a chat photo. Photos can’t be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success.
sourcepub async fn set_my_short_description<'a>(
&self,
short_description: Option<&'a str>,
language_code: Option<&'a str>
) -> BotResult<bool>
pub async fn set_my_short_description<'a>( &self, short_description: Option<&'a str>, language_code: Option<&'a str> ) -> BotResult<bool>
Use this method to change the bot’s short description, which is shown on the bot’s profile page and is sent together with the link when users share the bot. Returns True on success.
sourcepub async fn send_photo<'a>(
&self,
chat_id: i64,
message_thread_id: Option<i64>,
photo: FileData,
caption: Option<&'a str>,
parse_mode: Option<&'a str>,
caption_entities: Option<&'a Vec<MessageEntity>>,
has_spoiler: Option<bool>,
disable_notification: Option<bool>,
protect_content: Option<bool>,
reply_to_message_id: Option<i64>,
allow_sending_without_reply: Option<bool>,
reply_markup: Option<&'a EReplyMarkup>
) -> BotResult<Message>
pub async fn send_photo<'a>( &self, chat_id: i64, message_thread_id: Option<i64>, photo: FileData, caption: Option<&'a str>, parse_mode: Option<&'a str>, caption_entities: Option<&'a Vec<MessageEntity>>, has_spoiler: Option<bool>, disable_notification: Option<bool>, protect_content: Option<bool>, reply_to_message_id: Option<i64>, allow_sending_without_reply: Option<bool>, reply_markup: Option<&'a EReplyMarkup> ) -> BotResult<Message>
Use this method to send photos. On success, the sent Message is returned.
Use this method to change the bot’s menu button in a private chat, or the default menu button. Returns True on success.
sourcepub async fn set_chat_administrator_custom_title<'a>(
&self,
chat_id: i64,
user_id: i64,
custom_title: &'a str
) -> BotResult<bool>
pub async fn set_chat_administrator_custom_title<'a>( &self, chat_id: i64, user_id: i64, custom_title: &'a str ) -> BotResult<bool>
Use this method to set a custom title for an administrator in a supergroup promoted by the bot. Returns True on success.
sourcepub async fn set_chat_sticker_set<'a>(
&self,
chat_id: i64,
sticker_set_name: &'a str
) -> BotResult<bool>
pub async fn set_chat_sticker_set<'a>( &self, chat_id: i64, sticker_set_name: &'a str ) -> BotResult<bool>
Use this method to set a new group sticker set for a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Use the field can_set_sticker_set optionally returned in getChat requests to check if the bot can use this method. Returns True on success.
sourcepub async fn send_poll<'a>(
&self,
chat_id: i64,
message_thread_id: Option<i64>,
question: &'a str,
options: &'a Vec<String>,
is_anonymous: Option<bool>,
tg_type: Option<&'a str>,
allows_multiple_answers: Option<bool>,
correct_option_id: Option<i64>,
explanation: Option<&'a str>,
explanation_parse_mode: Option<&'a str>,
explanation_entities: Option<&'a Vec<MessageEntity>>,
open_period: Option<i64>,
close_date: Option<i64>,
is_closed: Option<bool>,
disable_notification: Option<bool>,
protect_content: Option<bool>,
reply_to_message_id: Option<i64>,
allow_sending_without_reply: Option<bool>,
reply_markup: Option<&'a EReplyMarkup>
) -> BotResult<Message>
pub async fn send_poll<'a>( &self, chat_id: i64, message_thread_id: Option<i64>, question: &'a str, options: &'a Vec<String>, is_anonymous: Option<bool>, tg_type: Option<&'a str>, allows_multiple_answers: Option<bool>, correct_option_id: Option<i64>, explanation: Option<&'a str>, explanation_parse_mode: Option<&'a str>, explanation_entities: Option<&'a Vec<MessageEntity>>, open_period: Option<i64>, close_date: Option<i64>, is_closed: Option<bool>, disable_notification: Option<bool>, protect_content: Option<bool>, reply_to_message_id: Option<i64>, allow_sending_without_reply: Option<bool>, reply_markup: Option<&'a EReplyMarkup> ) -> BotResult<Message>
Use this method to send a native poll. On success, the sent Message is returned.
sourcepub async fn send_video<'a>(
&self,
chat_id: i64,
message_thread_id: Option<i64>,
video: FileData,
duration: Option<i64>,
width: Option<i64>,
height: Option<i64>,
thumbnail: Option<FileData>,
caption: Option<&'a str>,
parse_mode: Option<&'a str>,
caption_entities: Option<&'a Vec<MessageEntity>>,
has_spoiler: Option<bool>,
supports_streaming: Option<bool>,
disable_notification: Option<bool>,
protect_content: Option<bool>,
reply_to_message_id: Option<i64>,
allow_sending_without_reply: Option<bool>,
reply_markup: Option<&'a EReplyMarkup>
) -> BotResult<Message>
pub async fn send_video<'a>( &self, chat_id: i64, message_thread_id: Option<i64>, video: FileData, duration: Option<i64>, width: Option<i64>, height: Option<i64>, thumbnail: Option<FileData>, caption: Option<&'a str>, parse_mode: Option<&'a str>, caption_entities: Option<&'a Vec<MessageEntity>>, has_spoiler: Option<bool>, supports_streaming: Option<bool>, disable_notification: Option<bool>, protect_content: Option<bool>, reply_to_message_id: Option<i64>, allow_sending_without_reply: Option<bool>, reply_markup: Option<&'a EReplyMarkup> ) -> BotResult<Message>
Use this method to send video files, Telegram clients support MPEG4 videos (other formats may be sent as Document). On success, the sent Message is returned. Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future.
sourcepub async fn send_dice<'a>(
&self,
chat_id: i64,
message_thread_id: Option<i64>,
emoji: Option<&'a str>,
disable_notification: Option<bool>,
protect_content: Option<bool>,
reply_to_message_id: Option<i64>,
allow_sending_without_reply: Option<bool>,
reply_markup: Option<&'a EReplyMarkup>
) -> BotResult<Message>
pub async fn send_dice<'a>( &self, chat_id: i64, message_thread_id: Option<i64>, emoji: Option<&'a str>, disable_notification: Option<bool>, protect_content: Option<bool>, reply_to_message_id: Option<i64>, allow_sending_without_reply: Option<bool>, reply_markup: Option<&'a EReplyMarkup> ) -> BotResult<Message>
Use this method to send an animated emoji that will display a random value. On success, the sent Message is returned.
sourcepub async fn approve_chat_join_request<'a>(
&self,
chat_id: i64,
user_id: i64
) -> BotResult<bool>
pub async fn approve_chat_join_request<'a>( &self, chat_id: i64, user_id: i64 ) -> BotResult<bool>
Use this method to approve a chat join request. The bot must be an administrator in the chat for this to work and must have the can_invite_users administrator right. Returns True on success.
sourcepub async fn reopen_forum_topic<'a>(
&self,
chat_id: i64,
message_thread_id: i64
) -> BotResult<bool>
pub async fn reopen_forum_topic<'a>( &self, chat_id: i64, message_thread_id: i64 ) -> BotResult<bool>
Use this method to reopen a closed topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success.
sourcepub async fn add_sticker_to_set<'a>(
&self,
user_id: i64,
name: &'a str,
sticker: &'a InputSticker
) -> BotResult<bool>
pub async fn add_sticker_to_set<'a>( &self, user_id: i64, name: &'a str, sticker: &'a InputSticker ) -> BotResult<bool>
Use this method to add a new sticker to a set created by the bot. The format of the added sticker must match the format of the other stickers in the set. Emoji sticker sets can have up to 200 stickers. Animated and video sticker sets can have up to 50 stickers. Static sticker sets can have up to 120 stickers. Returns True on success.
sourcepub fn build_answer_web_app_query<'a>(
&'a self,
web_app_query_id: &'a str,
result: &'a InlineQueryResult
) -> CallAnswerWebAppQuery<'a>
pub fn build_answer_web_app_query<'a>( &'a self, web_app_query_id: &'a str, result: &'a InlineQueryResult ) -> CallAnswerWebAppQuery<'a>
Use this method to set the result of an interaction with a Web App and send a corresponding message on behalf of the user to the chat from which the query originated. On success, a SentWebAppMessage object is returned.
sourcepub fn build_get_me<'a>(&'a self) -> CallGetMe<'a>
pub fn build_get_me<'a>(&'a self) -> CallGetMe<'a>
A simple method for testing your bot’s authentication token. Requires no parameters. Returns basic information about the bot in form of a User object.
sourcepub fn build_delete_webhook<'a>(&'a self) -> CallDeleteWebhook<'a>
pub fn build_delete_webhook<'a>(&'a self) -> CallDeleteWebhook<'a>
Use this method to remove webhook integration if you decide to switch back to getUpdates. Returns True on success.
sourcepub fn build_close_general_forum_topic<'a>(
&'a self,
chat_id: i64
) -> CallCloseGeneralForumTopic<'a>
pub fn build_close_general_forum_topic<'a>( &'a self, chat_id: i64 ) -> CallCloseGeneralForumTopic<'a>
Use this method to close an open ‘General’ topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. Returns True on success.
sourcepub fn build_reopen_general_forum_topic<'a>(
&'a self,
chat_id: i64
) -> CallReopenGeneralForumTopic<'a>
pub fn build_reopen_general_forum_topic<'a>( &'a self, chat_id: i64 ) -> CallReopenGeneralForumTopic<'a>
Use this method to reopen a closed ‘General’ topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. The topic will be automatically unhidden if it was hidden. Returns True on success.
sourcepub fn build_get_my_description<'a>(&'a self) -> CallGetMyDescription<'a>
pub fn build_get_my_description<'a>(&'a self) -> CallGetMyDescription<'a>
Use this method to get the current bot description for the given user language. Returns BotDescription on success.
sourcepub fn build_delete_sticker_from_set<'a>(
&'a self,
sticker: &'a str
) -> CallDeleteStickerFromSet<'a>
pub fn build_delete_sticker_from_set<'a>( &'a self, sticker: &'a str ) -> CallDeleteStickerFromSet<'a>
Use this method to delete a sticker from a set created by the bot. Returns True on success.
sourcepub fn build_set_sticker_set_thumbnail<'a>(
&'a self,
name: &'a str,
user_id: i64
) -> CallSetStickerSetThumbnail<'a>
pub fn build_set_sticker_set_thumbnail<'a>( &'a self, name: &'a str, user_id: i64 ) -> CallSetStickerSetThumbnail<'a>
Use this method to set the thumbnail of a regular or mask sticker set. The format of the thumbnail file must match the format of the stickers in the set. Returns True on success.
sourcepub fn build_copy_message<'a>(
&'a self,
chat_id: i64,
from_chat_id: i64,
message_id: i64
) -> CallCopyMessage<'a>
pub fn build_copy_message<'a>( &'a self, chat_id: i64, from_chat_id: i64, message_id: i64 ) -> CallCopyMessage<'a>
Use this method to copy messages of any kind. Service messages and invoice messages can’t be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessage, but the copied message doesn’t have a link to the original message. Returns the MessageId of the sent message on success.
sourcepub fn build_get_sticker_set<'a>(
&'a self,
name: &'a str
) -> CallGetStickerSet<'a>
pub fn build_get_sticker_set<'a>( &'a self, name: &'a str ) -> CallGetStickerSet<'a>
Use this method to get a sticker set. On success, a StickerSet object is returned.
sourcepub fn build_edit_chat_invite_link<'a>(
&'a self,
chat_id: i64,
invite_link: &'a str
) -> CallEditChatInviteLink<'a>
pub fn build_edit_chat_invite_link<'a>( &'a self, chat_id: i64, invite_link: &'a str ) -> CallEditChatInviteLink<'a>
Use this method to edit a non-primary invite link created by the bot. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the edited invite link as a ChatInviteLink object.
sourcepub fn build_set_webhook<'a>(&'a self, url: &'a str) -> CallSetWebhook<'a>
pub fn build_set_webhook<'a>(&'a self, url: &'a str) -> CallSetWebhook<'a>
Use this method to specify a URL and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified URL, containing a JSON-serialized Update. In case of an unsuccessful request, we will give up after a reasonable amount of attempts. Returns True on success.If you’d like to make sure that the webhook was set by you, you can specify secret data in the parameter secret_token. If specified, the request will contain a header “X-Telegram-Bot-Api-Secret-Token” with the secret token as content.
sourcepub fn build_edit_message_text<'a>(
&'a self,
text: &'a str
) -> CallEditMessageText<'a>
pub fn build_edit_message_text<'a>( &'a self, text: &'a str ) -> CallEditMessageText<'a>
Use this method to edit text and game messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.
sourcepub fn build_set_sticker_position_in_set<'a>(
&'a self,
sticker: &'a str,
position: i64
) -> CallSetStickerPositionInSet<'a>
pub fn build_set_sticker_position_in_set<'a>( &'a self, sticker: &'a str, position: i64 ) -> CallSetStickerPositionInSet<'a>
Use this method to move a sticker in a set created by the bot to a specific position. Returns True on success.
sourcepub fn build_get_custom_emoji_stickers<'a>(
&'a self,
custom_emoji_ids: &'a Vec<String>
) -> CallGetCustomEmojiStickers<'a>
pub fn build_get_custom_emoji_stickers<'a>( &'a self, custom_emoji_ids: &'a Vec<String> ) -> CallGetCustomEmojiStickers<'a>
Use this method to get information about custom emoji stickers by their identifiers. Returns an Array of Sticker objects.
sourcepub fn build_get_chat_member_count<'a>(
&'a self,
chat_id: i64
) -> CallGetChatMemberCount<'a>
pub fn build_get_chat_member_count<'a>( &'a self, chat_id: i64 ) -> CallGetChatMemberCount<'a>
Use this method to get the number of members in a chat. Returns Int on success.
sourcepub fn build_create_forum_topic<'a>(
&'a self,
chat_id: i64,
name: &'a str
) -> CallCreateForumTopic<'a>
pub fn build_create_forum_topic<'a>( &'a self, chat_id: i64, name: &'a str ) -> CallCreateForumTopic<'a>
Use this method to create a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. Returns information about the created topic as a ForumTopic object.
sourcepub fn build_send_invoice<'a>(
&'a self,
chat_id: i64,
title: &'a str,
description: &'a str,
payload: &'a str,
provider_token: &'a str,
currency: &'a str,
prices: &'a Vec<LabeledPrice>
) -> CallSendInvoice<'a>
pub fn build_send_invoice<'a>( &'a self, chat_id: i64, title: &'a str, description: &'a str, payload: &'a str, provider_token: &'a str, currency: &'a str, prices: &'a Vec<LabeledPrice> ) -> CallSendInvoice<'a>
Use this method to send invoices. On success, the sent Message is returned.
sourcepub fn build_get_chat<'a>(&'a self, chat_id: i64) -> CallGetChat<'a>
pub fn build_get_chat<'a>(&'a self, chat_id: i64) -> CallGetChat<'a>
Use this method to get up to date information about the chat (current name of the user for one-on-one conversations, current username of a user, group or channel, etc.). Returns a Chat object on success.
sourcepub fn build_send_audio<'a>(
&'a self,
chat_id: i64,
audio: FileData
) -> CallSendAudio<'a>
pub fn build_send_audio<'a>( &'a self, chat_id: i64, audio: FileData ) -> CallSendAudio<'a>
Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .MP3 or .M4A format. On success, the sent Message is returned. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future.For sending voice messages, use the sendVoice method instead.
sourcepub fn build_send_video_note<'a>(
&'a self,
chat_id: i64,
video_note: FileData
) -> CallSendVideoNote<'a>
pub fn build_send_video_note<'a>( &'a self, chat_id: i64, video_note: FileData ) -> CallSendVideoNote<'a>
As of v.4.0, Telegram clients support rounded square MPEG4 videos of up to 1 minute long. Use this method to send video messages. On success, the sent Message is returned.
sourcepub fn build_unhide_general_forum_topic<'a>(
&'a self,
chat_id: i64
) -> CallUnhideGeneralForumTopic<'a>
pub fn build_unhide_general_forum_topic<'a>( &'a self, chat_id: i64 ) -> CallUnhideGeneralForumTopic<'a>
Use this method to unhide the ‘General’ topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. Returns True on success.
sourcepub fn build_delete_message<'a>(
&'a self,
chat_id: i64,
message_id: i64
) -> CallDeleteMessage<'a>
pub fn build_delete_message<'a>( &'a self, chat_id: i64, message_id: i64 ) -> CallDeleteMessage<'a>
Use this method to delete a message, including service messages, with the following limitations:- A message can only be deleted if it was sent less than 48 hours ago.- Service messages about a supergroup, channel, or forum topic creation can’t be deleted.- A dice message in a private chat can only be deleted if it was sent more than 24 hours ago.- Bots can delete outgoing messages in private chats, groups, and supergroups.- Bots can delete incoming messages in private chats.- Bots granted can_post_messages permissions can delete outgoing messages in channels.- If the bot is an administrator of a group, it can delete any message there.- If the bot has can_delete_messages permission in a supergroup or a channel, it can delete any message there.Returns True on success.
sourcepub fn build_export_chat_invite_link<'a>(
&'a self,
chat_id: i64
) -> CallExportChatInviteLink<'a>
pub fn build_export_chat_invite_link<'a>( &'a self, chat_id: i64 ) -> CallExportChatInviteLink<'a>
Use this method to generate a new primary invite link for a chat; any previously generated primary link is revoked. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the new invite link as String on success.
sourcepub fn build_send_location<'a>(
&'a self,
chat_id: i64,
latitude: f64,
longitude: f64
) -> CallSendLocation<'a>
pub fn build_send_location<'a>( &'a self, chat_id: i64, latitude: f64, longitude: f64 ) -> CallSendLocation<'a>
Use this method to send point on the map. On success, the sent Message is returned.
sourcepub fn build_send_venue<'a>(
&'a self,
chat_id: i64,
latitude: f64,
longitude: f64,
title: &'a str,
address: &'a str
) -> CallSendVenue<'a>
pub fn build_send_venue<'a>( &'a self, chat_id: i64, latitude: f64, longitude: f64, title: &'a str, address: &'a str ) -> CallSendVenue<'a>
Use this method to send information about a venue. On success, the sent Message is returned.
sourcepub fn build_set_chat_photo<'a>(
&'a self,
chat_id: i64,
photo: FileData
) -> CallSetChatPhoto<'a>
pub fn build_set_chat_photo<'a>( &'a self, chat_id: i64, photo: FileData ) -> CallSetChatPhoto<'a>
Use this method to set a new profile photo for the chat. Photos can’t be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success.
sourcepub fn build_edit_forum_topic<'a>(
&'a self,
chat_id: i64,
message_thread_id: i64
) -> CallEditForumTopic<'a>
pub fn build_edit_forum_topic<'a>( &'a self, chat_id: i64, message_thread_id: i64 ) -> CallEditForumTopic<'a>
Use this method to edit name and icon of a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success.
sourcepub fn build_edit_message_reply_markup<'a>(
&'a self
) -> CallEditMessageReplyMarkup<'a>
pub fn build_edit_message_reply_markup<'a>( &'a self ) -> CallEditMessageReplyMarkup<'a>
Use this method to edit only the reply markup of messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.
sourcepub fn build_set_sticker_set_title<'a>(
&'a self,
name: &'a str,
title: &'a str
) -> CallSetStickerSetTitle<'a>
pub fn build_set_sticker_set_title<'a>( &'a self, name: &'a str, title: &'a str ) -> CallSetStickerSetTitle<'a>
Use this method to set the title of a created sticker set. Returns True on success.
sourcepub fn build_promote_chat_member<'a>(
&'a self,
chat_id: i64,
user_id: i64
) -> CallPromoteChatMember<'a>
pub fn build_promote_chat_member<'a>( &'a self, chat_id: i64, user_id: i64 ) -> CallPromoteChatMember<'a>
Use this method to promote or demote a user in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Pass False for all boolean parameters to demote a user. Returns True on success.
sourcepub fn build_edit_general_forum_topic<'a>(
&'a self,
chat_id: i64,
name: &'a str
) -> CallEditGeneralForumTopic<'a>
pub fn build_edit_general_forum_topic<'a>( &'a self, chat_id: i64, name: &'a str ) -> CallEditGeneralForumTopic<'a>
Use this method to edit the name of the ‘General’ topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have can_manage_topics administrator rights. Returns True on success.
sourcepub fn build_delete_chat_sticker_set<'a>(
&'a self,
chat_id: i64
) -> CallDeleteChatStickerSet<'a>
pub fn build_delete_chat_sticker_set<'a>( &'a self, chat_id: i64 ) -> CallDeleteChatStickerSet<'a>
Use this method to delete a group sticker set from a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Use the field can_set_sticker_set optionally returned in getChat requests to check if the bot can use this method. Returns True on success.
sourcepub fn build_pin_chat_message<'a>(
&'a self,
chat_id: i64,
message_id: i64
) -> CallPinChatMessage<'a>
pub fn build_pin_chat_message<'a>( &'a self, chat_id: i64, message_id: i64 ) -> CallPinChatMessage<'a>
Use this method to add a message to the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the ‘can_pin_messages’ administrator right in a supergroup or ‘can_edit_messages’ administrator right in a channel. Returns True on success.
sourcepub fn build_delete_sticker_set<'a>(
&'a self,
name: &'a str
) -> CallDeleteStickerSet<'a>
pub fn build_delete_sticker_set<'a>( &'a self, name: &'a str ) -> CallDeleteStickerSet<'a>
Use this method to delete a sticker set that was created by the bot. Returns True on success.
sourcepub fn build_set_chat_title<'a>(
&'a self,
chat_id: i64,
title: &'a str
) -> CallSetChatTitle<'a>
pub fn build_set_chat_title<'a>( &'a self, chat_id: i64, title: &'a str ) -> CallSetChatTitle<'a>
Use this method to change the title of a chat. Titles can’t be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success.
sourcepub fn build_set_custom_emoji_sticker_set_thumbnail<'a>(
&'a self,
name: &'a str
) -> CallSetCustomEmojiStickerSetThumbnail<'a>
pub fn build_set_custom_emoji_sticker_set_thumbnail<'a>( &'a self, name: &'a str ) -> CallSetCustomEmojiStickerSetThumbnail<'a>
Use this method to set the thumbnail of a custom emoji sticker set. Returns True on success.
sourcepub fn build_send_media_group<'a>(
&'a self,
chat_id: i64,
media: &'a Vec<EMedia>
) -> CallSendMediaGroup<'a>
pub fn build_send_media_group<'a>( &'a self, chat_id: i64, media: &'a Vec<EMedia> ) -> CallSendMediaGroup<'a>
Use this method to send a group of photos, videos, documents or audios as an album. Documents and audio files can be only grouped in an album with messages of the same type. On success, an array of Messages that were sent is returned.
sourcepub fn build_get_my_short_description<'a>(
&'a self
) -> CallGetMyShortDescription<'a>
pub fn build_get_my_short_description<'a>( &'a self ) -> CallGetMyShortDescription<'a>
Use this method to get the current bot short description for the given user language. Returns BotShortDescription on success.
sourcepub fn build_upload_sticker_file<'a>(
&'a self,
user_id: i64,
sticker: FileData,
sticker_format: &'a str
) -> CallUploadStickerFile<'a>
pub fn build_upload_sticker_file<'a>( &'a self, user_id: i64, sticker: FileData, sticker_format: &'a str ) -> CallUploadStickerFile<'a>
Use this method to upload a file with a sticker for later use in the createNewStickerSet and addStickerToSet methods (the file can be used multiple times). Returns the uploaded File on success.
sourcepub fn build_edit_message_live_location<'a>(
&'a self,
latitude: f64,
longitude: f64
) -> CallEditMessageLiveLocation<'a>
pub fn build_edit_message_live_location<'a>( &'a self, latitude: f64, longitude: f64 ) -> CallEditMessageLiveLocation<'a>
Use this method to edit live location messages. A location can be edited until its live_period expires or editing is explicitly disabled by a call to stopMessageLiveLocation. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.
sourcepub fn build_set_sticker_mask_position<'a>(
&'a self,
sticker: &'a str
) -> CallSetStickerMaskPosition<'a>
pub fn build_set_sticker_mask_position<'a>( &'a self, sticker: &'a str ) -> CallSetStickerMaskPosition<'a>
Use this method to change the mask position of a mask sticker. The sticker must belong to a sticker set that was created by the bot. Returns True on success.
sourcepub fn build_decline_chat_join_request<'a>(
&'a self,
chat_id: i64,
user_id: i64
) -> CallDeclineChatJoinRequest<'a>
pub fn build_decline_chat_join_request<'a>( &'a self, chat_id: i64, user_id: i64 ) -> CallDeclineChatJoinRequest<'a>
Use this method to decline a chat join request. The bot must be an administrator in the chat for this to work and must have the can_invite_users administrator right. Returns True on success.
sourcepub fn build_get_my_name<'a>(&'a self) -> CallGetMyName<'a>
pub fn build_get_my_name<'a>(&'a self) -> CallGetMyName<'a>
Use this method to get the current bot name for the given user language. Returns BotName on success.
sourcepub fn build_close_forum_topic<'a>(
&'a self,
chat_id: i64,
message_thread_id: i64
) -> CallCloseForumTopic<'a>
pub fn build_close_forum_topic<'a>( &'a self, chat_id: i64, message_thread_id: i64 ) -> CallCloseForumTopic<'a>
Use this method to close an open topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success.
sourcepub fn build_leave_chat<'a>(&'a self, chat_id: i64) -> CallLeaveChat<'a>
pub fn build_leave_chat<'a>(&'a self, chat_id: i64) -> CallLeaveChat<'a>
Use this method for your bot to leave a group, supergroup or channel. Returns True on success.
sourcepub fn build_log_out<'a>(&'a self) -> CallLogOut<'a>
pub fn build_log_out<'a>(&'a self) -> CallLogOut<'a>
Use this method to log out from the cloud Bot API server before launching the bot locally. You must log out the bot before running it locally, otherwise there is no guarantee that the bot will receive updates. After a successful call, you can immediately log in on a local server, but will not be able to log in back to the cloud Bot API server for 10 minutes. Returns True on success. Requires no parameters.
sourcepub fn build_send_contact<'a>(
&'a self,
chat_id: i64,
phone_number: &'a str,
first_name: &'a str
) -> CallSendContact<'a>
pub fn build_send_contact<'a>( &'a self, chat_id: i64, phone_number: &'a str, first_name: &'a str ) -> CallSendContact<'a>
Use this method to send phone contacts. On success, the sent Message is returned.
sourcepub fn build_delete_forum_topic<'a>(
&'a self,
chat_id: i64,
message_thread_id: i64
) -> CallDeleteForumTopic<'a>
pub fn build_delete_forum_topic<'a>( &'a self, chat_id: i64, message_thread_id: i64 ) -> CallDeleteForumTopic<'a>
Use this method to delete a forum topic along with all its messages in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_delete_messages administrator rights. Returns True on success.
sourcepub fn build_revoke_chat_invite_link<'a>(
&'a self,
chat_id: i64,
invite_link: &'a str
) -> CallRevokeChatInviteLink<'a>
pub fn build_revoke_chat_invite_link<'a>( &'a self, chat_id: i64, invite_link: &'a str ) -> CallRevokeChatInviteLink<'a>
Use this method to revoke an invite link created by the bot. If the primary link is revoked, a new link is automatically generated. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the revoked invite link as ChatInviteLink object.
sourcepub fn build_set_chat_description<'a>(
&'a self,
chat_id: i64
) -> CallSetChatDescription<'a>
pub fn build_set_chat_description<'a>( &'a self, chat_id: i64 ) -> CallSetChatDescription<'a>
Use this method to change the description of a group, a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success.
sourcepub fn build_create_invoice_link<'a>(
&'a self,
title: &'a str,
description: &'a str,
payload: &'a str,
provider_token: &'a str,
currency: &'a str,
prices: &'a Vec<LabeledPrice>
) -> CallCreateInvoiceLink<'a>
pub fn build_create_invoice_link<'a>( &'a self, title: &'a str, description: &'a str, payload: &'a str, provider_token: &'a str, currency: &'a str, prices: &'a Vec<LabeledPrice> ) -> CallCreateInvoiceLink<'a>
Use this method to create a link for an invoice. Returns the created invoice link as String on success.
sourcepub fn build_create_chat_invite_link<'a>(
&'a self,
chat_id: i64
) -> CallCreateChatInviteLink<'a>
pub fn build_create_chat_invite_link<'a>( &'a self, chat_id: i64 ) -> CallCreateChatInviteLink<'a>
Use this method to create an additional invite link for a chat. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. The link can be revoked using the method revokeChatInviteLink. Returns the new invite link as ChatInviteLink object.
sourcepub fn build_get_chat_administrators<'a>(
&'a self,
chat_id: i64
) -> CallGetChatAdministrators<'a>
pub fn build_get_chat_administrators<'a>( &'a self, chat_id: i64 ) -> CallGetChatAdministrators<'a>
Use this method to get a list of administrators in a chat, which aren’t bots. Returns an Array of ChatMember objects.
sourcepub fn build_hide_general_forum_topic<'a>(
&'a self,
chat_id: i64
) -> CallHideGeneralForumTopic<'a>
pub fn build_hide_general_forum_topic<'a>( &'a self, chat_id: i64 ) -> CallHideGeneralForumTopic<'a>
Use this method to hide the ‘General’ topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. The topic will be automatically closed if it was open. Returns True on success.
sourcepub fn build_send_chat_action<'a>(
&'a self,
chat_id: i64,
action: &'a str
) -> CallSendChatAction<'a>
pub fn build_send_chat_action<'a>( &'a self, chat_id: i64, action: &'a str ) -> CallSendChatAction<'a>
Use this method when you need to tell the user that something is happening on the bot’s side. The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status). Returns True on success.We only recommend using this method when a response from the bot will take a noticeable amount of time to arrive.
Use this method to get the current value of the bot’s menu button in a private chat, or the default menu button. Returns MenuButton on success.
sourcepub fn build_edit_message_caption<'a>(&'a self) -> CallEditMessageCaption<'a>
pub fn build_edit_message_caption<'a>(&'a self) -> CallEditMessageCaption<'a>
Use this method to edit captions of messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.
sourcepub fn build_unpin_all_general_forum_topic_messages<'a>(
&'a self,
chat_id: i64
) -> CallUnpinAllGeneralForumTopicMessages<'a>
pub fn build_unpin_all_general_forum_topic_messages<'a>( &'a self, chat_id: i64 ) -> CallUnpinAllGeneralForumTopicMessages<'a>
Use this method to clear the list of pinned messages in a General forum topic. The bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator right in the supergroup. Returns True on success.
sourcepub fn build_get_game_high_scores<'a>(
&'a self,
user_id: i64
) -> CallGetGameHighScores<'a>
pub fn build_get_game_high_scores<'a>( &'a self, user_id: i64 ) -> CallGetGameHighScores<'a>
Use this method to get data for high score tables. Will return the score of the specified user and several of their neighbors in a game. Returns an Array of GameHighScore objects.
sourcepub fn build_get_updates<'a>(&'a self) -> CallGetUpdates<'a>
pub fn build_get_updates<'a>(&'a self) -> CallGetUpdates<'a>
Use this method to receive incoming updates using long polling (wiki). Returns an Array of Update objects.
sourcepub fn build_send_message<'a>(
&'a self,
chat_id: i64,
text: &'a str
) -> CallSendMessage<'a>
pub fn build_send_message<'a>( &'a self, chat_id: i64, text: &'a str ) -> CallSendMessage<'a>
Use this method to send text messages. On success, the sent Message is returned.
sourcepub fn build_delete_my_commands<'a>(&'a self) -> CallDeleteMyCommands<'a>
pub fn build_delete_my_commands<'a>(&'a self) -> CallDeleteMyCommands<'a>
Use this method to delete the list of the bot’s commands for the given scope and user language. After deletion, higher level commands will be shown to affected users. Returns True on success.
sourcepub fn build_unpin_all_chat_messages<'a>(
&'a self,
chat_id: i64
) -> CallUnpinAllChatMessages<'a>
pub fn build_unpin_all_chat_messages<'a>( &'a self, chat_id: i64 ) -> CallUnpinAllChatMessages<'a>
Use this method to clear the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the ‘can_pin_messages’ administrator right in a supergroup or ‘can_edit_messages’ administrator right in a channel. Returns True on success.
sourcepub fn build_stop_poll<'a>(
&'a self,
chat_id: i64,
message_id: i64
) -> CallStopPoll<'a>
pub fn build_stop_poll<'a>( &'a self, chat_id: i64, message_id: i64 ) -> CallStopPoll<'a>
Use this method to stop a poll which was sent by the bot. On success, the stopped Poll is returned.
sourcepub fn build_send_game<'a>(
&'a self,
chat_id: i64,
game_short_name: &'a str
) -> CallSendGame<'a>
pub fn build_send_game<'a>( &'a self, chat_id: i64, game_short_name: &'a str ) -> CallSendGame<'a>
Use this method to send a game. On success, the sent Message is returned.
sourcepub fn build_create_new_sticker_set<'a>(
&'a self,
user_id: i64,
name: &'a str,
title: &'a str,
stickers: &'a Vec<InputSticker>,
sticker_format: &'a str
) -> CallCreateNewStickerSet<'a>
pub fn build_create_new_sticker_set<'a>( &'a self, user_id: i64, name: &'a str, title: &'a str, stickers: &'a Vec<InputSticker>, sticker_format: &'a str ) -> CallCreateNewStickerSet<'a>
Use this method to create a new sticker set owned by a user. The bot will be able to edit the sticker set thus created. Returns True on success.
sourcepub fn build_unban_chat_sender_chat<'a>(
&'a self,
chat_id: i64,
sender_chat_id: i64
) -> CallUnbanChatSenderChat<'a>
pub fn build_unban_chat_sender_chat<'a>( &'a self, chat_id: i64, sender_chat_id: i64 ) -> CallUnbanChatSenderChat<'a>
Use this method to unban a previously banned channel chat in a supergroup or channel. The bot must be an administrator for this to work and must have the appropriate administrator rights. Returns True on success.
sourcepub fn build_send_sticker<'a>(
&'a self,
chat_id: i64,
sticker: FileData
) -> CallSendSticker<'a>
pub fn build_send_sticker<'a>( &'a self, chat_id: i64, sticker: FileData ) -> CallSendSticker<'a>
Use this method to send static .WEBP, animated .TGS, or video .WEBM stickers. On success, the sent Message is returned.
sourcepub fn build_send_animation<'a>(
&'a self,
chat_id: i64,
animation: FileData
) -> CallSendAnimation<'a>
pub fn build_send_animation<'a>( &'a self, chat_id: i64, animation: FileData ) -> CallSendAnimation<'a>
Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). On success, the sent Message is returned. Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future.
sourcepub fn build_set_my_commands<'a>(
&'a self,
commands: &'a Vec<BotCommand>
) -> CallSetMyCommands<'a>
pub fn build_set_my_commands<'a>( &'a self, commands: &'a Vec<BotCommand> ) -> CallSetMyCommands<'a>
Use this method to change the list of the bot’s commands. See this manual for more details about bot commands. Returns True on success.
sourcepub fn build_get_webhook_info<'a>(&'a self) -> CallGetWebhookInfo<'a>
pub fn build_get_webhook_info<'a>(&'a self) -> CallGetWebhookInfo<'a>
Use this method to get current webhook status. Requires no parameters. On success, returns a WebhookInfo object. If the bot is using getUpdates, will return an object with the url field empty.
sourcepub fn build_answer_inline_query<'a>(
&'a self,
inline_query_id: &'a str,
results: &'a Vec<InlineQueryResult>
) -> CallAnswerInlineQuery<'a>
pub fn build_answer_inline_query<'a>( &'a self, inline_query_id: &'a str, results: &'a Vec<InlineQueryResult> ) -> CallAnswerInlineQuery<'a>
Use this method to send answers to an inline query. On success, True is returned.No more than 50 results per query are allowed.
sourcepub fn build_set_chat_permissions<'a>(
&'a self,
chat_id: i64,
permissions: &'a ChatPermissions
) -> CallSetChatPermissions<'a>
pub fn build_set_chat_permissions<'a>( &'a self, chat_id: i64, permissions: &'a ChatPermissions ) -> CallSetChatPermissions<'a>
Use this method to set default chat permissions for all members. The bot must be an administrator in the group or a supergroup for this to work and must have the can_restrict_members administrator rights. Returns True on success.
sourcepub fn build_set_sticker_keywords<'a>(
&'a self,
sticker: &'a str
) -> CallSetStickerKeywords<'a>
pub fn build_set_sticker_keywords<'a>( &'a self, sticker: &'a str ) -> CallSetStickerKeywords<'a>
Use this method to change search keywords assigned to a regular or custom emoji sticker. The sticker must belong to a sticker set created by the bot. Returns True on success.
sourcepub fn build_edit_message_media<'a>(
&'a self,
media: &'a InputMedia
) -> CallEditMessageMedia<'a>
pub fn build_edit_message_media<'a>( &'a self, media: &'a InputMedia ) -> CallEditMessageMedia<'a>
Use this method to edit animation, audio, document, photo, or video messages. If a message is part of a message album, then it can be edited only to an audio for audio albums, only to a document for document albums and to a photo or a video otherwise. When an inline message is edited, a new file can’t be uploaded; use a previously uploaded file via its file_id or specify a URL. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.
sourcepub fn build_set_sticker_emoji_list<'a>(
&'a self,
sticker: &'a str,
emoji_list: &'a Vec<String>
) -> CallSetStickerEmojiList<'a>
pub fn build_set_sticker_emoji_list<'a>( &'a self, sticker: &'a str, emoji_list: &'a Vec<String> ) -> CallSetStickerEmojiList<'a>
Use this method to change the list of emoji assigned to a regular or custom emoji sticker. The sticker must belong to a sticker set created by the bot. Returns True on success.
sourcepub fn build_answer_callback_query<'a>(
&'a self,
callback_query_id: &'a str
) -> CallAnswerCallbackQuery<'a>
pub fn build_answer_callback_query<'a>( &'a self, callback_query_id: &'a str ) -> CallAnswerCallbackQuery<'a>
Use this method to send answers to callback queries sent from inline keyboards. The answer will be displayed to the user as a notification at the top of the chat screen or as an alert. On success, True is returned.
sourcepub fn build_answer_pre_checkout_query<'a>(
&'a self,
pre_checkout_query_id: &'a str,
ok: bool
) -> CallAnswerPreCheckoutQuery<'a>
pub fn build_answer_pre_checkout_query<'a>( &'a self, pre_checkout_query_id: &'a str, ok: bool ) -> CallAnswerPreCheckoutQuery<'a>
Once the user has confirmed their payment and shipping details, the Bot API sends the final confirmation in the form of an Update with the field pre_checkout_query. Use this method to respond to such pre-checkout queries. On success, True is returned. Note: The Bot API must receive an answer within 10 seconds after the pre-checkout query was sent.
sourcepub fn build_unban_chat_member<'a>(
&'a self,
chat_id: i64,
user_id: i64
) -> CallUnbanChatMember<'a>
pub fn build_unban_chat_member<'a>( &'a self, chat_id: i64, user_id: i64 ) -> CallUnbanChatMember<'a>
Use this method to unban a previously banned user in a supergroup or channel. The user will not return to the group or channel automatically, but will be able to join via link, etc. The bot must be an administrator for this to work. By default, this method guarantees that after the call the user is not a member of the chat, but will be able to join it. So if the user is a member of the chat they will also be removed from the chat. If you don’t want this, use the parameter only_if_banned. Returns True on success.
sourcepub fn build_forward_message<'a>(
&'a self,
chat_id: i64,
from_chat_id: i64,
message_id: i64
) -> CallForwardMessage<'a>
pub fn build_forward_message<'a>( &'a self, chat_id: i64, from_chat_id: i64, message_id: i64 ) -> CallForwardMessage<'a>
Use this method to forward messages of any kind. Service messages can’t be forwarded. On success, the sent Message is returned.
sourcepub fn build_get_my_commands<'a>(&'a self) -> CallGetMyCommands<'a>
pub fn build_get_my_commands<'a>(&'a self) -> CallGetMyCommands<'a>
Use this method to get the current list of the bot’s commands for the given scope and user language. Returns an Array of BotCommand objects. If commands aren’t set, an empty list is returned.
sourcepub fn build_unpin_all_forum_topic_messages<'a>(
&'a self,
chat_id: i64,
message_thread_id: i64
) -> CallUnpinAllForumTopicMessages<'a>
pub fn build_unpin_all_forum_topic_messages<'a>( &'a self, chat_id: i64, message_thread_id: i64 ) -> CallUnpinAllForumTopicMessages<'a>
Use this method to clear the list of pinned messages in a forum topic. The bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator right in the supergroup. Returns True on success.
sourcepub fn build_get_forum_topic_icon_stickers<'a>(
&'a self
) -> CallGetForumTopicIconStickers<'a>
pub fn build_get_forum_topic_icon_stickers<'a>( &'a self ) -> CallGetForumTopicIconStickers<'a>
Use this method to get custom emoji stickers, which can be used as a forum topic icon by any user. Requires no parameters. Returns an Array of Sticker objects.
sourcepub fn build_unpin_chat_message<'a>(
&'a self,
chat_id: i64
) -> CallUnpinChatMessage<'a>
pub fn build_unpin_chat_message<'a>( &'a self, chat_id: i64 ) -> CallUnpinChatMessage<'a>
Use this method to remove a message from the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the ‘can_pin_messages’ administrator right in a supergroup or ‘can_edit_messages’ administrator right in a channel. Returns True on success.
sourcepub fn build_send_voice<'a>(
&'a self,
chat_id: i64,
voice: FileData
) -> CallSendVoice<'a>
pub fn build_send_voice<'a>( &'a self, chat_id: i64, voice: FileData ) -> CallSendVoice<'a>
Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS (other formats may be sent as Audio or Document). On success, the sent Message is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future.
sourcepub fn build_set_my_name<'a>(&'a self) -> CallSetMyName<'a>
pub fn build_set_my_name<'a>(&'a self) -> CallSetMyName<'a>
Use this method to change the bot’s name. Returns True on success.
sourcepub fn build_ban_chat_sender_chat<'a>(
&'a self,
chat_id: i64,
sender_chat_id: i64
) -> CallBanChatSenderChat<'a>
pub fn build_ban_chat_sender_chat<'a>( &'a self, chat_id: i64, sender_chat_id: i64 ) -> CallBanChatSenderChat<'a>
Use this method to ban a channel chat in a supergroup or a channel. Until the chat is unbanned, the owner of the banned chat won’t be able to send messages on behalf of any of their channels. The bot must be an administrator in the supergroup or channel for this to work and must have the appropriate administrator rights. Returns True on success.
sourcepub fn build_send_document<'a>(
&'a self,
chat_id: i64,
document: FileData
) -> CallSendDocument<'a>
pub fn build_send_document<'a>( &'a self, chat_id: i64, document: FileData ) -> CallSendDocument<'a>
Use this method to send general files. On success, the sent Message is returned. Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future.
sourcepub fn build_ban_chat_member<'a>(
&'a self,
chat_id: i64,
user_id: i64
) -> CallBanChatMember<'a>
pub fn build_ban_chat_member<'a>( &'a self, chat_id: i64, user_id: i64 ) -> CallBanChatMember<'a>
Use this method to ban a user in a group, a supergroup or a channel. In the case of supergroups and channels, the user will not be able to return to the chat on their own using invite links, etc., unless unbanned first. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success.
sourcepub fn build_set_game_score<'a>(
&'a self,
user_id: i64,
score: i64
) -> CallSetGameScore<'a>
pub fn build_set_game_score<'a>( &'a self, user_id: i64, score: i64 ) -> CallSetGameScore<'a>
Use this method to set the score of the specified user in a game message. On success, if the message is not an inline message, the Message is returned, otherwise True is returned. Returns an error, if the new score is not greater than the user’s current score in the chat and force is False.
sourcepub fn build_answer_shipping_query<'a>(
&'a self,
shipping_query_id: &'a str,
ok: bool
) -> CallAnswerShippingQuery<'a>
pub fn build_answer_shipping_query<'a>( &'a self, shipping_query_id: &'a str, ok: bool ) -> CallAnswerShippingQuery<'a>
If you sent an invoice requesting a shipping address and the parameter is_flexible was specified, the Bot API will send an Update with a shipping_query field to the bot. Use this method to reply to shipping queries. On success, True is returned.
sourcepub fn build_close<'a>(&'a self) -> CallClose<'a>
pub fn build_close<'a>(&'a self) -> CallClose<'a>
Use this method to close the bot instance before moving it from one local server to another. You need to delete the webhook before calling this method to ensure that the bot isn’t launched again after server restart. The method will return error 429 in the first 10 minutes after the bot is launched. Returns True on success. Requires no parameters.
sourcepub fn build_get_my_default_administrator_rights<'a>(
&'a self
) -> CallGetMyDefaultAdministratorRights<'a>
pub fn build_get_my_default_administrator_rights<'a>( &'a self ) -> CallGetMyDefaultAdministratorRights<'a>
Use this method to get the current default administrator rights of the bot. Returns ChatAdministratorRights on success.
sourcepub fn build_set_my_default_administrator_rights<'a>(
&'a self
) -> CallSetMyDefaultAdministratorRights<'a>
pub fn build_set_my_default_administrator_rights<'a>( &'a self ) -> CallSetMyDefaultAdministratorRights<'a>
Use this method to change the default administrator rights requested by the bot when it’s added as an administrator to groups or channels. These rights will be suggested to users, but they are free to modify the list before adding the bot. Returns True on success.
sourcepub fn build_restrict_chat_member<'a>(
&'a self,
chat_id: i64,
user_id: i64,
permissions: &'a ChatPermissions
) -> CallRestrictChatMember<'a>
pub fn build_restrict_chat_member<'a>( &'a self, chat_id: i64, user_id: i64, permissions: &'a ChatPermissions ) -> CallRestrictChatMember<'a>
Use this method to restrict a user in a supergroup. The bot must be an administrator in the supergroup for this to work and must have the appropriate administrator rights. Pass True for all permissions to lift restrictions from a user. Returns True on success.
sourcepub fn build_set_passport_data_errors<'a>(
&'a self,
user_id: i64,
errors: &'a Vec<PassportElementError>
) -> CallSetPassportDataErrors<'a>
pub fn build_set_passport_data_errors<'a>( &'a self, user_id: i64, errors: &'a Vec<PassportElementError> ) -> CallSetPassportDataErrors<'a>
Informs a user that some of the Telegram Passport elements they provided contains errors. The user will not be able to re-submit their Passport to you until the errors are fixed (the contents of the field for which you returned the error must change). Returns True on success.Use this if the data submitted by the user doesn’t satisfy the standards your service requires for any reason. For example, if a birthday date seems invalid, a submitted document is blurry, a scan shows evidence of tampering, etc. Supply some details in the error message to make sure the user knows how to correct the issues.
sourcepub fn build_get_user_profile_photos<'a>(
&'a self,
user_id: i64
) -> CallGetUserProfilePhotos<'a>
pub fn build_get_user_profile_photos<'a>( &'a self, user_id: i64 ) -> CallGetUserProfilePhotos<'a>
Use this method to get a list of profile pictures for a user. Returns a UserProfilePhotos object.
sourcepub fn build_get_file<'a>(&'a self, file_id: &'a str) -> CallGetFile<'a>
pub fn build_get_file<'a>(&'a self, file_id: &'a str) -> CallGetFile<'a>
Use this method to get basic information about a file and prepare it for downloading. For the moment, bots can download files of up to 20MB in size. On success, a File object is returned. The file can then be downloaded via the link https://api.telegram.org/file/bot
sourcepub fn build_get_chat_member<'a>(
&'a self,
chat_id: i64,
user_id: i64
) -> CallGetChatMember<'a>
pub fn build_get_chat_member<'a>( &'a self, chat_id: i64, user_id: i64 ) -> CallGetChatMember<'a>
Use this method to get information about a member of a chat. The method is only guaranteed to work for other users if the bot is an administrator in the chat. Returns a ChatMember object on success.
sourcepub fn build_stop_message_live_location<'a>(
&'a self
) -> CallStopMessageLiveLocation<'a>
pub fn build_stop_message_live_location<'a>( &'a self ) -> CallStopMessageLiveLocation<'a>
Use this method to stop updating a live location message before live_period expires. On success, if the message is not an inline message, the edited Message is returned, otherwise True is returned.
sourcepub fn build_set_my_description<'a>(&'a self) -> CallSetMyDescription<'a>
pub fn build_set_my_description<'a>(&'a self) -> CallSetMyDescription<'a>
Use this method to change the bot’s description, which is shown in the chat with the bot if the chat is empty. Returns True on success.
sourcepub fn build_delete_chat_photo<'a>(
&'a self,
chat_id: i64
) -> CallDeleteChatPhoto<'a>
pub fn build_delete_chat_photo<'a>( &'a self, chat_id: i64 ) -> CallDeleteChatPhoto<'a>
Use this method to delete a chat photo. Photos can’t be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success.
sourcepub fn build_set_my_short_description<'a>(
&'a self
) -> CallSetMyShortDescription<'a>
pub fn build_set_my_short_description<'a>( &'a self ) -> CallSetMyShortDescription<'a>
Use this method to change the bot’s short description, which is shown on the bot’s profile page and is sent together with the link when users share the bot. Returns True on success.
sourcepub fn build_send_photo<'a>(
&'a self,
chat_id: i64,
photo: FileData
) -> CallSendPhoto<'a>
pub fn build_send_photo<'a>( &'a self, chat_id: i64, photo: FileData ) -> CallSendPhoto<'a>
Use this method to send photos. On success, the sent Message is returned.
Use this method to change the bot’s menu button in a private chat, or the default menu button. Returns True on success.
sourcepub fn build_set_chat_administrator_custom_title<'a>(
&'a self,
chat_id: i64,
user_id: i64,
custom_title: &'a str
) -> CallSetChatAdministratorCustomTitle<'a>
pub fn build_set_chat_administrator_custom_title<'a>( &'a self, chat_id: i64, user_id: i64, custom_title: &'a str ) -> CallSetChatAdministratorCustomTitle<'a>
Use this method to set a custom title for an administrator in a supergroup promoted by the bot. Returns True on success.
sourcepub fn build_set_chat_sticker_set<'a>(
&'a self,
chat_id: i64,
sticker_set_name: &'a str
) -> CallSetChatStickerSet<'a>
pub fn build_set_chat_sticker_set<'a>( &'a self, chat_id: i64, sticker_set_name: &'a str ) -> CallSetChatStickerSet<'a>
Use this method to set a new group sticker set for a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Use the field can_set_sticker_set optionally returned in getChat requests to check if the bot can use this method. Returns True on success.
sourcepub fn build_send_poll<'a>(
&'a self,
chat_id: i64,
question: &'a str,
options: &'a Vec<String>
) -> CallSendPoll<'a>
pub fn build_send_poll<'a>( &'a self, chat_id: i64, question: &'a str, options: &'a Vec<String> ) -> CallSendPoll<'a>
Use this method to send a native poll. On success, the sent Message is returned.
sourcepub fn build_send_video<'a>(
&'a self,
chat_id: i64,
video: FileData
) -> CallSendVideo<'a>
pub fn build_send_video<'a>( &'a self, chat_id: i64, video: FileData ) -> CallSendVideo<'a>
Use this method to send video files, Telegram clients support MPEG4 videos (other formats may be sent as Document). On success, the sent Message is returned. Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future.
sourcepub fn build_send_dice<'a>(&'a self, chat_id: i64) -> CallSendDice<'a>
pub fn build_send_dice<'a>(&'a self, chat_id: i64) -> CallSendDice<'a>
Use this method to send an animated emoji that will display a random value. On success, the sent Message is returned.
sourcepub fn build_approve_chat_join_request<'a>(
&'a self,
chat_id: i64,
user_id: i64
) -> CallApproveChatJoinRequest<'a>
pub fn build_approve_chat_join_request<'a>( &'a self, chat_id: i64, user_id: i64 ) -> CallApproveChatJoinRequest<'a>
Use this method to approve a chat join request. The bot must be an administrator in the chat for this to work and must have the can_invite_users administrator right. Returns True on success.
sourcepub fn build_reopen_forum_topic<'a>(
&'a self,
chat_id: i64,
message_thread_id: i64
) -> CallReopenForumTopic<'a>
pub fn build_reopen_forum_topic<'a>( &'a self, chat_id: i64, message_thread_id: i64 ) -> CallReopenForumTopic<'a>
Use this method to reopen a closed topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success.
sourcepub fn build_add_sticker_to_set<'a>(
&'a self,
user_id: i64,
name: &'a str,
sticker: &'a InputSticker
) -> CallAddStickerToSet<'a>
pub fn build_add_sticker_to_set<'a>( &'a self, user_id: i64, name: &'a str, sticker: &'a InputSticker ) -> CallAddStickerToSet<'a>
Use this method to add a new sticker to a set created by the bot. The format of the added sticker must match the format of the other stickers in the set. Emoji sticker sets can have up to 200 stickers. Animated and video sticker sets can have up to 50 stickers. Static sticker sets can have up to 120 stickers. Returns True on success.