Skip to main content

ExtBot

Struct ExtBot 

Source
pub struct ExtBot { /* private fields */ }
Expand description

Extended bot that adds defaults, arbitrary callback data, and a rate-limiter slot on top of the raw Bot.

§Construction

Use ExtBot::builder for the full option set, or ExtBot::from_bot for the simplest case (no defaults, no cache, no rate limiter).

§Deref to Bot

ExtBot implements Deref<Target = Bot>, making all Bot methods accessible directly. This is a zero-cost abstraction – no allocation or indirection beyond what Bot already provides.

§Rate limiter

When a rate limiter is set, the inner Bot’s HTTP request backend is wrapped in a RateLimitedRequest so that all API calls are throttled transparently at the transport layer.

Implementations§

Source§

impl ExtBot

Source

pub fn from_bot(bot: Bot) -> Self

Creates an ExtBot from a raw Bot with no extras.

This is the simplest construction path – no defaults, no callback data cache, and no rate limiter.

§Example
let bot = Bot::new("token", request);
let ext = ExtBot::from_bot(bot);
Source

pub fn inner(&self) -> &Bot

Returns a reference to the underlying raw bot.

Note: With the Deref<Target = Bot> implementation, you can call Bot methods directly on ExtBot without using .inner(). This method is retained for backward compatibility.

Source

pub fn token(&self) -> &str

Returns the bot token (delegates to the inner bot).

Source

pub fn defaults(&self) -> Option<&Defaults>

Returns the user-defined defaults, if any.

Source

pub fn callback_data_cache(&self) -> Option<&Arc<RwLock<CallbackDataCache>>>

Returns a reference to the callback data cache, if enabled.

Source

pub fn has_callback_data_cache(&self) -> bool

Returns true if arbitrary callback data is enabled.

Source

pub fn has_rate_limiter(&self) -> bool

Returns true if a rate limiter is configured.

Source

pub fn rate_limiter(&self) -> Option<()>

Returns the rate-limiter placeholder (always None when feature is disabled).

Source

pub fn builder( token: impl Into<String>, request: Arc<dyn BaseRequest>, ) -> ExtBotBuilder

Convenience builder entry point.

Source

pub async fn initialize(&self) -> Result<()>

Initializes the bot.

If a rate limiter is present, it is initialized here.

Source

pub async fn shutdown(&self) -> Result<()>

Shuts down the bot.

If a rate limiter is present, it is shut down here.

Methods from Deref<Target = Bot>§

Source

pub fn token(&self) -> &str

Returns the bot token.

Source

pub fn base_url(&self) -> &str

Returns the base API URL.

Source

pub fn base_file_url(&self) -> &str

Returns the base file-download URL.

Source

pub fn defaults(&self) -> Option<&Defaults>

Returns the user-configured defaults, if any.

Source

pub fn bot_data(&self) -> Option<&User>

Returns the cached bot user data from get_me(), if initialized.

Source

pub fn local_mode(&self) -> bool

Returns true if the bot is operating in local mode.

Source

pub async fn download_file_raw( &self, file_path: &str, ) -> Result<Vec<u8>, TelegramError>

Downloads a file from the Telegram servers given its file_path.

Source

pub async fn shutdown(&self) -> Result<(), TelegramError>

Shuts down the bot and releases the HTTP request backend.

Source

pub async fn do_api_request<T>( &self, method: &str, params: Vec<RequestParameter>, ) -> Result<T, TelegramError>

Sends a raw API request with the given method name and parameters.

Source

pub async fn do_api_request_with_kwargs<T>( &self, method: &str, params: Vec<RequestParameter>, api_kwargs: Option<HashMap<String, Value>>, ) -> Result<T, TelegramError>

Sends a raw API request with additional keyword arguments merged into the parameters.

Source

pub async fn get_updates_raw( &self, offset: Option<i64>, limit: Option<i32>, timeout: Option<i32>, allowed_updates: Option<Vec<String>>, ) -> Result<Vec<Update>, TelegramError>

Calls the Telegram getUpdates long-polling endpoint.

Source

pub async fn set_webhook_raw( &self, url: &str, certificate: Option<InputFile>, ip_address: Option<&str>, max_connections: Option<i32>, allowed_updates: Option<Vec<String>>, drop_pending_updates: Option<bool>, secret_token: Option<&str>, ) -> Result<bool, TelegramError>

Sets a webhook for receiving updates. Internal raw method.

Calls the Telegram setWebhook API method.

Source

pub async fn delete_webhook_raw( &self, drop_pending_updates: Option<bool>, ) -> Result<bool, TelegramError>

Removes the webhook integration. Internal raw method.

Calls the Telegram deleteWebhook API method.

Source

pub async fn get_webhook_info_raw(&self) -> Result<WebhookInfo, TelegramError>

Use this method to get current webhook status.

Calls the Telegram getWebhookInfo API method.

Source

pub async fn get_me_raw(&self) -> Result<User, TelegramError>

Calls the getMe endpoint, returning the bot’s own User object.

Source

pub async fn log_out_raw(&self) -> Result<bool, TelegramError>

Use this method to log out from the cloud Bot API server.

Calls the Telegram logOut API method.

Source

pub async fn close_raw(&self) -> Result<bool, TelegramError>

Use this method to close the bot instance before moving it from one local server to another.

Calls the Telegram close API method.

Source

pub async fn set_chat_menu_button_raw( &self, chat_id: Option<i64>, menu_button: Option<MenuButton>, ) -> Result<bool, TelegramError>

Use this method to change the bot’s menu button in a private chat, or the default menu button.

Calls the Telegram setChatMenuButton API method.

Source

pub async fn get_chat_menu_button_raw( &self, chat_id: Option<i64>, ) -> Result<MenuButton, TelegramError>

Use this method to get the current value of the bot’s menu button in a private chat.

Calls the Telegram getChatMenuButton API method.

Source

pub async fn set_my_commands_raw( &self, commands: Vec<BotCommand>, scope: Option<BotCommandScope>, language_code: Option<&str>, ) -> Result<bool, TelegramError>

Use this method to change the list of the bot’s commands.

Calls the Telegram setMyCommands API method.

Source

pub async fn get_my_commands_raw( &self, scope: Option<BotCommandScope>, language_code: Option<&str>, ) -> Result<Vec<BotCommand>, TelegramError>

Use this method to get the current list of the bot’s commands.

Calls the Telegram getMyCommands API method.

Source

pub async fn delete_my_commands_raw( &self, scope: Option<BotCommandScope>, language_code: Option<&str>, ) -> Result<bool, TelegramError>

Use this method to delete the list of the bot’s commands for a given scope and language.

Calls the Telegram deleteMyCommands API method.

Source

pub async fn set_my_default_administrator_rights_raw( &self, rights: Option<ChatAdministratorRights>, for_channels: Option<bool>, ) -> Result<bool, TelegramError>

Use this method to change the default administrator rights requested by the bot.

Calls the Telegram setMyDefaultAdministratorRights API method.

Source

pub async fn get_my_default_administrator_rights_raw( &self, for_channels: Option<bool>, ) -> Result<ChatAdministratorRights, TelegramError>

Use this method to get the current default administrator rights of the bot.

Calls the Telegram getMyDefaultAdministratorRights API method.

Source

pub async fn set_my_description_raw( &self, description: Option<&str>, language_code: Option<&str>, ) -> Result<bool, TelegramError>

Use this method to change the bot’s description.

Calls the Telegram setMyDescription API method.

Source

pub async fn get_my_description_raw( &self, language_code: Option<&str>, ) -> Result<BotDescription, TelegramError>

Use this method to get the current bot description.

Calls the Telegram getMyDescription API method.

Source

pub async fn set_my_short_description_raw( &self, short_description: Option<&str>, language_code: Option<&str>, ) -> Result<bool, TelegramError>

Use this method to change the bot’s short description.

Calls the Telegram setMyShortDescription API method.

Source

pub async fn get_my_short_description_raw( &self, language_code: Option<&str>, ) -> Result<BotShortDescription, TelegramError>

Use this method to get the current bot short description.

Calls the Telegram getMyShortDescription API method.

Source

pub async fn set_my_name_raw( &self, name: Option<&str>, language_code: Option<&str>, ) -> Result<bool, TelegramError>

Use this method to change the bot’s name.

Calls the Telegram setMyName API method.

Source

pub async fn get_my_name_raw( &self, language_code: Option<&str>, ) -> Result<BotName, TelegramError>

Use this method to get the current bot name.

Calls the Telegram getMyName API method.

Source

pub async fn get_business_connection_raw( &self, business_connection_id: &str, ) -> Result<BusinessConnection, TelegramError>

Use this method to get information about the connection of the bot with a business account.

Calls the Telegram getBusinessConnection API method.

Source

pub async fn get_business_account_gifts_raw( &self, business_connection_id: &str, exclude_unsaved: Option<bool>, exclude_saved: Option<bool>, exclude_unlimited: Option<bool>, exclude_unique: Option<bool>, sort_by_price: Option<bool>, offset: Option<&str>, limit: Option<i64>, exclude_limited_upgradable: Option<bool>, exclude_limited_non_upgradable: Option<bool>, exclude_from_blockchain: Option<bool>, ) -> Result<OwnedGifts, TelegramError>

Use this method to get the gifts received by a business account.

Calls the Telegram getBusinessAccountGifts API method.

Source

pub async fn get_business_account_star_balance_raw( &self, business_connection_id: &str, ) -> Result<StarAmount, TelegramError>

Use this method to get the current star balance of a business account.

Calls the Telegram getBusinessAccountStarBalance API method.

Source

pub async fn read_business_message_raw( &self, business_connection_id: &str, chat_id: i64, message_id: i64, ) -> Result<bool, TelegramError>

Use this method to mark a message as read on behalf of a business account.

Calls the Telegram readBusinessMessage API method.

Source

pub async fn delete_business_messages_raw( &self, business_connection_id: &str, message_ids: Vec<i64>, ) -> Result<bool, TelegramError>

Use this method to delete messages on behalf of a business account.

Calls the Telegram deleteBusinessMessages API method.

Source

pub async fn set_business_account_name_raw( &self, business_connection_id: &str, first_name: &str, last_name: Option<&str>, ) -> Result<bool, TelegramError>

Use this method to set the name of a business account.

Calls the Telegram setBusinessAccountName API method.

Source

pub async fn set_business_account_username_raw( &self, business_connection_id: &str, username: Option<&str>, ) -> Result<bool, TelegramError>

Use this method to set the username of a business account.

Calls the Telegram setBusinessAccountUsername API method.

Source

pub async fn set_business_account_bio_raw( &self, business_connection_id: &str, bio: Option<&str>, ) -> Result<bool, TelegramError>

Use this method to set the bio of a business account.

Calls the Telegram setBusinessAccountBio API method.

Source

pub async fn set_business_account_gift_settings_raw( &self, business_connection_id: &str, show_gift_button: bool, accepted_gift_types: AcceptedGiftTypes, ) -> Result<bool, TelegramError>

Use this method to set the gift settings of a business account.

Calls the Telegram setBusinessAccountGiftSettings API method.

Source

pub async fn set_business_account_profile_photo_raw( &self, business_connection_id: &str, photo: Value, is_public: Option<bool>, ) -> Result<bool, TelegramError>

Use this method to set the profile photo of a business account.

Calls the Telegram setBusinessAccountProfilePhoto API method.

Source

pub async fn remove_business_account_profile_photo_raw( &self, business_connection_id: &str, is_public: Option<bool>, ) -> Result<bool, TelegramError>

Use this method to remove the profile photo of a business account.

Calls the Telegram removeBusinessAccountProfilePhoto API method.

Source

pub async fn convert_gift_to_stars_raw( &self, business_connection_id: &str, owned_gift_id: &str, ) -> Result<bool, TelegramError>

Use this method to convert a regular gift owned by a business account to Telegram Stars.

Calls the Telegram convertGiftToStars API method.

Source

pub async fn upgrade_gift_raw( &self, business_connection_id: &str, owned_gift_id: &str, keep_original_details: Option<bool>, star_count: Option<i64>, ) -> Result<bool, TelegramError>

Use this method to upgrade a regular gift to a unique gift.

Calls the Telegram upgradeGift API method.

Source

pub async fn transfer_gift_raw( &self, business_connection_id: &str, owned_gift_id: &str, new_owner_chat_id: i64, star_count: Option<i64>, ) -> Result<bool, TelegramError>

Use this method to transfer a unique gift to another user or channel chat.

Calls the Telegram transferGift API method.

Source

pub async fn transfer_business_account_stars_raw( &self, business_connection_id: &str, star_count: i64, ) -> Result<bool, TelegramError>

Use this method to transfer Telegram Stars from a business account to the bot’s balance.

Calls the Telegram transferBusinessAccountStars API method.

Source

pub async fn edit_message_text_raw( &self, text: &str, chat_id: Option<ChatId>, message_id: Option<i64>, inline_message_id: Option<&str>, parse_mode: Option<&str>, entities: Option<Vec<MessageEntity>>, link_preview_options: Option<LinkPreviewOptions>, reply_markup: Option<Value>, business_connection_id: Option<&str>, ) -> Result<MessageOrBool, TelegramError>

Edits the text of a message. Internal raw method used by builder APIs.

Calls the Telegram editMessageText API method.

Source

pub async fn edit_message_caption_raw( &self, chat_id: Option<ChatId>, message_id: Option<i64>, inline_message_id: Option<&str>, caption: Option<&str>, parse_mode: Option<&str>, caption_entities: Option<Vec<MessageEntity>>, reply_markup: Option<Value>, show_caption_above_media: Option<bool>, business_connection_id: Option<&str>, ) -> Result<MessageOrBool, TelegramError>

Edits the caption of a message. Internal raw method used by builder APIs.

Calls the Telegram editMessageCaption API method.

Source

pub async fn edit_message_media_raw( &self, media: Value, chat_id: Option<ChatId>, message_id: Option<i64>, inline_message_id: Option<&str>, reply_markup: Option<Value>, business_connection_id: Option<&str>, ) -> Result<MessageOrBool, TelegramError>

Edits the media content of a message. Internal raw method used by builder APIs.

Calls the Telegram editMessageMedia API method.

Source

pub async fn edit_message_reply_markup_raw( &self, chat_id: Option<ChatId>, message_id: Option<i64>, inline_message_id: Option<&str>, reply_markup: Option<Value>, business_connection_id: Option<&str>, ) -> Result<MessageOrBool, TelegramError>

Edits the reply markup of a message. Internal raw method used by builder APIs.

Calls the Telegram editMessageReplyMarkup API method.

Source

pub async fn edit_message_live_location_raw( &self, latitude: f64, longitude: f64, chat_id: Option<ChatId>, message_id: Option<i64>, inline_message_id: Option<&str>, horizontal_accuracy: Option<f64>, heading: Option<i64>, proximity_alert_radius: Option<i64>, reply_markup: Option<Value>, live_period: Option<i64>, business_connection_id: Option<&str>, ) -> Result<MessageOrBool, TelegramError>

Use this method to edit live location messages.

Calls the Telegram editMessageLiveLocation API method.

Source

pub async fn stop_message_live_location_raw( &self, chat_id: Option<ChatId>, message_id: Option<i64>, inline_message_id: Option<&str>, reply_markup: Option<Value>, business_connection_id: Option<&str>, ) -> Result<MessageOrBool, TelegramError>

Use this method to stop updating a live location message.

Calls the Telegram stopMessageLiveLocation API method.

Source

pub async fn edit_message_checklist_raw( &self, business_connection_id: &str, chat_id: i64, message_id: i64, checklist: InputChecklist, reply_markup: Option<Value>, ) -> Result<Message, TelegramError>

Use this method to edit a checklist message sent by the bot on behalf of a business account.

Calls the Telegram editMessageChecklist API method.

Source

pub async fn stop_poll_raw( &self, chat_id: ChatId, message_id: i64, reply_markup: Option<Value>, business_connection_id: Option<&str>, ) -> Result<Poll, TelegramError>

Use this method to stop a poll which was sent by the bot.

Calls the Telegram stopPoll API method.

Source

pub async fn create_forum_topic_raw( &self, chat_id: ChatId, name: &str, icon_color: Option<i64>, icon_custom_emoji_id: Option<&str>, ) -> Result<ForumTopic, TelegramError>

Use this method to create a topic in a forum supergroup chat.

Calls the Telegram createForumTopic API method.

Source

pub async fn edit_forum_topic_raw( &self, chat_id: ChatId, message_thread_id: i64, name: Option<&str>, icon_custom_emoji_id: Option<&str>, ) -> Result<bool, TelegramError>

Use this method to edit name and icon of a topic in a forum supergroup chat.

Calls the Telegram editForumTopic API method.

Source

pub async fn close_forum_topic_raw( &self, chat_id: ChatId, message_thread_id: i64, ) -> Result<bool, TelegramError>

Use this method to close an open topic in a forum supergroup chat.

Calls the Telegram closeForumTopic API method.

Source

pub async fn reopen_forum_topic_raw( &self, chat_id: ChatId, message_thread_id: i64, ) -> Result<bool, TelegramError>

Use this method to reopen a closed topic in a forum supergroup chat.

Calls the Telegram reopenForumTopic API method.

Source

pub async fn delete_forum_topic_raw( &self, chat_id: ChatId, message_thread_id: i64, ) -> Result<bool, TelegramError>

Use this method to delete a forum topic along with all its messages.

Calls the Telegram deleteForumTopic API method.

Source

pub async fn unpin_all_forum_topic_messages_raw( &self, chat_id: ChatId, message_thread_id: i64, ) -> Result<bool, TelegramError>

Use this method to clear the list of pinned messages in a forum topic.

Calls the Telegram unpinAllForumTopicMessages API method.

Source

pub async fn unpin_all_general_forum_topic_messages_raw( &self, chat_id: ChatId, ) -> Result<bool, TelegramError>

Use this method to clear the list of pinned messages in a General forum topic.

Calls the Telegram unpinAllGeneralForumTopicMessages API method.

Source

pub async fn edit_general_forum_topic_raw( &self, chat_id: ChatId, name: &str, ) -> Result<bool, TelegramError>

Use this method to edit the name of the ‘General’ topic in a forum supergroup chat.

Calls the Telegram editGeneralForumTopic API method.

Source

pub async fn close_general_forum_topic_raw( &self, chat_id: ChatId, ) -> Result<bool, TelegramError>

Use this method to close an open ‘General’ topic in a forum supergroup chat.

Calls the Telegram closeGeneralForumTopic API method.

Source

pub async fn reopen_general_forum_topic_raw( &self, chat_id: ChatId, ) -> Result<bool, TelegramError>

Use this method to reopen a closed ‘General’ topic in a forum supergroup chat.

Calls the Telegram reopenGeneralForumTopic API method.

Source

pub async fn hide_general_forum_topic_raw( &self, chat_id: ChatId, ) -> Result<bool, TelegramError>

Use this method to hide the ‘General’ topic in a forum supergroup chat.

Calls the Telegram hideGeneralForumTopic API method.

Source

pub async fn unhide_general_forum_topic_raw( &self, chat_id: ChatId, ) -> Result<bool, TelegramError>

Use this method to unhide the ‘General’ topic in a forum supergroup chat.

Calls the Telegram unhideGeneralForumTopic API method.

Source

pub async fn send_game_raw( &self, chat_id: i64, game_short_name: &str, disable_notification: Option<bool>, protect_content: Option<bool>, reply_parameters: Option<ReplyParameters>, reply_markup: Option<Value>, message_thread_id: Option<i64>, business_connection_id: Option<&str>, message_effect_id: Option<&str>, allow_paid_broadcast: Option<bool>, ) -> Result<Message, TelegramError>

Use this method to send a game.

Calls the Telegram sendGame API method.

Source

pub async fn set_game_score_raw( &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<&str>, ) -> Result<MessageOrBool, TelegramError>

Use this method to set the score of the specified user in a game message.

Calls the Telegram setGameScore API method.

Source

pub async fn get_game_high_scores_raw( &self, user_id: i64, chat_id: Option<i64>, message_id: Option<i64>, inline_message_id: Option<&str>, ) -> Result<Vec<GameHighScore>, TelegramError>

Use this method to get data for high score tables.

Calls the Telegram getGameHighScores API method.

Source

pub async fn get_available_gifts_raw(&self) -> Result<Gifts, TelegramError>

Use this method to get the list of gifts that can be sent by the bot to users.

Calls the Telegram getAvailableGifts API method.

Source

pub async fn send_gift_raw( &self, gift_id: &str, user_id: Option<i64>, chat_id: Option<ChatId>, text: Option<&str>, text_parse_mode: Option<&str>, text_entities: Option<Vec<MessageEntity>>, pay_for_upgrade: Option<bool>, ) -> Result<bool, TelegramError>

Use this method to send a gift to a user or channel chat.

Calls the Telegram sendGift API method.

Source

pub async fn gift_premium_subscription_raw( &self, user_id: i64, month_count: i64, star_count: i64, text: Option<&str>, text_parse_mode: Option<&str>, text_entities: Option<Vec<MessageEntity>>, ) -> Result<bool, TelegramError>

Use this method to gift a Telegram Premium subscription to a user.

Calls the Telegram giftPremiumSubscription API method.

Source

pub async fn get_user_gifts_raw( &self, user_id: i64, exclude_unlimited: Option<bool>, exclude_limited_upgradable: Option<bool>, exclude_limited_non_upgradable: Option<bool>, exclude_from_blockchain: Option<bool>, exclude_unique: Option<bool>, sort_by_price: Option<bool>, offset: Option<&str>, limit: Option<i64>, ) -> Result<OwnedGifts, TelegramError>

Use this method to get the list of gifts received by a user.

Calls the Telegram getUserGifts API method.

Source

pub async fn get_chat_gifts_raw( &self, chat_id: ChatId, exclude_unsaved: Option<bool>, exclude_saved: Option<bool>, exclude_unlimited: Option<bool>, exclude_limited_upgradable: Option<bool>, exclude_limited_non_upgradable: Option<bool>, exclude_from_blockchain: Option<bool>, exclude_unique: Option<bool>, sort_by_price: Option<bool>, offset: Option<&str>, limit: Option<i64>, ) -> Result<OwnedGifts, TelegramError>

Use this method to get the list of gifts received by a chat.

Calls the Telegram getChatGifts API method.

Source

pub async fn answer_callback_query_raw( &self, callback_query_id: &str, text: Option<&str>, show_alert: Option<bool>, url: Option<&str>, cache_time: Option<i64>, ) -> Result<bool, TelegramError>

Answers a callback query. Internal raw method used by builder APIs.

Calls the Telegram answerCallbackQuery API method.

Source

pub async fn answer_inline_query_raw( &self, inline_query_id: &str, results: Vec<Value>, cache_time: Option<i64>, is_personal: Option<bool>, next_offset: Option<&str>, button: Option<Value>, ) -> Result<bool, TelegramError>

Answers an inline query. Internal raw method used by builder APIs.

Calls the Telegram answerInlineQuery API method.

Source

pub async fn save_prepared_inline_message_raw( &self, user_id: i64, result: Value, allow_user_chats: Option<bool>, allow_bot_chats: Option<bool>, allow_group_chats: Option<bool>, allow_channel_chats: Option<bool>, ) -> Result<Value, TelegramError>

Use this method to store a message that can be sent by a user of a Mini App.

Calls the Telegram savePreparedInlineMessage API method.

Source

pub async fn answer_web_app_query_raw( &self, web_app_query_id: &str, result: Value, ) -> Result<SentWebAppMessage, TelegramError>

Use this method to set the result of an interaction with a Web App.

Calls the Telegram answerWebAppQuery API method.

Source

pub async fn send_photo_raw( &self, chat_id: ChatId, photo: InputFile, caption: Option<&str>, parse_mode: Option<&str>, caption_entities: Option<Vec<MessageEntity>>, disable_notification: Option<bool>, protect_content: Option<bool>, reply_parameters: Option<ReplyParameters>, reply_markup: Option<Value>, message_thread_id: Option<i64>, has_spoiler: Option<bool>, business_connection_id: Option<&str>, message_effect_id: Option<&str>, allow_paid_broadcast: Option<bool>, show_caption_above_media: Option<bool>, direct_messages_topic_id: Option<i64>, suggested_post_parameters: Option<SuggestedPostParameters>, ) -> Result<Message, TelegramError>

Sends a photo. Internal raw method used by builder APIs.

Calls the Telegram sendPhoto API method.

Source

pub async fn send_audio_raw( &self, chat_id: ChatId, audio: InputFile, caption: Option<&str>, parse_mode: Option<&str>, caption_entities: Option<Vec<MessageEntity>>, duration: Option<i64>, performer: Option<&str>, title: Option<&str>, thumbnail: Option<InputFile>, disable_notification: Option<bool>, protect_content: Option<bool>, reply_parameters: Option<ReplyParameters>, reply_markup: Option<Value>, message_thread_id: Option<i64>, business_connection_id: Option<&str>, message_effect_id: Option<&str>, allow_paid_broadcast: Option<bool>, direct_messages_topic_id: Option<i64>, suggested_post_parameters: Option<SuggestedPostParameters>, ) -> Result<Message, TelegramError>

Sends an audio file. Internal raw method used by builder APIs.

Calls the Telegram sendAudio API method.

Source

pub async fn send_document_raw( &self, chat_id: ChatId, document: InputFile, caption: Option<&str>, parse_mode: Option<&str>, caption_entities: Option<Vec<MessageEntity>>, disable_content_type_detection: Option<bool>, thumbnail: Option<InputFile>, disable_notification: Option<bool>, protect_content: Option<bool>, reply_parameters: Option<ReplyParameters>, reply_markup: Option<Value>, message_thread_id: Option<i64>, business_connection_id: Option<&str>, message_effect_id: Option<&str>, allow_paid_broadcast: Option<bool>, direct_messages_topic_id: Option<i64>, suggested_post_parameters: Option<SuggestedPostParameters>, ) -> Result<Message, TelegramError>

Sends a general file. Internal raw method used by builder APIs.

Calls the Telegram sendDocument API method.

Source

pub async fn send_video_raw( &self, chat_id: ChatId, video: InputFile, duration: Option<i64>, width: Option<i64>, height: Option<i64>, caption: Option<&str>, parse_mode: Option<&str>, caption_entities: Option<Vec<MessageEntity>>, supports_streaming: Option<bool>, thumbnail: Option<InputFile>, has_spoiler: Option<bool>, show_caption_above_media: Option<bool>, cover: Option<InputFile>, start_timestamp: Option<i64>, disable_notification: Option<bool>, protect_content: Option<bool>, reply_parameters: Option<ReplyParameters>, reply_markup: Option<Value>, message_thread_id: Option<i64>, business_connection_id: Option<&str>, message_effect_id: Option<&str>, allow_paid_broadcast: Option<bool>, direct_messages_topic_id: Option<i64>, suggested_post_parameters: Option<SuggestedPostParameters>, ) -> Result<Message, TelegramError>

Sends a video file. Internal raw method used by builder APIs.

Calls the Telegram sendVideo API method.

Source

pub async fn send_animation_raw( &self, chat_id: ChatId, animation: InputFile, duration: Option<i64>, width: Option<i64>, height: Option<i64>, caption: Option<&str>, parse_mode: Option<&str>, caption_entities: Option<Vec<MessageEntity>>, thumbnail: Option<InputFile>, has_spoiler: Option<bool>, show_caption_above_media: Option<bool>, disable_notification: Option<bool>, protect_content: Option<bool>, reply_parameters: Option<ReplyParameters>, reply_markup: Option<Value>, message_thread_id: Option<i64>, business_connection_id: Option<&str>, message_effect_id: Option<&str>, allow_paid_broadcast: Option<bool>, direct_messages_topic_id: Option<i64>, suggested_post_parameters: Option<SuggestedPostParameters>, ) -> Result<Message, TelegramError>

Sends an animation (GIF or H.264/MPEG-4 AVC video without sound). Internal raw method.

Calls the Telegram sendAnimation API method.

Source

pub async fn send_voice_raw( &self, chat_id: ChatId, voice: InputFile, caption: Option<&str>, parse_mode: Option<&str>, caption_entities: Option<Vec<MessageEntity>>, duration: Option<i64>, disable_notification: Option<bool>, protect_content: Option<bool>, reply_parameters: Option<ReplyParameters>, reply_markup: Option<Value>, message_thread_id: Option<i64>, business_connection_id: Option<&str>, message_effect_id: Option<&str>, allow_paid_broadcast: Option<bool>, direct_messages_topic_id: Option<i64>, suggested_post_parameters: Option<SuggestedPostParameters>, ) -> Result<Message, TelegramError>

Sends a voice message. Internal raw method used by builder APIs.

Calls the Telegram sendVoice API method.

Source

pub async fn send_video_note_raw( &self, chat_id: ChatId, video_note: InputFile, duration: Option<i64>, length: Option<i64>, thumbnail: Option<InputFile>, disable_notification: Option<bool>, protect_content: Option<bool>, reply_parameters: Option<ReplyParameters>, reply_markup: Option<Value>, message_thread_id: Option<i64>, business_connection_id: Option<&str>, message_effect_id: Option<&str>, allow_paid_broadcast: Option<bool>, direct_messages_topic_id: Option<i64>, suggested_post_parameters: Option<SuggestedPostParameters>, ) -> Result<Message, TelegramError>

Sends a video note (rounded square video). Internal raw method used by builder APIs.

Calls the Telegram sendVideoNote API method.

Source

pub async fn send_media_group_raw( &self, chat_id: ChatId, media: Vec<Value>, disable_notification: Option<bool>, protect_content: Option<bool>, message_thread_id: Option<i64>, reply_parameters: Option<ReplyParameters>, business_connection_id: Option<&str>, message_effect_id: Option<&str>, allow_paid_broadcast: Option<bool>, direct_messages_topic_id: Option<i64>, suggested_post_parameters: Option<SuggestedPostParameters>, ) -> Result<Vec<Message>, TelegramError>

Use this method to send a group of photos, videos, documents or audios as an album.

Calls the Telegram sendMediaGroup API method.

Source

pub async fn send_paid_media_raw( &self, chat_id: ChatId, star_count: i64, media: Vec<Value>, caption: Option<&str>, parse_mode: Option<&str>, caption_entities: Option<Vec<MessageEntity>>, show_caption_above_media: Option<bool>, disable_notification: Option<bool>, protect_content: Option<bool>, reply_parameters: Option<ReplyParameters>, reply_markup: Option<Value>, business_connection_id: Option<&str>, payload: Option<&str>, allow_paid_broadcast: Option<bool>, direct_messages_topic_id: Option<i64>, suggested_post_parameters: Option<SuggestedPostParameters>, message_thread_id: Option<i64>, ) -> Result<Message, TelegramError>

Use this method to send paid media.

Calls the Telegram sendPaidMedia API method.

Source

pub async fn send_location_raw( &self, chat_id: ChatId, 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_parameters: Option<ReplyParameters>, reply_markup: Option<Value>, message_thread_id: Option<i64>, business_connection_id: Option<&str>, message_effect_id: Option<&str>, allow_paid_broadcast: Option<bool>, direct_messages_topic_id: Option<i64>, suggested_post_parameters: Option<SuggestedPostParameters>, ) -> Result<Message, TelegramError>

Sends a point on the map. Internal raw method used by builder APIs.

Calls the Telegram sendLocation API method.

Source

pub async fn send_venue_raw( &self, chat_id: ChatId, latitude: f64, longitude: f64, title: &str, address: &str, foursquare_id: Option<&str>, foursquare_type: Option<&str>, google_place_id: Option<&str>, google_place_type: Option<&str>, disable_notification: Option<bool>, protect_content: Option<bool>, reply_parameters: Option<ReplyParameters>, reply_markup: Option<Value>, message_thread_id: Option<i64>, business_connection_id: Option<&str>, message_effect_id: Option<&str>, allow_paid_broadcast: Option<bool>, direct_messages_topic_id: Option<i64>, suggested_post_parameters: Option<SuggestedPostParameters>, ) -> Result<Message, TelegramError>

Sends information about a venue. Internal raw method used by builder APIs.

Calls the Telegram sendVenue API method.

Source

pub async fn send_contact_raw( &self, chat_id: ChatId, phone_number: &str, first_name: &str, last_name: Option<&str>, vcard: Option<&str>, disable_notification: Option<bool>, protect_content: Option<bool>, reply_parameters: Option<ReplyParameters>, reply_markup: Option<Value>, message_thread_id: Option<i64>, business_connection_id: Option<&str>, message_effect_id: Option<&str>, allow_paid_broadcast: Option<bool>, direct_messages_topic_id: Option<i64>, suggested_post_parameters: Option<SuggestedPostParameters>, ) -> Result<Message, TelegramError>

Sends phone contacts. Internal raw method used by builder APIs.

Calls the Telegram sendContact API method.

Source

pub async fn send_poll_raw( &self, chat_id: ChatId, question: &str, options: Vec<Value>, is_anonymous: Option<bool>, poll_type: Option<&str>, allows_multiple_answers: Option<bool>, correct_option_id: Option<i64>, explanation: Option<&str>, explanation_parse_mode: Option<&str>, explanation_entities: Option<Vec<MessageEntity>>, open_period: Option<i64>, close_date: Option<i64>, is_closed: Option<bool>, disable_notification: Option<bool>, protect_content: Option<bool>, reply_parameters: Option<ReplyParameters>, reply_markup: Option<Value>, message_thread_id: Option<i64>, business_connection_id: Option<&str>, question_parse_mode: Option<&str>, question_entities: Option<Vec<MessageEntity>>, message_effect_id: Option<&str>, allow_paid_broadcast: Option<bool>, direct_messages_topic_id: Option<i64>, suggested_post_parameters: Option<SuggestedPostParameters>, ) -> Result<Message, TelegramError>

Sends a native poll. Internal raw method used by builder APIs.

Calls the Telegram sendPoll API method.

Source

pub async fn send_dice_raw( &self, chat_id: ChatId, emoji: Option<&str>, disable_notification: Option<bool>, protect_content: Option<bool>, reply_parameters: Option<ReplyParameters>, reply_markup: Option<Value>, message_thread_id: Option<i64>, business_connection_id: Option<&str>, message_effect_id: Option<&str>, allow_paid_broadcast: Option<bool>, direct_messages_topic_id: Option<i64>, suggested_post_parameters: Option<SuggestedPostParameters>, ) -> Result<Message, TelegramError>

Sends an animated emoji that will display a random value. Internal raw method.

Calls the Telegram sendDice API method.

Source

pub async fn send_chat_action_raw( &self, chat_id: ChatId, action: &str, message_thread_id: Option<i64>, business_connection_id: Option<&str>, ) -> Result<bool, TelegramError>

Tells the user that something is happening on the bot’s side. Internal raw method.

Calls the Telegram sendChatAction API method.

Source

pub async fn send_checklist_raw( &self, business_connection_id: &str, chat_id: i64, checklist: InputChecklist, disable_notification: Option<bool>, protect_content: Option<bool>, message_effect_id: Option<&str>, reply_parameters: Option<ReplyParameters>, reply_markup: Option<Value>, ) -> Result<Message, TelegramError>

Use this method to send a checklist message on behalf of a business account.

Calls the Telegram sendChecklist API method.

Source

pub async fn set_passport_data_errors_raw( &self, user_id: i64, errors: Vec<Value>, ) -> Result<bool, TelegramError>

Use this method to inform a user that some of the Telegram Passport elements contain errors.

Calls the Telegram setPassportDataErrors API method.

Source

pub async fn send_invoice_raw( &self, chat_id: ChatId, title: &str, description: &str, payload: &str, currency: &str, prices: Vec<Value>, provider_token: Option<&str>, max_tip_amount: Option<i64>, suggested_tip_amounts: Option<Vec<i64>>, start_parameter: Option<&str>, provider_data: Option<&str>, photo_url: Option<&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_parameters: Option<ReplyParameters>, reply_markup: Option<Value>, message_thread_id: Option<i64>, message_effect_id: Option<&str>, allow_paid_broadcast: Option<bool>, direct_messages_topic_id: Option<i64>, suggested_post_parameters: Option<SuggestedPostParameters>, ) -> Result<Message, TelegramError>

Sends an invoice. Internal raw method used by builder APIs.

Calls the Telegram sendInvoice API method.

Use this method to create a link for an invoice.

Calls the Telegram createInvoiceLink API method.

Source

pub async fn answer_shipping_query_raw( &self, shipping_query_id: &str, ok: bool, shipping_options: Option<Vec<Value>>, error_message: Option<&str>, ) -> Result<bool, TelegramError>

Answers a shipping query. Internal raw method.

Calls the Telegram answerShippingQuery API method.

Source

pub async fn answer_pre_checkout_query_raw( &self, pre_checkout_query_id: &str, ok: bool, error_message: Option<&str>, ) -> Result<bool, TelegramError>

Answers a pre-checkout query. Internal raw method.

Calls the Telegram answerPreCheckoutQuery API method.

Source

pub async fn refund_star_payment_raw( &self, user_id: i64, telegram_payment_charge_id: &str, ) -> Result<bool, TelegramError>

Use this method to refund a successful payment in Telegram Stars.

Calls the Telegram refundStarPayment API method.

Source

pub async fn get_star_transactions_raw( &self, offset: Option<i64>, limit: Option<i64>, ) -> Result<StarTransactions, TelegramError>

Use this method to get the bot’s Telegram Star transactions.

Calls the Telegram getStarTransactions API method.

Source

pub async fn edit_user_star_subscription_raw( &self, user_id: i64, telegram_payment_charge_id: &str, is_canceled: bool, ) -> Result<bool, TelegramError>

Use this method to allow or disallow the user to create Telegram Star subscriptions.

Calls the Telegram editUserStarSubscription API method.

Source

pub async fn get_my_star_balance_raw(&self) -> Result<StarAmount, TelegramError>

Use this method to get the bot’s current Telegram Star balance.

Calls the Telegram getMyStarBalance API method.

Source

pub async fn set_message_reaction_raw( &self, chat_id: ChatId, message_id: i64, reaction: Option<Vec<Value>>, is_big: Option<bool>, ) -> Result<bool, TelegramError>

Use this method to change the chosen reactions on a message.

Calls the Telegram setMessageReaction API method.

Source

pub async fn get_user_chat_boosts_raw( &self, chat_id: ChatId, user_id: i64, ) -> Result<UserChatBoosts, TelegramError>

Use this method to get the list of boosts added to a chat by a user.

Calls the Telegram getUserChatBoosts API method.

Source

pub async fn send_sticker_raw( &self, chat_id: ChatId, sticker: InputFile, emoji: Option<&str>, disable_notification: Option<bool>, protect_content: Option<bool>, reply_parameters: Option<ReplyParameters>, reply_markup: Option<Value>, message_thread_id: Option<i64>, business_connection_id: Option<&str>, message_effect_id: Option<&str>, allow_paid_broadcast: Option<bool>, direct_messages_topic_id: Option<i64>, suggested_post_parameters: Option<SuggestedPostParameters>, ) -> Result<Message, TelegramError>

Sends a sticker. Internal raw method used by builder APIs.

Calls the Telegram sendSticker API method.

Source

pub async fn get_sticker_set_raw( &self, name: &str, ) -> Result<StickerSet, TelegramError>

Use this method to get a sticker set by name.

Calls the Telegram getStickerSet API method.

Source

pub async fn get_custom_emoji_stickers_raw( &self, custom_emoji_ids: Vec<String>, ) -> Result<Vec<Sticker>, TelegramError>

Use this method to get information about custom emoji stickers by their identifiers.

Calls the Telegram getCustomEmojiStickers API method.

Source

pub async fn upload_sticker_file_raw( &self, user_id: i64, sticker: InputFile, sticker_format: &str, ) -> Result<File, TelegramError>

Use this method to upload a sticker file for later use in sticker sets.

Calls the Telegram uploadStickerFile API method.

Source

pub async fn create_new_sticker_set_raw( &self, user_id: i64, name: &str, title: &str, stickers: Vec<Value>, sticker_type: Option<&str>, needs_repainting: Option<bool>, ) -> Result<bool, TelegramError>

Use this method to create a new sticker set owned by a user.

Calls the Telegram createNewStickerSet API method.

Source

pub async fn add_sticker_to_set_raw( &self, user_id: i64, name: &str, sticker: Value, ) -> Result<bool, TelegramError>

Use this method to add a new sticker to an existing sticker set.

Calls the Telegram addStickerToSet API method.

Source

pub async fn set_sticker_position_in_set_raw( &self, sticker: &str, position: i64, ) -> Result<bool, TelegramError>

Use this method to move a sticker in a set to a specific position.

Calls the Telegram setStickerPositionInSet API method.

Source

pub async fn delete_sticker_from_set_raw( &self, sticker: &str, ) -> Result<bool, TelegramError>

Use this method to delete a sticker from a set.

Calls the Telegram deleteStickerFromSet API method.

Source

pub async fn replace_sticker_in_set_raw( &self, user_id: i64, name: &str, old_sticker: &str, sticker: Value, ) -> Result<bool, TelegramError>

Use this method to replace an existing sticker in a sticker set with a new one.

Calls the Telegram replaceStickerInSet API method.

Source

pub async fn set_sticker_emoji_list_raw( &self, sticker: &str, emoji_list: Vec<String>, ) -> Result<bool, TelegramError>

Use this method to change the list of emoji assigned to a regular or custom emoji sticker.

Calls the Telegram setStickerEmojiList API method.

Source

pub async fn set_sticker_keywords_raw( &self, sticker: &str, keywords: Option<Vec<String>>, ) -> Result<bool, TelegramError>

Use this method to change search keywords assigned to a regular or custom emoji sticker.

Calls the Telegram setStickerKeywords API method.

Source

pub async fn set_sticker_mask_position_raw( &self, sticker: &str, mask_position: Option<MaskPosition>, ) -> Result<bool, TelegramError>

Use this method to change the mask position of a mask sticker.

Calls the Telegram setStickerMaskPosition API method.

Source

pub async fn set_sticker_set_thumbnail_raw( &self, name: &str, user_id: i64, format: &str, thumbnail: Option<InputFile>, ) -> Result<bool, TelegramError>

Use this method to set the thumbnail of a regular or mask sticker set.

Calls the Telegram setStickerSetThumbnail API method.

Source

pub async fn set_sticker_set_title_raw( &self, name: &str, title: &str, ) -> Result<bool, TelegramError>

Use this method to set the title of a created sticker set.

Calls the Telegram setStickerSetTitle API method.

Source

pub async fn set_custom_emoji_sticker_set_thumbnail_raw( &self, name: &str, custom_emoji_id: Option<&str>, ) -> Result<bool, TelegramError>

Use this method to set the thumbnail of a custom emoji sticker set.

Calls the Telegram setCustomEmojiStickerSetThumbnail API method.

Source

pub async fn delete_sticker_set_raw( &self, name: &str, ) -> Result<bool, TelegramError>

Use this method to delete a sticker set that was created by the bot.

Calls the Telegram deleteStickerSet API method.

Source

pub async fn get_forum_topic_icon_stickers_raw( &self, ) -> Result<Vec<Sticker>, TelegramError>

Use this method to get custom emoji stickers which can be used as a forum topic icon.

Calls the Telegram getForumTopicIconStickers API method.

Source

pub async fn post_story_raw( &self, business_connection_id: &str, content: Value, active_period: i64, caption: Option<&str>, parse_mode: Option<&str>, caption_entities: Option<Vec<MessageEntity>>, areas: Option<Vec<Value>>, post_to_chat_page: Option<bool>, protect_content: Option<bool>, ) -> Result<Story, TelegramError>

Use this method to post a story on behalf of a managed business account.

Calls the Telegram postStory API method.

Source

pub async fn edit_story_raw( &self, business_connection_id: &str, story_id: i64, content: Value, caption: Option<&str>, parse_mode: Option<&str>, caption_entities: Option<Vec<MessageEntity>>, areas: Option<Vec<Value>>, ) -> Result<Story, TelegramError>

Use this method to edit a story posted on behalf of a managed business account.

Calls the Telegram editStory API method.

Source

pub async fn delete_story_raw( &self, business_connection_id: &str, story_id: i64, ) -> Result<bool, TelegramError>

Use this method to delete a story posted on behalf of a managed business account.

Calls the Telegram deleteStory API method.

Source

pub async fn repost_story_raw( &self, business_connection_id: &str, from_chat_id: i64, from_story_id: i64, active_period: i64, post_to_chat_page: Option<bool>, protect_content: Option<bool>, ) -> Result<Story, TelegramError>

Use this method to repost a story on behalf of a managed business account.

Calls the Telegram repostStory API method.

Source

pub async fn approve_suggested_post_raw( &self, chat_id: i64, message_id: i64, send_date: Option<i64>, ) -> Result<bool, TelegramError>

Use this method to approve a suggested post in a channel managed by the bot.

Calls the Telegram approveSuggestedPost API method.

Source

pub async fn decline_suggested_post_raw( &self, chat_id: i64, message_id: i64, comment: Option<&str>, ) -> Result<bool, TelegramError>

Use this method to decline a suggested post in a channel managed by the bot.

Calls the Telegram declineSuggestedPost API method.

Source

pub async fn get_user_profile_photos_raw( &self, user_id: i64, offset: Option<i64>, limit: Option<i64>, ) -> Result<UserProfilePhotos, TelegramError>

Use this method to get a list of profile pictures for a user.

Calls the Telegram getUserProfilePhotos API method.

Source

pub async fn get_user_profile_audios_raw( &self, user_id: i64, offset: Option<i64>, limit: Option<i64>, ) -> Result<UserProfileAudios, TelegramError>

Use this method to get a list of profile audios for a user.

Calls the Telegram getUserProfileAudios API method.

Source

pub async fn set_user_emoji_status_raw( &self, user_id: i64, emoji_status_custom_emoji_id: Option<&str>, emoji_status_expiration_date: Option<i64>, ) -> Result<bool, TelegramError>

Use this method to change the emoji status for a given user.

Calls the Telegram setUserEmojiStatus API method.

Source

pub async fn set_my_profile_photo_raw( &self, photo: Value, ) -> Result<bool, TelegramError>

Use this method to set the bot’s profile photo.

Calls the Telegram setMyProfilePhoto API method.

Source

pub async fn remove_my_profile_photo_raw(&self) -> Result<bool, TelegramError>

Use this method to remove the bot’s profile photo.

Calls the Telegram removeMyProfilePhoto API method.

Source

pub async fn get_file_raw(&self, file_id: &str) -> Result<File, TelegramError>

Gets basic info about a file and prepares it for downloading. Internal raw method used by builder APIs.

Calls the Telegram getFile API method.

Source

pub async fn verify_chat_raw( &self, chat_id: ChatId, custom_description: Option<&str>, ) -> Result<bool, TelegramError>

Use this method to verify a chat on behalf of the organization that the bot represents.

Calls the Telegram verifyChat API method.

Source

pub async fn verify_user_raw( &self, user_id: i64, custom_description: Option<&str>, ) -> Result<bool, TelegramError>

Use this method to verify a user on behalf of the organization that the bot represents.

Calls the Telegram verifyUser API method.

Source

pub async fn remove_chat_verification_raw( &self, chat_id: ChatId, ) -> Result<bool, TelegramError>

Use this method to remove verification from a chat.

Calls the Telegram removeChatVerification API method.

Source

pub async fn remove_user_verification_raw( &self, user_id: i64, ) -> Result<bool, TelegramError>

Use this method to remove verification from a user.

Calls the Telegram removeUserVerification API method.

Source

pub fn send_message( &self, chat_id: impl Into<ChatId>, text: impl Into<String>, ) -> SendMessageBuilder<'_>

Build a sendMessage request.

Source

pub fn send_photo( &self, chat_id: impl Into<ChatId>, photo: InputFile, ) -> SendPhotoBuilder<'_>

Build a sendPhoto request.

Source

pub fn send_document( &self, chat_id: impl Into<ChatId>, document: InputFile, ) -> SendDocumentBuilder<'_>

Build a sendDocument request.

Source

pub fn send_video( &self, chat_id: impl Into<ChatId>, video: InputFile, ) -> SendVideoBuilder<'_>

Build a sendVideo request.

Source

pub fn send_audio( &self, chat_id: impl Into<ChatId>, audio: InputFile, ) -> SendAudioBuilder<'_>

Build a sendAudio request.

Source

pub fn send_animation( &self, chat_id: impl Into<ChatId>, animation: InputFile, ) -> SendAnimationBuilder<'_>

Build a sendAnimation request.

Source

pub fn send_voice( &self, chat_id: impl Into<ChatId>, voice: InputFile, ) -> SendVoiceBuilder<'_>

Build a sendVoice request.

Source

pub fn send_video_note( &self, chat_id: impl Into<ChatId>, video_note: InputFile, ) -> SendVideoNoteBuilder<'_>

Build a sendVideoNote request.

Source

pub fn send_location( &self, chat_id: impl Into<ChatId>, latitude: f64, longitude: f64, ) -> SendLocationBuilder<'_>

Build a sendLocation request.

Source

pub fn send_venue( &self, chat_id: impl Into<ChatId>, latitude: f64, longitude: f64, title: impl Into<String>, address: impl Into<String>, ) -> SendVenueBuilder<'_>

Build a sendVenue request.

Source

pub fn send_contact( &self, chat_id: impl Into<ChatId>, phone_number: impl Into<String>, first_name: impl Into<String>, ) -> SendContactBuilder<'_>

Build a sendContact request.

Source

pub fn send_poll( &self, chat_id: impl Into<ChatId>, question: impl Into<String>, options: Vec<Value>, ) -> SendPollBuilder<'_>

Build a sendPoll request.

Source

pub fn send_dice(&self, chat_id: impl Into<ChatId>) -> SendDiceBuilder<'_>

Build a sendDice request.

Source

pub fn send_sticker( &self, chat_id: impl Into<ChatId>, sticker: InputFile, ) -> SendStickerBuilder<'_>

Build a sendSticker request.

Source

pub fn edit_message_text( &self, text: impl Into<String>, ) -> EditMessageTextBuilder<'_>

Build an editMessageText request.

Source

pub fn edit_message_caption(&self) -> EditMessageCaptionBuilder<'_>

Build an editMessageCaption request.

Source

pub fn edit_message_media(&self, media: Value) -> EditMessageMediaBuilder<'_>

Build an editMessageMedia request.

Source

pub fn edit_message_reply_markup(&self) -> EditMessageReplyMarkupBuilder<'_>

Build an editMessageReplyMarkup request.

Source

pub fn answer_callback_query( &self, callback_query_id: impl Into<String>, ) -> AnswerCallbackQueryBuilder<'_>

Build an answerCallbackQuery request.

Source

pub fn answer_inline_query( &self, inline_query_id: impl Into<String>, results: Vec<Value>, ) -> AnswerInlineQueryBuilder<'_>

Build an answerInlineQuery request.

Source

pub fn set_webhook(&self, url: impl Into<String>) -> SetWebhookBuilder<'_>

Build a setWebhook request.

Source

pub fn delete_webhook(&self) -> DeleteWebhookBuilder<'_>

Build a deleteWebhook request.

Source

pub fn get_file(&self, file_id: impl Into<String>) -> GetFileBuilder<'_>

Build a getFile request.

Source

pub fn send_invoice( &self, chat_id: impl Into<ChatId>, title: impl Into<String>, description: impl Into<String>, payload: impl Into<String>, currency: impl Into<String>, prices: Vec<Value>, ) -> SendInvoiceBuilder<'_>

Build a sendInvoice request.

Source

pub fn answer_shipping_query( &self, shipping_query_id: impl Into<String>, ok: bool, ) -> AnswerShippingQueryBuilder<'_>

Build an answerShippingQuery request.

Source

pub fn answer_pre_checkout_query( &self, pre_checkout_query_id: impl Into<String>, ok: bool, ) -> AnswerPreCheckoutQueryBuilder<'_>

Build an answerPreCheckoutQuery request.

Source

pub fn get_managed_bot_token( &self, bot_user_id: i64, ) -> GetManagedBotTokenBuilder<'_>

Build a getManagedBotToken request.

Source

pub fn replace_managed_bot_token( &self, bot_user_id: i64, ) -> ReplaceManagedBotTokenBuilder<'_>

Build a replaceManagedBotToken request.

Source

pub fn save_prepared_keyboard_button( &self, user_id: i64, button: InlineKeyboardButton, ) -> SavePreparedKeyboardButtonBuilder<'_>

Build a savePreparedKeyboardButton request.

Source

pub fn send_chat_action( &self, chat_id: impl Into<ChatId>, action: impl Into<String>, ) -> SendChatActionBuilder<'_>

Build a sendChatAction request.

Source

pub fn copy_message( &self, chat_id: impl Into<ChatId>, from_chat_id: impl Into<ChatId>, message_id: i64, ) -> CopyMessageBuilder<'_>

Build a copyMessage request.

Source

pub fn copy_messages( &self, chat_id: impl Into<ChatId>, from_chat_id: impl Into<ChatId>, message_ids: Vec<i64>, ) -> CopyMessagesBuilder<'_>

Build a copyMessages request.

Source

pub fn delete_message( &self, chat_id: impl Into<ChatId>, message_id: i64, ) -> DeleteMessageBuilder<'_>

Build a deleteMessage request.

Source

pub fn delete_messages( &self, chat_id: impl Into<ChatId>, message_ids: Vec<i64>, ) -> DeleteMessagesBuilder<'_>

Build a deleteMessages request.

Source

pub fn forward_message( &self, chat_id: impl Into<ChatId>, from_chat_id: impl Into<ChatId>, message_id: i64, ) -> ForwardMessageBuilder<'_>

Build a forwardMessage request.

Source

pub fn forward_messages( &self, chat_id: impl Into<ChatId>, from_chat_id: impl Into<ChatId>, message_ids: Vec<i64>, ) -> ForwardMessagesBuilder<'_>

Build a forwardMessages request.

Source

pub fn send_message_draft( &self, chat_id: i64, draft_id: i64, text: impl Into<String>, ) -> SendMessageDraftBuilder<'_>

Build a sendMessageDraft request.

Source

pub fn leave_chat(&self, chat_id: impl Into<ChatId>) -> LeaveChatBuilder<'_>

Build a leaveChat request.

Source

pub fn get_chat(&self, chat_id: impl Into<ChatId>) -> GetChatBuilder<'_>

Build a getChat request.

Source

pub fn get_chat_administrators( &self, chat_id: impl Into<ChatId>, ) -> GetChatAdministratorsBuilder<'_>

Build a getChatAdministrators request.

Source

pub fn get_chat_member_count( &self, chat_id: impl Into<ChatId>, ) -> GetChatMemberCountBuilder<'_>

Build a getChatMemberCount request.

Source

pub fn get_chat_member( &self, chat_id: impl Into<ChatId>, user_id: i64, ) -> GetChatMemberBuilder<'_>

Build a getChatMember request.

Source

pub fn ban_chat_member( &self, chat_id: impl Into<ChatId>, user_id: i64, ) -> BanChatMemberBuilder<'_>

Build a banChatMember request.

Source

pub fn unban_chat_member( &self, chat_id: impl Into<ChatId>, user_id: i64, ) -> UnbanChatMemberBuilder<'_>

Build an unbanChatMember request.

Source

pub fn ban_chat_sender_chat( &self, chat_id: impl Into<ChatId>, sender_chat_id: i64, ) -> BanChatSenderChatBuilder<'_>

Build a banChatSenderChat request.

Source

pub fn unban_chat_sender_chat( &self, chat_id: impl Into<ChatId>, sender_chat_id: i64, ) -> UnbanChatSenderChatBuilder<'_>

Build an unbanChatSenderChat request.

Source

pub fn restrict_chat_member( &self, chat_id: impl Into<ChatId>, user_id: i64, permissions: ChatPermissions, ) -> RestrictChatMemberBuilder<'_>

Build a restrictChatMember request.

Source

pub fn promote_chat_member( &self, chat_id: impl Into<ChatId>, user_id: i64, ) -> PromoteChatMemberBuilder<'_>

Build a promoteChatMember request.

Source

pub fn set_chat_administrator_custom_title( &self, chat_id: impl Into<ChatId>, user_id: i64, custom_title: impl Into<String>, ) -> SetChatAdministratorCustomTitleBuilder<'_>

Build a setChatAdministratorCustomTitle request.

Source

pub fn set_chat_permissions( &self, chat_id: impl Into<ChatId>, permissions: ChatPermissions, ) -> SetChatPermissionsBuilder<'_>

Build a setChatPermissions request.

Source

pub fn set_chat_photo( &self, chat_id: impl Into<ChatId>, photo: InputFile, ) -> SetChatPhotoBuilder<'_>

Build a setChatPhoto request.

Source

pub fn delete_chat_photo( &self, chat_id: impl Into<ChatId>, ) -> DeleteChatPhotoBuilder<'_>

Build a deleteChatPhoto request.

Source

pub fn set_chat_title( &self, chat_id: impl Into<ChatId>, title: impl Into<String>, ) -> SetChatTitleBuilder<'_>

Build a setChatTitle request.

Source

pub fn set_chat_description( &self, chat_id: impl Into<ChatId>, ) -> SetChatDescriptionBuilder<'_>

Build a setChatDescription request.

Source

pub fn set_chat_sticker_set( &self, chat_id: impl Into<ChatId>, sticker_set_name: impl Into<String>, ) -> SetChatStickerSetBuilder<'_>

Build a setChatStickerSet request.

Source

pub fn delete_chat_sticker_set( &self, chat_id: impl Into<ChatId>, ) -> DeleteChatStickerSetBuilder<'_>

Build a deleteChatStickerSet request.

Source

pub fn set_chat_member_tag( &self, chat_id: impl Into<ChatId>, user_id: i64, ) -> SetChatMemberTagBuilder<'_>

Build a setChatMemberTag request.

Source

pub fn pin_chat_message( &self, chat_id: impl Into<ChatId>, message_id: i64, ) -> PinChatMessageBuilder<'_>

Build a pinChatMessage request.

Source

pub fn unpin_chat_message( &self, chat_id: impl Into<ChatId>, ) -> UnpinChatMessageBuilder<'_>

Build an unpinChatMessage request.

Source

pub fn unpin_all_chat_messages( &self, chat_id: impl Into<ChatId>, ) -> UnpinAllChatMessagesBuilder<'_>

Build an unpinAllChatMessages request.

Build an exportChatInviteLink request.

Build a createChatInviteLink request.

Build an editChatInviteLink request.

Build a revokeChatInviteLink request.

Build a createChatSubscriptionInviteLink request.

Build an editChatSubscriptionInviteLink request.

Source

pub fn approve_chat_join_request( &self, chat_id: impl Into<ChatId>, user_id: i64, ) -> ApproveChatJoinRequestBuilder<'_>

Build an approveChatJoinRequest request.

Source

pub fn decline_chat_join_request( &self, chat_id: impl Into<ChatId>, user_id: i64, ) -> DeclineChatJoinRequestBuilder<'_>

Build a declineChatJoinRequest request.

Source

pub fn set_chat_menu_button(&self) -> SetChatMenuButtonBuilder<'_>

Build a setChatMenuButton request.

Source

pub fn get_chat_menu_button(&self) -> GetChatMenuButtonBuilder<'_>

Build a getChatMenuButton request.

Source

pub fn set_my_commands( &self, commands: Vec<BotCommand>, ) -> SetMyCommandsBuilder<'_>

Build a setMyCommands request.

Source

pub fn get_my_commands(&self) -> GetMyCommandsBuilder<'_>

Build a getMyCommands request.

Source

pub fn delete_my_commands(&self) -> DeleteMyCommandsBuilder<'_>

Build a deleteMyCommands request.

Source

pub fn set_my_default_administrator_rights( &self, ) -> SetMyDefaultAdministratorRightsBuilder<'_>

Build a setMyDefaultAdministratorRights request.

Source

pub fn get_my_default_administrator_rights( &self, ) -> GetMyDefaultAdministratorRightsBuilder<'_>

Build a getMyDefaultAdministratorRights request.

Source

pub fn set_my_description(&self) -> SetMyDescriptionBuilder<'_>

Build a setMyDescription request.

Source

pub fn get_my_description(&self) -> GetMyDescriptionBuilder<'_>

Build a getMyDescription request.

Source

pub fn set_my_short_description(&self) -> SetMyShortDescriptionBuilder<'_>

Build a setMyShortDescription request.

Source

pub fn get_my_short_description(&self) -> GetMyShortDescriptionBuilder<'_>

Build a getMyShortDescription request.

Source

pub fn set_my_name(&self) -> SetMyNameBuilder<'_>

Build a setMyName request.

Source

pub fn get_my_name(&self) -> GetMyNameBuilder<'_>

Build a getMyName request.

Source

pub fn create_forum_topic( &self, chat_id: impl Into<ChatId>, name: impl Into<String>, ) -> CreateForumTopicBuilder<'_>

Build a createForumTopic request.

Source

pub fn edit_forum_topic( &self, chat_id: impl Into<ChatId>, message_thread_id: i64, ) -> EditForumTopicBuilder<'_>

Build an editForumTopic request.

Source

pub fn close_forum_topic( &self, chat_id: impl Into<ChatId>, message_thread_id: i64, ) -> CloseForumTopicBuilder<'_>

Build a closeForumTopic request.

Source

pub fn reopen_forum_topic( &self, chat_id: impl Into<ChatId>, message_thread_id: i64, ) -> ReopenForumTopicBuilder<'_>

Build a reopenForumTopic request.

Source

pub fn delete_forum_topic( &self, chat_id: impl Into<ChatId>, message_thread_id: i64, ) -> DeleteForumTopicBuilder<'_>

Build a deleteForumTopic request.

Source

pub fn unpin_all_forum_topic_messages( &self, chat_id: impl Into<ChatId>, message_thread_id: i64, ) -> UnpinAllForumTopicMessagesBuilder<'_>

Build an unpinAllForumTopicMessages request.

Source

pub fn unpin_all_general_forum_topic_messages( &self, chat_id: impl Into<ChatId>, ) -> UnpinAllGeneralForumTopicMessagesBuilder<'_>

Build an unpinAllGeneralForumTopicMessages request.

Source

pub fn edit_general_forum_topic( &self, chat_id: impl Into<ChatId>, name: impl Into<String>, ) -> EditGeneralForumTopicBuilder<'_>

Build an editGeneralForumTopic request.

Source

pub fn close_general_forum_topic( &self, chat_id: impl Into<ChatId>, ) -> CloseGeneralForumTopicBuilder<'_>

Build a closeGeneralForumTopic request.

Source

pub fn reopen_general_forum_topic( &self, chat_id: impl Into<ChatId>, ) -> ReopenGeneralForumTopicBuilder<'_>

Build a reopenGeneralForumTopic request.

Source

pub fn hide_general_forum_topic( &self, chat_id: impl Into<ChatId>, ) -> HideGeneralForumTopicBuilder<'_>

Build a hideGeneralForumTopic request.

Source

pub fn unhide_general_forum_topic( &self, chat_id: impl Into<ChatId>, ) -> UnhideGeneralForumTopicBuilder<'_>

Build an unhideGeneralForumTopic request.

Source

pub fn get_sticker_set( &self, name: impl Into<String>, ) -> GetStickerSetBuilder<'_>

Build a getStickerSet request.

Source

pub fn get_custom_emoji_stickers( &self, custom_emoji_ids: Vec<String>, ) -> GetCustomEmojiStickersBuilder<'_>

Build a getCustomEmojiStickers request.

Source

pub fn upload_sticker_file( &self, user_id: i64, sticker: InputFile, sticker_format: impl Into<String>, ) -> UploadStickerFileBuilder<'_>

Build an uploadStickerFile request.

Source

pub fn create_new_sticker_set( &self, user_id: i64, name: impl Into<String>, title: impl Into<String>, stickers: Vec<Value>, ) -> CreateNewStickerSetBuilder<'_>

Build a createNewStickerSet request.

Source

pub fn add_sticker_to_set( &self, user_id: i64, name: impl Into<String>, sticker: Value, ) -> AddStickerToSetBuilder<'_>

Build an addStickerToSet request.

Source

pub fn set_sticker_position_in_set( &self, sticker: impl Into<String>, position: i64, ) -> SetStickerPositionInSetBuilder<'_>

Build a setStickerPositionInSet request.

Source

pub fn delete_sticker_from_set( &self, sticker: impl Into<String>, ) -> DeleteStickerFromSetBuilder<'_>

Build a deleteStickerFromSet request.

Source

pub fn replace_sticker_in_set( &self, user_id: i64, name: impl Into<String>, old_sticker: impl Into<String>, sticker: Value, ) -> ReplaceStickerInSetBuilder<'_>

Build a replaceStickerInSet request.

Source

pub fn set_sticker_emoji_list( &self, sticker: impl Into<String>, emoji_list: Vec<String>, ) -> SetStickerEmojiListBuilder<'_>

Build a setStickerEmojiList request.

Source

pub fn set_sticker_keywords( &self, sticker: impl Into<String>, ) -> SetStickerKeywordsBuilder<'_>

Build a setStickerKeywords request.

Source

pub fn set_sticker_mask_position( &self, sticker: impl Into<String>, ) -> SetStickerMaskPositionBuilder<'_>

Build a setStickerMaskPosition request.

Source

pub fn set_sticker_set_thumbnail( &self, name: impl Into<String>, user_id: i64, format: impl Into<String>, ) -> SetStickerSetThumbnailBuilder<'_>

Build a setStickerSetThumbnail request.

Source

pub fn set_sticker_set_title( &self, name: impl Into<String>, title: impl Into<String>, ) -> SetStickerSetTitleBuilder<'_>

Build a setStickerSetTitle request.

Source

pub fn set_custom_emoji_sticker_set_thumbnail( &self, name: impl Into<String>, ) -> SetCustomEmojiStickerSetThumbnailBuilder<'_>

Build a setCustomEmojiStickerSetThumbnail request.

Source

pub fn delete_sticker_set( &self, name: impl Into<String>, ) -> DeleteStickerSetBuilder<'_>

Build a deleteStickerSet request.

Source

pub fn get_forum_topic_icon_stickers( &self, ) -> GetForumTopicIconStickersBuilder<'_>

Build a getForumTopicIconStickers request.

Source

pub fn get_business_connection( &self, business_connection_id: impl Into<String>, ) -> GetBusinessConnectionBuilder<'_>

Build a getBusinessConnection request.

Source

pub fn get_business_account_gifts( &self, business_connection_id: impl Into<String>, ) -> GetBusinessAccountGiftsBuilder<'_>

Build a getBusinessAccountGifts request.

Source

pub fn get_business_account_star_balance( &self, business_connection_id: impl Into<String>, ) -> GetBusinessAccountStarBalanceBuilder<'_>

Build a getBusinessAccountStarBalance request.

Source

pub fn read_business_message( &self, business_connection_id: impl Into<String>, chat_id: i64, message_id: i64, ) -> ReadBusinessMessageBuilder<'_>

Build a readBusinessMessage request.

Source

pub fn delete_business_messages( &self, business_connection_id: impl Into<String>, message_ids: Vec<i64>, ) -> DeleteBusinessMessagesBuilder<'_>

Build a deleteBusinessMessages request.

Source

pub fn set_business_account_name( &self, business_connection_id: impl Into<String>, first_name: impl Into<String>, ) -> SetBusinessAccountNameBuilder<'_>

Build a setBusinessAccountName request.

Source

pub fn set_business_account_username( &self, business_connection_id: impl Into<String>, ) -> SetBusinessAccountUsernameBuilder<'_>

Build a setBusinessAccountUsername request.

Source

pub fn set_business_account_bio( &self, business_connection_id: impl Into<String>, ) -> SetBusinessAccountBioBuilder<'_>

Build a setBusinessAccountBio request.

Source

pub fn set_business_account_gift_settings( &self, business_connection_id: impl Into<String>, show_gift_button: bool, accepted_gift_types: AcceptedGiftTypes, ) -> SetBusinessAccountGiftSettingsBuilder<'_>

Build a setBusinessAccountGiftSettings request.

Source

pub fn set_business_account_profile_photo( &self, business_connection_id: impl Into<String>, photo: Value, ) -> SetBusinessAccountProfilePhotoBuilder<'_>

Build a setBusinessAccountProfilePhoto request.

Source

pub fn remove_business_account_profile_photo( &self, business_connection_id: impl Into<String>, ) -> RemoveBusinessAccountProfilePhotoBuilder<'_>

Build a removeBusinessAccountProfilePhoto request.

Source

pub fn convert_gift_to_stars( &self, business_connection_id: impl Into<String>, owned_gift_id: impl Into<String>, ) -> ConvertGiftToStarsBuilder<'_>

Build a convertGiftToStars request.

Source

pub fn upgrade_gift( &self, business_connection_id: impl Into<String>, owned_gift_id: impl Into<String>, ) -> UpgradeGiftBuilder<'_>

Build an upgradeGift request.

Source

pub fn transfer_gift( &self, business_connection_id: impl Into<String>, owned_gift_id: impl Into<String>, new_owner_chat_id: i64, ) -> TransferGiftBuilder<'_>

Build a transferGift request.

Source

pub fn transfer_business_account_stars( &self, business_connection_id: impl Into<String>, star_count: i64, ) -> TransferBusinessAccountStarsBuilder<'_>

Build a transferBusinessAccountStars request.

Build a createInvoiceLink request.

Source

pub fn edit_user_star_subscription( &self, user_id: i64, telegram_payment_charge_id: impl Into<String>, is_canceled: bool, ) -> EditUserStarSubscriptionBuilder<'_>

Build an editUserStarSubscription request.

Source

pub fn get_my_star_balance(&self) -> GetMyStarBalanceBuilder<'_>

Build a getMyStarBalance request.

Source

pub fn get_star_transactions(&self) -> GetStarTransactionsBuilder<'_>

Build a getStarTransactions request.

Source

pub fn refund_star_payment( &self, user_id: i64, telegram_payment_charge_id: impl Into<String>, ) -> RefundStarPaymentBuilder<'_>

Build a refundStarPayment request.

Source

pub fn get_available_gifts(&self) -> GetAvailableGiftsBuilder<'_>

Build a getAvailableGifts request.

Source

pub fn send_gift(&self, gift_id: impl Into<String>) -> SendGiftBuilder<'_>

Build a sendGift request.

Source

pub fn gift_premium_subscription( &self, user_id: i64, month_count: i64, star_count: i64, ) -> GiftPremiumSubscriptionBuilder<'_>

Build a giftPremiumSubscription request.

Source

pub fn get_user_gifts(&self, user_id: i64) -> GetUserGiftsBuilder<'_>

Build a getUserGifts request.

Source

pub fn get_chat_gifts( &self, chat_id: impl Into<ChatId>, ) -> GetChatGiftsBuilder<'_>

Build a getChatGifts request.

Source

pub fn edit_message_live_location( &self, latitude: f64, longitude: f64, ) -> EditMessageLiveLocationBuilder<'_>

Build an editMessageLiveLocation request.

Source

pub fn stop_message_live_location(&self) -> StopMessageLiveLocationBuilder<'_>

Build a stopMessageLiveLocation request.

Source

pub fn edit_message_checklist( &self, business_connection_id: impl Into<String>, chat_id: i64, message_id: i64, checklist: InputChecklist, ) -> EditMessageChecklistBuilder<'_>

Build an editMessageChecklist request.

Source

pub fn stop_poll( &self, chat_id: impl Into<ChatId>, message_id: i64, ) -> StopPollBuilder<'_>

Build a stopPoll request.

Source

pub fn send_game( &self, chat_id: i64, game_short_name: impl Into<String>, ) -> SendGameBuilder<'_>

Build a sendGame request.

Source

pub fn set_game_score( &self, user_id: i64, score: i64, ) -> SetGameScoreBuilder<'_>

Build a setGameScore request.

Source

pub fn get_game_high_scores(&self, user_id: i64) -> GetGameHighScoresBuilder<'_>

Build a getGameHighScores request.

Source

pub fn save_prepared_inline_message( &self, user_id: i64, result: Value, ) -> SavePreparedInlineMessageBuilder<'_>

Build a savePreparedInlineMessage request.

Source

pub fn answer_web_app_query( &self, web_app_query_id: impl Into<String>, result: Value, ) -> AnswerWebAppQueryBuilder<'_>

Build an answerWebAppQuery request.

Source

pub fn send_media_group( &self, chat_id: impl Into<ChatId>, media: Vec<Value>, ) -> SendMediaGroupBuilder<'_>

Build a sendMediaGroup request.

Source

pub fn send_paid_media( &self, chat_id: impl Into<ChatId>, star_count: i64, media: Vec<Value>, ) -> SendPaidMediaBuilder<'_>

Build a sendPaidMedia request.

Source

pub fn get_me(&self) -> GetMeBuilder<'_>

Build a getMe request.

Source

pub fn log_out(&self) -> LogOutBuilder<'_>

Build a logOut request.

Source

pub fn close(&self) -> CloseBuilder<'_>

Build a close request.

Source

pub fn get_updates(&self) -> GetUpdatesBuilder<'_>

Build a getUpdates request.

Source

pub fn get_webhook_info(&self) -> GetWebhookInfoBuilder<'_>

Build a getWebhookInfo request.

Source

pub fn download_file( &self, file_path: impl Into<String>, ) -> DownloadFileBuilder<'_>

Build a downloadFile request.

Source

pub fn send_checklist( &self, business_connection_id: impl Into<String>, chat_id: i64, checklist: InputChecklist, ) -> SendChecklistBuilder<'_>

Build a sendChecklist request.

Source

pub fn set_passport_data_errors( &self, user_id: i64, errors: Vec<Value>, ) -> SetPassportDataErrorsBuilder<'_>

Build a setPassportDataErrors request.

Source

pub fn set_message_reaction( &self, chat_id: impl Into<ChatId>, message_id: i64, ) -> SetMessageReactionBuilder<'_>

Build a setMessageReaction request.

Source

pub fn get_user_chat_boosts( &self, chat_id: impl Into<ChatId>, user_id: i64, ) -> GetUserChatBoostsBuilder<'_>

Build a getUserChatBoosts request.

Source

pub fn post_story( &self, business_connection_id: impl Into<String>, content: Value, active_period: i64, ) -> PostStoryBuilder<'_>

Build a postStory request.

Source

pub fn edit_story( &self, business_connection_id: impl Into<String>, story_id: i64, content: Value, ) -> EditStoryBuilder<'_>

Build an editStory request.

Source

pub fn delete_story( &self, business_connection_id: impl Into<String>, story_id: i64, ) -> DeleteStoryBuilder<'_>

Build a deleteStory request.

Source

pub fn repost_story( &self, business_connection_id: impl Into<String>, from_chat_id: i64, from_story_id: i64, active_period: i64, ) -> RepostStoryBuilder<'_>

Build a repostStory request.

Source

pub fn approve_suggested_post( &self, chat_id: i64, message_id: i64, ) -> ApproveSuggestedPostBuilder<'_>

Build an approveSuggestedPost request.

Source

pub fn decline_suggested_post( &self, chat_id: i64, message_id: i64, ) -> DeclineSuggestedPostBuilder<'_>

Build a declineSuggestedPost request.

Source

pub fn get_user_profile_photos( &self, user_id: i64, ) -> GetUserProfilePhotosBuilder<'_>

Build a getUserProfilePhotos request.

Source

pub fn get_user_profile_audios( &self, user_id: i64, ) -> GetUserProfileAudiosBuilder<'_>

Build a getUserProfileAudios request.

Source

pub fn set_user_emoji_status( &self, user_id: i64, ) -> SetUserEmojiStatusBuilder<'_>

Build a setUserEmojiStatus request.

Source

pub fn set_my_profile_photo(&self, photo: Value) -> SetMyProfilePhotoBuilder<'_>

Build a setMyProfilePhoto request.

Source

pub fn remove_my_profile_photo(&self) -> RemoveMyProfilePhotoBuilder<'_>

Build a removeMyProfilePhoto request.

Source

pub fn verify_chat(&self, chat_id: impl Into<ChatId>) -> VerifyChatBuilder<'_>

Build a verifyChat request.

Source

pub fn verify_user(&self, user_id: i64) -> VerifyUserBuilder<'_>

Build a verifyUser request.

Source

pub fn remove_chat_verification( &self, chat_id: impl Into<ChatId>, ) -> RemoveChatVerificationBuilder<'_>

Build a removeChatVerification request.

Source

pub fn remove_user_verification( &self, user_id: i64, ) -> RemoveUserVerificationBuilder<'_>

Build a removeUserVerification request.

Trait Implementations§

Source§

impl Debug for ExtBot

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Deref for ExtBot

Source§

type Target = Bot

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Bot

Dereferences the value.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more