pub struct Bot { /* private fields */ }
Expand description
A Bot
is the entry point to interacting with the Bot API.
Using a Bot
, you can call methods from the methods
module:
let bot = tbot::from_env!("BOT_TOKEN");
let me = bot.get_me().call().await?;
dbg!(me);
A Bot
is also used to construct an EventLoop
— a struct
responsible for configuring handlers and listening to updates:
use tbot::prelude::*;
let mut bot = tbot::from_env!("BOT_TOKEN").event_loop();
bot.start(|context| async move {
let result = context.send_message_in_reply("Hi!").call().await;
if let Err(error) = result {
eprintln!("Failed to send a message: {}", error);
}
});
bot.polling().start().await?;
A Bot
can be constructed in several ways:
- The
from_env!
macro constructs a bot extracting its token from an enviroment variable at compile time; - The
Bot::from_env
method constructs a bot extracting its token from an environment variable at runtime; - The
Bot::new
method constructs a bot, and its token is provided as a parameter; - The
bot::Builder
provides advanced configuration of a bot. You can set up an HTTPS/SOCKS5 proxy or your local Bot API server’s URL using it.
The bot’s internal data (its token, proxy and the URL where it makes
requests) is kept behind an Arc
. It means that you can clone a Bot
cheaply to share it between tasks.
Implementations§
source§impl Bot
impl Bot
sourcepub fn new(token: String) -> Self
pub fn new(token: String) -> Self
Constructs a new Bot
.
This method is a shorthand for a common case. If you need advanced
configuration, e.g. you want to set a proxy or use a local Bot API
server, construct a Bot
using a bot::Builder
.
sourcepub fn from_env(env_var: &'static str) -> Self
pub fn from_env(env_var: &'static str) -> Self
Constructs a new Bot
, extracting the token from the environment at
runtime.
If you need to extract the token at compile time, use from_env!
.
This method is a shorthand for a common case. If you need advanced
configuration, e.g. you want to set a proxy or use a local Bot API
server, construct a Bot
using a bot::Builder
.
Example
use tbot::Bot;
let bot = Bot::from_env("BOT_TOKEN");
let me = bot.get_me().call().await.unwrap();
dbg!(me);
sourcepub async fn download_file(&self, file: &File) -> Result<Vec<u8>, Download>
pub async fn download_file(&self, file: &File) -> Result<Vec<u8>, Download>
Downloads a file.
If you use a self-hosted Bot API server, file.path
may be an absolute
local path. In this case, tbot
reads the file at the given and returns
it. If the server is running on another machine, you have to handle this
case manually before calling this method.
sourcepub fn event_loop(self) -> EventLoop
pub fn event_loop(self) -> EventLoop
Constructs an EventLoop
.
sourcepub fn stateful_event_loop<S>(self, state: S) -> StatefulEventLoop<S>where
S: Send + Sync + 'static,
pub fn stateful_event_loop<S>(self, state: S) -> StatefulEventLoop<S>where
S: Send + Sync + 'static,
Constructs a stateful event loop.
sourcepub fn add_sticker_to_set(
&self,
user_id: Id,
name: impl Into<String>,
png_sticker: impl Into<StickerForStickerSet>,
emojis: impl Into<String>
) -> AddStickerToSet<'_>
pub fn add_sticker_to_set(
&self,
user_id: Id,
name: impl Into<String>,
png_sticker: impl Into<StickerForStickerSet>,
emojis: impl Into<String>
) -> AddStickerToSet<'_>
Adds a new sticker to an existing sticker set.
sourcepub fn copy_message(
&self,
chat_id: impl ImplicitChatId,
from_chat_id: impl ImplicitChatId,
message_id: Id
) -> CopyMessage<'_>
pub fn copy_message(
&self,
chat_id: impl ImplicitChatId,
from_chat_id: impl ImplicitChatId,
message_id: Id
) -> CopyMessage<'_>
Copies a message.
sourcepub fn create_chat_invite_link(
&self,
chat_id: impl ImplicitChatId
) -> CreateChatInviteLink<'_>
pub fn create_chat_invite_link(
&self,
chat_id: impl ImplicitChatId
) -> CreateChatInviteLink<'_>
Creates a secondary invite link for a chat.
sourcepub fn create_new_sticker_set(
&self,
user_id: Id,
name: impl Into<String>,
title: impl Into<String>,
png_sticker: impl Into<StickerForStickerSet>,
emojis: impl Into<String>
) -> CreateNewStickerSet<'_>
pub fn create_new_sticker_set(
&self,
user_id: Id,
name: impl Into<String>,
title: impl Into<String>,
png_sticker: impl Into<StickerForStickerSet>,
emojis: impl Into<String>
) -> CreateNewStickerSet<'_>
Creates a new sticker set.
sourcepub fn delete_chat_photo(
&self,
chat_id: impl ImplicitChatId
) -> DeleteChatPhoto<'_>
pub fn delete_chat_photo(
&self,
chat_id: impl ImplicitChatId
) -> DeleteChatPhoto<'_>
Deletes a chat’s photo.
sourcepub fn delete_chat_sticker_set(
&self,
chat_id: impl ImplicitChatId
) -> DeleteChatStickerSet<'_>
pub fn delete_chat_sticker_set(
&self,
chat_id: impl ImplicitChatId
) -> DeleteChatStickerSet<'_>
Deletes a chat’s sticker set.
sourcepub fn delete_message(
&self,
chat_id: impl ImplicitChatId,
message_id: Id
) -> DeleteMessage<'_>
pub fn delete_message(
&self,
chat_id: impl ImplicitChatId,
message_id: Id
) -> DeleteMessage<'_>
Deletes a message from a chat.
sourcepub fn delete_my_commands(&self) -> DeleteMyCommands<'_>
pub fn delete_my_commands(&self) -> DeleteMyCommands<'_>
Deletes the list of the bot’s commands.
sourcepub fn delete_sticker_from_set(
&self,
sticker: impl Into<String>
) -> DeleteStickerFromSet<'_>
pub fn delete_sticker_from_set(
&self,
sticker: impl Into<String>
) -> DeleteStickerFromSet<'_>
Deletes a sticker from a sticker set.
sourcepub fn edit_chat_invite_link(
&self,
chat_id: impl ImplicitChatId,
link: impl Into<String>
) -> EditChatInviteLink<'_>
pub fn edit_chat_invite_link(
&self,
chat_id: impl ImplicitChatId,
link: impl Into<String>
) -> EditChatInviteLink<'_>
Edits a secondary invite link for a chat.
Edits the caption of a media message sent via the inline mode.
sourcepub fn edit_inline_location(
&self,
inline_message_id: InlineMessageId,
position: (f64, f64)
) -> EditInlineLocation<'_>
pub fn edit_inline_location(
&self,
inline_message_id: InlineMessageId,
position: (f64, f64)
) -> EditInlineLocation<'_>
Edits a live location sent via the inline mode.
sourcepub fn edit_inline_media(
&self,
inline_message_id: InlineMessageId,
media: impl Into<EditableMedia>
) -> EditInlineMedia<'_>
pub fn edit_inline_media(
&self,
inline_message_id: InlineMessageId,
media: impl Into<EditableMedia>
) -> EditInlineMedia<'_>
Edits the media of a message sent via the inline mode.
sourcepub fn edit_inline_reply_markup(
&self,
inline_message_id: InlineMessageId,
reply_markup: Keyboard
) -> EditInlineReplyMarkup<'_>
pub fn edit_inline_reply_markup(
&self,
inline_message_id: InlineMessageId,
reply_markup: Keyboard
) -> EditInlineReplyMarkup<'_>
Edits the inline keyboard of a message sent via the inline mode.
sourcepub fn edit_inline_text(
&self,
inline_message_id: InlineMessageId,
text: impl Into<Text>
) -> EditInlineText<'_>
pub fn edit_inline_text(
&self,
inline_message_id: InlineMessageId,
text: impl Into<Text>
) -> EditInlineText<'_>
Edits the text of a message sent via the inline mode.
Edits the caption of a media message sent by the bot itself.
sourcepub fn edit_message_location(
&self,
chat_id: impl ImplicitChatId,
message_id: Id,
position: (f64, f64)
) -> EditMessageLocation<'_>
pub fn edit_message_location(
&self,
chat_id: impl ImplicitChatId,
message_id: Id,
position: (f64, f64)
) -> EditMessageLocation<'_>
Edits a live location sent by the bot itself.
sourcepub fn edit_message_media(
&self,
chat_id: impl ImplicitChatId,
message_id: Id,
media: impl Into<EditableMedia>
) -> EditMessageMedia<'_>
pub fn edit_message_media(
&self,
chat_id: impl ImplicitChatId,
message_id: Id,
media: impl Into<EditableMedia>
) -> EditMessageMedia<'_>
Edits a live location sent by the bot itself.
sourcepub fn edit_message_reply_markup(
&self,
chat_id: impl ImplicitChatId,
message_id: Id,
reply_markup: Keyboard
) -> EditMessageReplyMarkup<'_>
pub fn edit_message_reply_markup(
&self,
chat_id: impl ImplicitChatId,
message_id: Id,
reply_markup: Keyboard
) -> EditMessageReplyMarkup<'_>
Edits the inline keyboard of a message sent by the bot itself.
sourcepub fn edit_message_text(
&self,
chat_id: impl ImplicitChatId,
message_id: Id,
text: impl Into<Text>
) -> EditMessageText<'_>
pub fn edit_message_text(
&self,
chat_id: impl ImplicitChatId,
message_id: Id,
text: impl Into<Text>
) -> EditMessageText<'_>
Edits the text of a message sent by the bot itself.
sourcepub fn export_chat_invite_link(
&self,
chat_id: impl ImplicitChatId
) -> ExportChatInviteLink<'_>
pub fn export_chat_invite_link(
&self,
chat_id: impl ImplicitChatId
) -> ExportChatInviteLink<'_>
Exports a chat’s invite link.
sourcepub fn forward_message(
&self,
chat_id: impl ImplicitChatId,
from_chat_id: impl ImplicitChatId,
message_id: Id
) -> ForwardMessage<'_>
pub fn forward_message(
&self,
chat_id: impl ImplicitChatId,
from_chat_id: impl ImplicitChatId,
message_id: Id
) -> ForwardMessage<'_>
Forwards a message.
sourcepub fn get_chat(&self, chat_id: impl ImplicitChatId) -> GetChat<'_>
pub fn get_chat(&self, chat_id: impl ImplicitChatId) -> GetChat<'_>
Gets information about a chat.
sourcepub fn get_inline_game_high_scores(
&self,
inline_message_id: InlineMessageId,
user_id: Id
) -> GetInlineGameHighScores<'_>
pub fn get_inline_game_high_scores(
&self,
inline_message_id: InlineMessageId,
user_id: Id
) -> GetInlineGameHighScores<'_>
Gets an excerpt from the high score table of a game sent via the inline mode.
sourcepub fn get_chat_administrators(
&self,
chat_id: impl ImplicitChatId
) -> GetChatAdministrators<'_>
pub fn get_chat_administrators(
&self,
chat_id: impl ImplicitChatId
) -> GetChatAdministrators<'_>
Gets information about a chat’s admins.
sourcepub fn get_chat_member(
&self,
chat_id: impl ImplicitChatId,
user_id: Id
) -> GetChatMember<'_>
pub fn get_chat_member(
&self,
chat_id: impl ImplicitChatId,
user_id: Id
) -> GetChatMember<'_>
Gets information about a chat’s member.
sourcepub fn get_chat_member_count(
&self,
chat_id: impl ImplicitChatId
) -> GetChatMemberCount<'_>
pub fn get_chat_member_count(
&self,
chat_id: impl ImplicitChatId
) -> GetChatMemberCount<'_>
Gets a chat’s member count.
sourcepub fn get_message_game_high_scores(
&self,
chat_id: impl ImplicitChatId,
message_id: Id,
user_id: Id
) -> GetMessageGameHighScores<'_>
pub fn get_message_game_high_scores(
&self,
chat_id: impl ImplicitChatId,
message_id: Id,
user_id: Id
) -> GetMessageGameHighScores<'_>
Gets an excerpt from the high score table of a game sent by the bot itself.
sourcepub fn get_my_commands(&self) -> GetMyCommands<'_>
pub fn get_my_commands(&self) -> GetMyCommands<'_>
Gets the list of the bot’s commands.
sourcepub fn get_sticker_set(&self, name: impl Into<String>) -> GetStickerSet<'_>
pub fn get_sticker_set(&self, name: impl Into<String>) -> GetStickerSet<'_>
Gets a sticker set by its name.
sourcepub fn get_user_profile_photos(&self, user_id: Id) -> GetUserProfilePhotos<'_>
pub fn get_user_profile_photos(&self, user_id: Id) -> GetUserProfilePhotos<'_>
Gets a user’s profile photos.
sourcepub fn get_webhook_info(&self) -> GetWebhookInfo<'_>
pub fn get_webhook_info(&self) -> GetWebhookInfo<'_>
Gets information about the bot’s webhook.
sourcepub fn ban_chat_member(
&self,
chat_id: impl ImplicitChatId,
user_id: Id
) -> BanChatMember<'_>
pub fn ban_chat_member(
&self,
chat_id: impl ImplicitChatId,
user_id: Id
) -> BanChatMember<'_>
Bans a member in a chat.
sourcepub fn leave_chat(&self, chat_id: impl ImplicitChatId) -> LeaveChat<'_>
pub fn leave_chat(&self, chat_id: impl ImplicitChatId) -> LeaveChat<'_>
Leaves a chat.
sourcepub fn pin_chat_message(
&self,
chat_id: impl ImplicitChatId,
message_id: Id
) -> PinChatMessage<'_>
pub fn pin_chat_message(
&self,
chat_id: impl ImplicitChatId,
message_id: Id
) -> PinChatMessage<'_>
Pins a message in a chat.
sourcepub fn promote_chat_member(
&self,
chat_id: impl ImplicitChatId,
user_id: Id
) -> PromoteChatMember<'_>
pub fn promote_chat_member(
&self,
chat_id: impl ImplicitChatId,
user_id: Id
) -> PromoteChatMember<'_>
Promotes a chat member to an admin.
sourcepub fn restrict_chat_member(
&self,
chat_id: impl ImplicitChatId,
user_id: Id,
permissions: Permissions
) -> RestrictChatMember<'_>
pub fn restrict_chat_member(
&self,
chat_id: impl ImplicitChatId,
user_id: Id,
permissions: Permissions
) -> RestrictChatMember<'_>
Restricts a chat member.
sourcepub fn revoke_chat_invite_link(
&self,
chat_id: impl ImplicitChatId,
link: impl Into<String>
) -> RevokeChatInviteLink<'_>
pub fn revoke_chat_invite_link(
&self,
chat_id: impl ImplicitChatId,
link: impl Into<String>
) -> RevokeChatInviteLink<'_>
Revokes an invite link for a chat.
sourcepub fn send_animation(
&self,
chat_id: impl ImplicitChatId,
animation: Animation
) -> SendAnimation<'_>
pub fn send_animation(
&self,
chat_id: impl ImplicitChatId,
animation: Animation
) -> SendAnimation<'_>
Sends an animation.
sourcepub fn send_audio(
&self,
chat_id: impl ImplicitChatId,
audio: Audio
) -> SendAudio<'_>
pub fn send_audio(
&self,
chat_id: impl ImplicitChatId,
audio: Audio
) -> SendAudio<'_>
Sends an audio.
sourcepub fn send_chat_action(
&self,
chat_id: impl ImplicitChatId,
action: Action
) -> SendChatAction<'_>
pub fn send_chat_action(
&self,
chat_id: impl ImplicitChatId,
action: Action
) -> SendChatAction<'_>
Sends a chat action.
sourcepub fn send_contact(
&self,
chat_id: impl ImplicitChatId,
phone_number: impl Into<String>,
first_name: impl Into<String>
) -> SendContact<'_>
pub fn send_contact(
&self,
chat_id: impl ImplicitChatId,
phone_number: impl Into<String>,
first_name: impl Into<String>
) -> SendContact<'_>
Sends a contact.
sourcepub fn send_game(
&self,
chat_id: impl ImplicitChatId,
game_short_name: impl Into<String>
) -> SendGame<'_>
pub fn send_game(
&self,
chat_id: impl ImplicitChatId,
game_short_name: impl Into<String>
) -> SendGame<'_>
Sends a game.
sourcepub fn send_dice(&self, chat_id: impl ImplicitChatId) -> SendDice<'_>
pub fn send_dice(&self, chat_id: impl ImplicitChatId) -> SendDice<'_>
Sends a dice.
sourcepub fn send_document(
&self,
chat_id: impl ImplicitChatId,
document: Document
) -> SendDocument<'_>
pub fn send_document(
&self,
chat_id: impl ImplicitChatId,
document: Document
) -> SendDocument<'_>
Sends a document.
sourcepub fn send_invoice(
&self,
chat_id: impl Into<Id>,
invoice: Invoice
) -> SendInvoice<'_>
pub fn send_invoice(
&self,
chat_id: impl Into<Id>,
invoice: Invoice
) -> SendInvoice<'_>
Sends an invoice.
sourcepub fn send_location(
&self,
chat_id: impl ImplicitChatId,
position: (f64, f64)
) -> SendLocation<'_>
pub fn send_location(
&self,
chat_id: impl ImplicitChatId,
position: (f64, f64)
) -> SendLocation<'_>
Sends a location.
sourcepub fn send_media_group(
&self,
chat_id: impl ImplicitChatId,
media: impl Into<MediaGroup>
) -> SendMediaGroup<'_>
pub fn send_media_group(
&self,
chat_id: impl ImplicitChatId,
media: impl Into<MediaGroup>
) -> SendMediaGroup<'_>
Sends an album.
sourcepub fn send_message(
&self,
chat_id: impl ImplicitChatId,
text: impl Into<Text>
) -> SendMessage<'_>
pub fn send_message(
&self,
chat_id: impl ImplicitChatId,
text: impl Into<Text>
) -> SendMessage<'_>
Sends a text message.
sourcepub fn send_photo(
&self,
chat_id: impl ImplicitChatId,
photo: Photo
) -> SendPhoto<'_>
pub fn send_photo(
&self,
chat_id: impl ImplicitChatId,
photo: Photo
) -> SendPhoto<'_>
Sends a photo.
sourcepub fn send_poll(&self, chat_id: impl ImplicitChatId, poll: Any) -> SendPoll<'_>
pub fn send_poll(&self, chat_id: impl ImplicitChatId, poll: Any) -> SendPoll<'_>
Sends a poll.
sourcepub fn send_sticker(
&self,
chat_id: impl ImplicitChatId,
sticker: Sticker
) -> SendSticker<'_>
pub fn send_sticker(
&self,
chat_id: impl ImplicitChatId,
sticker: Sticker
) -> SendSticker<'_>
Sends a sticker.
sourcepub fn send_venue(
&self,
chat_id: impl ImplicitChatId,
position: (f64, f64),
title: impl Into<String>,
address: impl Into<String>
) -> SendVenue<'_>
pub fn send_venue(
&self,
chat_id: impl ImplicitChatId,
position: (f64, f64),
title: impl Into<String>,
address: impl Into<String>
) -> SendVenue<'_>
Sends a venue.
sourcepub fn send_video_note(
&self,
chat_id: impl ImplicitChatId,
video_note: VideoNote
) -> SendVideoNote<'_>
pub fn send_video_note(
&self,
chat_id: impl ImplicitChatId,
video_note: VideoNote
) -> SendVideoNote<'_>
Sends a video note.
sourcepub fn send_video(
&self,
chat_id: impl ImplicitChatId,
video: Video
) -> SendVideo<'_>
pub fn send_video(
&self,
chat_id: impl ImplicitChatId,
video: Video
) -> SendVideo<'_>
Sends a video.
sourcepub fn send_voice(
&self,
chat_id: impl ImplicitChatId,
voice: Voice
) -> SendVoice<'_>
pub fn send_voice(
&self,
chat_id: impl ImplicitChatId,
voice: Voice
) -> SendVoice<'_>
Sends a voice.
sourcepub fn set_chat_administrator_custom_title(
&self,
chat_id: impl ImplicitChatId,
user_id: Id,
custom_title: impl Into<String>
) -> SetChatAdministratorCustomTitle<'_>
pub fn set_chat_administrator_custom_title(
&self,
chat_id: impl ImplicitChatId,
user_id: Id,
custom_title: impl Into<String>
) -> SetChatAdministratorCustomTitle<'_>
Sets a custom title for an admin in a chat.
sourcepub fn set_chat_description(
&self,
chat_id: impl ImplicitChatId,
description: impl Into<String>
) -> SetChatDescription<'_>
pub fn set_chat_description(
&self,
chat_id: impl ImplicitChatId,
description: impl Into<String>
) -> SetChatDescription<'_>
Sets a chat’s description.
sourcepub fn set_chat_permissions(
&self,
chat_id: impl ImplicitChatId,
permissions: Permissions
) -> SetChatPermissions<'_>
pub fn set_chat_permissions(
&self,
chat_id: impl ImplicitChatId,
permissions: Permissions
) -> SetChatPermissions<'_>
Sets a group’s global permissions.
sourcepub fn set_chat_photo(
&self,
chat_id: impl ImplicitChatId,
photo: ChatPhoto
) -> SetChatPhoto<'_>
pub fn set_chat_photo(
&self,
chat_id: impl ImplicitChatId,
photo: ChatPhoto
) -> SetChatPhoto<'_>
Sets a chat’s photo.
sourcepub fn set_chat_sticker_set(
&self,
chat_id: impl ImplicitChatId,
sticker_set_name: impl Into<String>
) -> SetChatStickerSet<'_>
pub fn set_chat_sticker_set(
&self,
chat_id: impl ImplicitChatId,
sticker_set_name: impl Into<String>
) -> SetChatStickerSet<'_>
Sets a group’s sticker set.
sourcepub fn set_chat_title(
&self,
chat_id: impl ImplicitChatId,
title: impl Into<String>
) -> SetChatTitle<'_>
pub fn set_chat_title(
&self,
chat_id: impl ImplicitChatId,
title: impl Into<String>
) -> SetChatTitle<'_>
Sets a group’s title.
sourcepub fn set_inline_game_score(
&self,
inline_message_id: InlineMessageId,
user_id: Id,
score: u32
) -> SetInlineGameScore<'_>
pub fn set_inline_game_score(
&self,
inline_message_id: InlineMessageId,
user_id: Id,
score: u32
) -> SetInlineGameScore<'_>
Sets a user’s new high score in a game sent via the inline mode.
sourcepub fn set_message_game_score(
&self,
chat_id: impl ImplicitChatId,
message_id: Id,
user_id: Id,
score: u32
) -> SetMessageGameScore<'_>
pub fn set_message_game_score(
&self,
chat_id: impl ImplicitChatId,
message_id: Id,
user_id: Id,
score: u32
) -> SetMessageGameScore<'_>
Sets a user’s new high score in a game sent by the bot itself.
sourcepub fn set_my_commands(
&self,
commands: impl Into<Vec<BotCommand>>
) -> SetMyCommands<'_>
pub fn set_my_commands(
&self,
commands: impl Into<Vec<BotCommand>>
) -> SetMyCommands<'_>
Sets the list of the bot’s commands.
sourcepub fn set_passport_data_errors(
&self,
user_id: Id,
errors: impl Into<Vec<Error>>
) -> SetPassportDataErrors<'_>
pub fn set_passport_data_errors(
&self,
user_id: Id,
errors: impl Into<Vec<Error>>
) -> SetPassportDataErrors<'_>
Reports passport errors to the user.
sourcepub fn set_sticker_position_in_set(
&self,
sticker: impl Into<String>,
position: u32
) -> SetStickerPositionInSet<'_>
pub fn set_sticker_position_in_set(
&self,
sticker: impl Into<String>,
position: u32
) -> SetStickerPositionInSet<'_>
Changes a sticker’s position in a sticker set.
sourcepub fn set_sticker_set_thumb(
&self,
user_id: Id,
name: impl Into<String>,
thumb: Option<StickerSetThumb>
) -> SetStickerSetThumb<'_>
pub fn set_sticker_set_thumb(
&self,
user_id: Id,
name: impl Into<String>,
thumb: Option<StickerSetThumb>
) -> SetStickerSetThumb<'_>
Sets the thumb of a sticker set.
sourcepub fn stop_inline_location(
&self,
inline_message_id: InlineMessageId
) -> StopInlineLocation<'_>
pub fn stop_inline_location(
&self,
inline_message_id: InlineMessageId
) -> StopInlineLocation<'_>
Stops a live location sent via the inline mode.
sourcepub fn stop_message_location(
&self,
chat_id: impl ImplicitChatId,
message_id: Id
) -> StopMessageLocation<'_>
pub fn stop_message_location(
&self,
chat_id: impl ImplicitChatId,
message_id: Id
) -> StopMessageLocation<'_>
Stops a live location sent by the bot itself.
sourcepub fn stop_poll(
&self,
chat_id: impl ImplicitChatId,
message_id: Id
) -> StopPoll<'_>
pub fn stop_poll(
&self,
chat_id: impl ImplicitChatId,
message_id: Id
) -> StopPoll<'_>
Stops a poll.
sourcepub fn unban_chat_member(
&self,
chat_id: impl ImplicitChatId,
user_id: Id
) -> UnbanChatMember<'_>
pub fn unban_chat_member(
&self,
chat_id: impl ImplicitChatId,
user_id: Id
) -> UnbanChatMember<'_>
Lifts all restrictions from a group’s member.
sourcepub fn unpin_all_chat_messages(
&self,
chat_id: impl ImplicitChatId
) -> UnpinAllChatMessages<'_>
pub fn unpin_all_chat_messages(
&self,
chat_id: impl ImplicitChatId
) -> UnpinAllChatMessages<'_>
Unpins all messages in a chat.
sourcepub fn unpin_chat_message(
&self,
chat_id: impl ImplicitChatId
) -> UnpinChatMessage<'_>
pub fn unpin_chat_message(
&self,
chat_id: impl ImplicitChatId
) -> UnpinChatMessage<'_>
Unpins a chat message.
sourcepub fn upload_sticker_file(
&self,
user_id: Id,
png_sticker: impl Into<Vec<u8>>
) -> UploadStickerFile<'_>
pub fn upload_sticker_file(
&self,
user_id: Id,
png_sticker: impl Into<Vec<u8>>
) -> UploadStickerFile<'_>
Uploads a sticker file.