Struct teloxide_core::Bot
source · [−]pub struct Bot { /* private fields */ }Expand description
A requests sender.
This is the main type of the library, it allows to send requests to the Telegram Bot API and download files.
TBA methods
All TBA methods are located in the Requester impl for Bot. This
allows for opt-in behaviours using requester adaptors.
use teloxide_core::prelude::*;
let bot = Bot::new("TOKEN");
dbg!(bot.get_me().send().await?);File download
In the similar way as with TBA methods, file downloading methods are located
in a trait — Download<'_>. See its documentation for more.
Clone cost
Bot::clone is relatively cheap, so if you need to share Bot, it’s
recommended to clone it, instead of wrapping it in Arc<_>.
Implementations
sourceimpl Bot
impl Bot
Constructors
sourcepub fn new<S>(token: S) -> Self where
S: Into<String>,
pub fn new<S>(token: S) -> Self where
S: Into<String>,
Creates a new Bot with the specified token and the default
http-client.
Panics
If it cannot create reqwest::Client.
sourcepub fn with_client<S>(token: S, client: Client) -> Self where
S: Into<String>,
pub fn with_client<S>(token: S, client: Client) -> Self where
S: Into<String>,
Creates a new Bot with the specified token and your
reqwest::Client.
Caution
Your custom client might not be configured correctly to be able to work in long time durations, see issue 223.
sourcepub fn from_env() -> Self
pub fn from_env() -> Self
Creates a new Bot with the TELOXIDE_TOKEN & TELOXIDE_PROXY
environmental variables (a bot’s token & a proxy) and the default
reqwest::Client.
This function passes the value of TELOXIDE_PROXY into
reqwest::Proxy::all, if it exists, otherwise returns the default
client.
Panics
- If cannot get the
TELOXIDE_TOKENenvironmental variable. - If it cannot create
reqwest::Client.
Examples found in repository?
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
async fn main() -> Result<(), Box<dyn std::error::Error>> {
pretty_env_logger::init();
let chat_id = ChatId(
std::env::var("CHAT_ID")
.expect("Expected CHAT_ID env var")
.parse::<i64>()?,
);
let bot = Bot::from_env()
.parse_mode(ParseMode::MarkdownV2)
.auto_send();
let Me { user: me, .. } = bot.get_me().await?;
bot.send_dice(chat_id).emoji(DiceEmoji::Dice).await?;
bot.send_message(chat_id, format!("Hi, my name is **{}** 👋", me.first_name))
.await?;
Ok(())
}More examples
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
async fn main() -> Result<(), Box<dyn std::error::Error>> {
pretty_env_logger::init();
let chat_id = ChatId(
std::env::var("CHAT_ID")
.expect("Expected CHAT_ID env var")
.parse::<i64>()?,
);
let trace_settings = match std::env::var("TRACE").as_deref() {
Ok("EVERYTHING_VERBOSE") => trace::Settings::TRACE_EVERYTHING_VERBOSE,
Ok("EVERYTHING") => trace::Settings::TRACE_EVERYTHING,
Ok("REQUESTS_VERBOSE") => trace::Settings::TRACE_REQUESTS_VERBOSE,
Ok("REQUESTS") => trace::Settings::TRACE_REQUESTS,
Ok("RESPONSES_VERBOSE") => trace::Settings::TRACE_RESPONSES_VERBOSE,
Ok("RESPONSES") => trace::Settings::TRACE_RESPONSES,
Ok("EMPTY") | Ok("") | Err(VarError::NotPresent) => trace::Settings::empty(),
Ok(_) | Err(VarError::NotUnicode(_)) => {
panic!(
"Expected `TRACE` environment variable to be equal to any of the following: \
`EVERYTHING_VERBOSE`, `EVERYTHING`, `REQUESTS_VERBOSE`, `REQUESTS`, \
`RESPONSES_VERBOSE`, `RESPONSES`, `EMPTY`, `` (empty string)"
)
}
};
log::info!("Trace settings: {:?}", trace_settings);
let bot = if trace_settings.is_empty() {
Bot::from_env().erase().auto_send()
} else {
Bot::from_env().trace(trace_settings).erase().auto_send()
};
bot.send_chat_action(chat_id, ChatAction::Typing).await?;
tokio::time::sleep(Duration::from_secs(1)).await;
bot.send_message(chat_id, "Hey hey hey").await?;
Ok(())
}sourcepub fn from_env_with_client(client: Client) -> Self
pub fn from_env_with_client(client: Client) -> Self
Creates a new Bot with the TELOXIDE_TOKEN environmental variable (a
bot’s token) and your reqwest::Client.
Panics
If cannot get the TELOXIDE_TOKEN environmental variable.
Caution
Your custom client might not be configured correctly to be able to work in long time durations, see issue 223.
sourcepub fn set_api_url(self, url: Url) -> Self
pub fn set_api_url(self, url: Url) -> Self
Sets a custom API URL.
For example, you can run your own Telegram bot API server and set its URL using this method.
Examples
use teloxide_core::{
requests::{Request, Requester},
Bot,
};
let url = reqwest::Url::parse("https://localhost/tbas").unwrap();
let bot = Bot::new("TOKEN").set_api_url(url);
// From now all methods will use "https://localhost/tbas" as an API URL.
bot.get_me().send().awaitMulti-instance behaviour
This method only sets the url for one bot instace, older clones are unaffected.
use teloxide_core::Bot;
let bot = Bot::new("TOKEN");
let bot2 = bot.clone();
let bot = bot.set_api_url(reqwest::Url::parse("https://example.com/").unwrap());
assert_eq!(bot.api_url().as_str(), "https://example.com/");
assert_eq!(bot.clone().api_url().as_str(), "https://example.com/");
assert_ne!(bot2.api_url().as_str(), "https://example.com/");Trait Implementations
sourceimpl Clone for Bot
impl Clone for Bot
sourcefn clone(&self) -> BotⓘNotable traits for Botimpl Requester for Bot type Err = RequestError; type GetUpdates = JsonRequest<GetUpdates>; type SetWebhook = JsonRequest<SetWebhook>; type DeleteWebhook = JsonRequest<DeleteWebhook>; type GetWebhookInfo = JsonRequest<GetWebhookInfo>; type GetMe = JsonRequest<GetMe>; type SendMessage = JsonRequest<SendMessage>; type ForwardMessage = JsonRequest<ForwardMessage>; type SendPhoto = MultipartRequest<SendPhoto>; type SendAudio = MultipartRequest<SendAudio>; type SendDocument = MultipartRequest<SendDocument>; type SendVideo = MultipartRequest<SendVideo>; type SendAnimation = MultipartRequest<SendAnimation>; type SendVoice = MultipartRequest<SendVoice>; type SendVideoNote = MultipartRequest<SendVideoNote>; type SendMediaGroup = MultipartRequest<SendMediaGroup>; type SendLocation = JsonRequest<SendLocation>; type EditMessageLiveLocation = JsonRequest<EditMessageLiveLocation>; type EditMessageLiveLocationInline = JsonRequest<EditMessageLiveLocationInline>; type StopMessageLiveLocation = JsonRequest<StopMessageLiveLocation>; type StopMessageLiveLocationInline = JsonRequest<StopMessageLiveLocationInline>; type SendVenue = JsonRequest<SendVenue>; type SendContact = JsonRequest<SendContact>; type SendPoll = JsonRequest<SendPoll>; type SendDice = JsonRequest<SendDice>; type SendChatAction = JsonRequest<SendChatAction>; type GetUserProfilePhotos = JsonRequest<GetUserProfilePhotos>; type GetFile = JsonRequest<GetFile>; type KickChatMember = JsonRequest<KickChatMember>; type BanChatMember = JsonRequest<BanChatMember>; type UnbanChatMember = JsonRequest<UnbanChatMember>; type RestrictChatMember = JsonRequest<RestrictChatMember>; type PromoteChatMember = JsonRequest<PromoteChatMember>; type SetChatAdministratorCustomTitle = JsonRequest<SetChatAdministratorCustomTitle>; type BanChatSenderChat = JsonRequest<BanChatSenderChat>; type UnbanChatSenderChat = JsonRequest<UnbanChatSenderChat>; type SetChatPermissions = JsonRequest<SetChatPermissions>; type ExportChatInviteLink = JsonRequest<ExportChatInviteLink>; type CreateChatInviteLink = JsonRequest<CreateChatInviteLink>; type EditChatInviteLink = JsonRequest<EditChatInviteLink>; type RevokeChatInviteLink = JsonRequest<RevokeChatInviteLink>; type ApproveChatJoinRequest = JsonRequest<ApproveChatJoinRequest>; type DeclineChatJoinRequest = JsonRequest<DeclineChatJoinRequest>; type SetChatPhoto = MultipartRequest<SetChatPhoto>; type DeleteChatPhoto = JsonRequest<DeleteChatPhoto>; type SetChatTitle = JsonRequest<SetChatTitle>; type SetChatDescription = JsonRequest<SetChatDescription>; type PinChatMessage = JsonRequest<PinChatMessage>; type UnpinChatMessage = JsonRequest<UnpinChatMessage>; type LeaveChat = JsonRequest<LeaveChat>; type GetChat = JsonRequest<GetChat>; type GetChatAdministrators = JsonRequest<GetChatAdministrators>; type GetChatMembersCount = JsonRequest<GetChatMembersCount>; type GetChatMemberCount = JsonRequest<GetChatMemberCount>; type GetChatMember = JsonRequest<GetChatMember>; type SetChatStickerSet = JsonRequest<SetChatStickerSet>; type DeleteChatStickerSet = JsonRequest<DeleteChatStickerSet>; type AnswerCallbackQuery = JsonRequest<AnswerCallbackQuery>; type SetMyCommands = JsonRequest<SetMyCommands>; type GetMyCommands = JsonRequest<GetMyCommands>; type SetChatMenuButton = JsonRequest<SetChatMenuButton>; type GetChatMenuButton = JsonRequest<GetChatMenuButton>; type SetMyDefaultAdministratorRights = JsonRequest<SetMyDefaultAdministratorRights>; type GetMyDefaultAdministratorRights = JsonRequest<GetMyDefaultAdministratorRights>; type DeleteMyCommands = JsonRequest<DeleteMyCommands>; type AnswerInlineQuery = JsonRequest<AnswerInlineQuery>; type AnswerWebAppQuery = JsonRequest<AnswerWebAppQuery>; type EditMessageText = JsonRequest<EditMessageText>; type EditMessageTextInline = JsonRequest<EditMessageTextInline>; type EditMessageCaption = JsonRequest<EditMessageCaption>; type EditMessageCaptionInline = JsonRequest<EditMessageCaptionInline>; type EditMessageMedia = MultipartRequest<EditMessageMedia>; type EditMessageMediaInline = MultipartRequest<EditMessageMediaInline>; type EditMessageReplyMarkup = JsonRequest<EditMessageReplyMarkup>; type EditMessageReplyMarkupInline = JsonRequest<EditMessageReplyMarkupInline>; type StopPoll = JsonRequest<StopPoll>; type DeleteMessage = JsonRequest<DeleteMessage>; type SendSticker = MultipartRequest<SendSticker>; type GetStickerSet = JsonRequest<GetStickerSet>; type UploadStickerFile = MultipartRequest<UploadStickerFile>; type CreateNewStickerSet = MultipartRequest<CreateNewStickerSet>; type AddStickerToSet = MultipartRequest<AddStickerToSet>; type SetStickerPositionInSet = JsonRequest<SetStickerPositionInSet>; type DeleteStickerFromSet = JsonRequest<DeleteStickerFromSet>; type SetStickerSetThumb = MultipartRequest<SetStickerSetThumb>; type SendInvoice = JsonRequest<SendInvoice>; type CreateInvoiceLink = JsonRequest<CreateInvoiceLink>; type AnswerShippingQuery = JsonRequest<AnswerShippingQuery>; type AnswerPreCheckoutQuery = JsonRequest<AnswerPreCheckoutQuery>; type SetPassportDataErrors = JsonRequest<SetPassportDataErrors>; type SendGame = JsonRequest<SendGame>; type SetGameScore = JsonRequest<SetGameScore>; type SetGameScoreInline = JsonRequest<SetGameScoreInline>; type GetGameHighScores = JsonRequest<GetGameHighScores>; type LogOut = JsonRequest<LogOut>; type Close = JsonRequest<Close>; type CopyMessage = JsonRequest<CopyMessage>; type UnpinAllChatMessages = JsonRequest<UnpinAllChatMessages>;
fn clone(&self) -> BotⓘNotable traits for Botimpl Requester for Bot type Err = RequestError; type GetUpdates = JsonRequest<GetUpdates>; type SetWebhook = JsonRequest<SetWebhook>; type DeleteWebhook = JsonRequest<DeleteWebhook>; type GetWebhookInfo = JsonRequest<GetWebhookInfo>; type GetMe = JsonRequest<GetMe>; type SendMessage = JsonRequest<SendMessage>; type ForwardMessage = JsonRequest<ForwardMessage>; type SendPhoto = MultipartRequest<SendPhoto>; type SendAudio = MultipartRequest<SendAudio>; type SendDocument = MultipartRequest<SendDocument>; type SendVideo = MultipartRequest<SendVideo>; type SendAnimation = MultipartRequest<SendAnimation>; type SendVoice = MultipartRequest<SendVoice>; type SendVideoNote = MultipartRequest<SendVideoNote>; type SendMediaGroup = MultipartRequest<SendMediaGroup>; type SendLocation = JsonRequest<SendLocation>; type EditMessageLiveLocation = JsonRequest<EditMessageLiveLocation>; type EditMessageLiveLocationInline = JsonRequest<EditMessageLiveLocationInline>; type StopMessageLiveLocation = JsonRequest<StopMessageLiveLocation>; type StopMessageLiveLocationInline = JsonRequest<StopMessageLiveLocationInline>; type SendVenue = JsonRequest<SendVenue>; type SendContact = JsonRequest<SendContact>; type SendPoll = JsonRequest<SendPoll>; type SendDice = JsonRequest<SendDice>; type SendChatAction = JsonRequest<SendChatAction>; type GetUserProfilePhotos = JsonRequest<GetUserProfilePhotos>; type GetFile = JsonRequest<GetFile>; type KickChatMember = JsonRequest<KickChatMember>; type BanChatMember = JsonRequest<BanChatMember>; type UnbanChatMember = JsonRequest<UnbanChatMember>; type RestrictChatMember = JsonRequest<RestrictChatMember>; type PromoteChatMember = JsonRequest<PromoteChatMember>; type SetChatAdministratorCustomTitle = JsonRequest<SetChatAdministratorCustomTitle>; type BanChatSenderChat = JsonRequest<BanChatSenderChat>; type UnbanChatSenderChat = JsonRequest<UnbanChatSenderChat>; type SetChatPermissions = JsonRequest<SetChatPermissions>; type ExportChatInviteLink = JsonRequest<ExportChatInviteLink>; type CreateChatInviteLink = JsonRequest<CreateChatInviteLink>; type EditChatInviteLink = JsonRequest<EditChatInviteLink>; type RevokeChatInviteLink = JsonRequest<RevokeChatInviteLink>; type ApproveChatJoinRequest = JsonRequest<ApproveChatJoinRequest>; type DeclineChatJoinRequest = JsonRequest<DeclineChatJoinRequest>; type SetChatPhoto = MultipartRequest<SetChatPhoto>; type DeleteChatPhoto = JsonRequest<DeleteChatPhoto>; type SetChatTitle = JsonRequest<SetChatTitle>; type SetChatDescription = JsonRequest<SetChatDescription>; type PinChatMessage = JsonRequest<PinChatMessage>; type UnpinChatMessage = JsonRequest<UnpinChatMessage>; type LeaveChat = JsonRequest<LeaveChat>; type GetChat = JsonRequest<GetChat>; type GetChatAdministrators = JsonRequest<GetChatAdministrators>; type GetChatMembersCount = JsonRequest<GetChatMembersCount>; type GetChatMemberCount = JsonRequest<GetChatMemberCount>; type GetChatMember = JsonRequest<GetChatMember>; type SetChatStickerSet = JsonRequest<SetChatStickerSet>; type DeleteChatStickerSet = JsonRequest<DeleteChatStickerSet>; type AnswerCallbackQuery = JsonRequest<AnswerCallbackQuery>; type SetMyCommands = JsonRequest<SetMyCommands>; type GetMyCommands = JsonRequest<GetMyCommands>; type SetChatMenuButton = JsonRequest<SetChatMenuButton>; type GetChatMenuButton = JsonRequest<GetChatMenuButton>; type SetMyDefaultAdministratorRights = JsonRequest<SetMyDefaultAdministratorRights>; type GetMyDefaultAdministratorRights = JsonRequest<GetMyDefaultAdministratorRights>; type DeleteMyCommands = JsonRequest<DeleteMyCommands>; type AnswerInlineQuery = JsonRequest<AnswerInlineQuery>; type AnswerWebAppQuery = JsonRequest<AnswerWebAppQuery>; type EditMessageText = JsonRequest<EditMessageText>; type EditMessageTextInline = JsonRequest<EditMessageTextInline>; type EditMessageCaption = JsonRequest<EditMessageCaption>; type EditMessageCaptionInline = JsonRequest<EditMessageCaptionInline>; type EditMessageMedia = MultipartRequest<EditMessageMedia>; type EditMessageMediaInline = MultipartRequest<EditMessageMediaInline>; type EditMessageReplyMarkup = JsonRequest<EditMessageReplyMarkup>; type EditMessageReplyMarkupInline = JsonRequest<EditMessageReplyMarkupInline>; type StopPoll = JsonRequest<StopPoll>; type DeleteMessage = JsonRequest<DeleteMessage>; type SendSticker = MultipartRequest<SendSticker>; type GetStickerSet = JsonRequest<GetStickerSet>; type UploadStickerFile = MultipartRequest<UploadStickerFile>; type CreateNewStickerSet = MultipartRequest<CreateNewStickerSet>; type AddStickerToSet = MultipartRequest<AddStickerToSet>; type SetStickerPositionInSet = JsonRequest<SetStickerPositionInSet>; type DeleteStickerFromSet = JsonRequest<DeleteStickerFromSet>; type SetStickerSetThumb = MultipartRequest<SetStickerSetThumb>; type SendInvoice = JsonRequest<SendInvoice>; type CreateInvoiceLink = JsonRequest<CreateInvoiceLink>; type AnswerShippingQuery = JsonRequest<AnswerShippingQuery>; type AnswerPreCheckoutQuery = JsonRequest<AnswerPreCheckoutQuery>; type SetPassportDataErrors = JsonRequest<SetPassportDataErrors>; type SendGame = JsonRequest<SendGame>; type SetGameScore = JsonRequest<SetGameScore>; type SetGameScoreInline = JsonRequest<SetGameScoreInline>; type GetGameHighScores = JsonRequest<GetGameHighScores>; type LogOut = JsonRequest<LogOut>; type Close = JsonRequest<Close>; type CopyMessage = JsonRequest<CopyMessage>; type UnpinAllChatMessages = JsonRequest<UnpinAllChatMessages>;
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl<'w> Download<'w> for Bot
impl<'w> Download<'w> for Bot
type Err = DownloadError
type Err = DownloadError
An error returned from download_file.
type Fut = Pin<Box<dyn Future<Output = Result<(), DownloadError>> + Send + 'w, Global>>
type Fut = Pin<Box<dyn Future<Output = Result<(), DownloadError>> + Send + 'w, Global>>
A future returned from download_file.
sourcefn download_file(
&self,
path: &str,
destination: &'w mut (dyn AsyncWrite + Unpin + Send)
) -> Self::Fut
fn download_file(
&self,
path: &str,
destination: &'w mut (dyn AsyncWrite + Unpin + Send)
) -> Self::Fut
Download a file from Telegram into destination. Read more
type StreamErr = Error
type StreamErr = Error
An error returned from
download_file_stream. Read more
type Stream = Pin<Box<dyn Stream<Item = Result<Bytes, Error>> + Send + 'static, Global>>
type Stream = Pin<Box<dyn Stream<Item = Result<Bytes, Error>> + Send + 'static, Global>>
A stream returned from download_file_stream. Read more
sourcefn download_file_stream(&self, path: &str) -> Self::Stream
fn download_file_stream(&self, path: &str) -> Self::Stream
Download a file from Telegram as [Stream]. Read more
sourceimpl Requester for Bot
impl Requester for Bot
type Err = RequestError
type Err = RequestError
Error type returned by all requests.
type GetUpdates = JsonRequest<GetUpdates>
sourcefn get_updates(&self) -> Self::GetUpdates
fn get_updates(&self) -> Self::GetUpdates
For Telegram documentation see GetUpdates.
type SetWebhook = JsonRequest<SetWebhook>
sourcefn set_webhook(&self, url: Url) -> Self::SetWebhook
fn set_webhook(&self, url: Url) -> Self::SetWebhook
For Telegram documentation see SetWebhook.
type DeleteWebhook = JsonRequest<DeleteWebhook>
sourcefn delete_webhook(&self) -> Self::DeleteWebhook
fn delete_webhook(&self) -> Self::DeleteWebhook
For Telegram documentation see DeleteWebhook.
type GetWebhookInfo = JsonRequest<GetWebhookInfo>
sourcefn get_webhook_info(&self) -> Self::GetWebhookInfo
fn get_webhook_info(&self) -> Self::GetWebhookInfo
For Telegram documentation see GetWebhookInfo.
type GetMe = JsonRequest<GetMe>
type SendMessage = JsonRequest<SendMessage>
sourcefn send_message<C, T>(&self, chat_id: C, text: T) -> Self::SendMessage where
C: Into<Recipient>,
T: Into<String>,
fn send_message<C, T>(&self, chat_id: C, text: T) -> Self::SendMessage where
C: Into<Recipient>,
T: Into<String>,
For Telegram documentation see SendMessage.
type ForwardMessage = JsonRequest<ForwardMessage>
sourcefn forward_message<C, F>(
&self,
chat_id: C,
from_chat_id: F,
message_id: i32
) -> Self::ForwardMessage where
C: Into<Recipient>,
F: Into<Recipient>,
fn forward_message<C, F>(
&self,
chat_id: C,
from_chat_id: F,
message_id: i32
) -> Self::ForwardMessage where
C: Into<Recipient>,
F: Into<Recipient>,
For Telegram documentation see ForwardMessage.
type SendPhoto = MultipartRequest<SendPhoto>
sourcefn send_photo<C>(&self, chat_id: C, photo: InputFile) -> Self::SendPhoto where
C: Into<Recipient>,
fn send_photo<C>(&self, chat_id: C, photo: InputFile) -> Self::SendPhoto where
C: Into<Recipient>,
For Telegram documentation see SendPhoto.
type SendAudio = MultipartRequest<SendAudio>
sourcefn send_audio<C>(&self, chat_id: C, audio: InputFile) -> Self::SendAudio where
C: Into<Recipient>,
fn send_audio<C>(&self, chat_id: C, audio: InputFile) -> Self::SendAudio where
C: Into<Recipient>,
For Telegram documentation see SendAudio.
type SendDocument = MultipartRequest<SendDocument>
sourcefn send_document<C>(&self, chat_id: C, document: InputFile) -> Self::SendDocument where
C: Into<Recipient>,
fn send_document<C>(&self, chat_id: C, document: InputFile) -> Self::SendDocument where
C: Into<Recipient>,
For Telegram documentation see SendDocument.
type SendVideo = MultipartRequest<SendVideo>
sourcefn send_video<C>(&self, chat_id: C, video: InputFile) -> Self::SendVideo where
C: Into<Recipient>,
fn send_video<C>(&self, chat_id: C, video: InputFile) -> Self::SendVideo where
C: Into<Recipient>,
For Telegram documentation see SendVideo.
type SendAnimation = MultipartRequest<SendAnimation>
sourcefn send_animation<C>(
&self,
chat_id: C,
animation: InputFile
) -> Self::SendAnimation where
C: Into<Recipient>,
fn send_animation<C>(
&self,
chat_id: C,
animation: InputFile
) -> Self::SendAnimation where
C: Into<Recipient>,
For Telegram documentation see SendAnimation.
type SendVoice = MultipartRequest<SendVoice>
sourcefn send_voice<C>(&self, chat_id: C, voice: InputFile) -> Self::SendVoice where
C: Into<Recipient>,
fn send_voice<C>(&self, chat_id: C, voice: InputFile) -> Self::SendVoice where
C: Into<Recipient>,
For Telegram documentation see SendVoice.
type SendVideoNote = MultipartRequest<SendVideoNote>
sourcefn send_video_note<C>(
&self,
chat_id: C,
video_note: InputFile
) -> Self::SendVideoNote where
C: Into<Recipient>,
fn send_video_note<C>(
&self,
chat_id: C,
video_note: InputFile
) -> Self::SendVideoNote where
C: Into<Recipient>,
For Telegram documentation see SendVideoNote.
type SendMediaGroup = MultipartRequest<SendMediaGroup>
sourcefn send_media_group<C, M>(&self, chat_id: C, media: M) -> Self::SendMediaGroup where
C: Into<Recipient>,
M: IntoIterator<Item = InputMedia>,
fn send_media_group<C, M>(&self, chat_id: C, media: M) -> Self::SendMediaGroup where
C: Into<Recipient>,
M: IntoIterator<Item = InputMedia>,
For Telegram documentation see SendMediaGroup.
type SendLocation = JsonRequest<SendLocation>
sourcefn send_location<C>(
&self,
chat_id: C,
latitude: f64,
longitude: f64
) -> Self::SendLocation where
C: Into<Recipient>,
fn send_location<C>(
&self,
chat_id: C,
latitude: f64,
longitude: f64
) -> Self::SendLocation where
C: Into<Recipient>,
For Telegram documentation see SendLocation.
type EditMessageLiveLocation = JsonRequest<EditMessageLiveLocation>
sourcefn edit_message_live_location<C>(
&self,
chat_id: C,
message_id: i32,
latitude: f64,
longitude: f64
) -> Self::EditMessageLiveLocation where
C: Into<Recipient>,
fn edit_message_live_location<C>(
&self,
chat_id: C,
message_id: i32,
latitude: f64,
longitude: f64
) -> Self::EditMessageLiveLocation where
C: Into<Recipient>,
For Telegram documentation see EditMessageLiveLocation.
type EditMessageLiveLocationInline = JsonRequest<EditMessageLiveLocationInline>
sourcefn edit_message_live_location_inline<I>(
&self,
inline_message_id: I,
latitude: f64,
longitude: f64
) -> Self::EditMessageLiveLocationInline where
I: Into<String>,
fn edit_message_live_location_inline<I>(
&self,
inline_message_id: I,
latitude: f64,
longitude: f64
) -> Self::EditMessageLiveLocationInline where
I: Into<String>,
For Telegram documentation see EditMessageLiveLocationInline.
type StopMessageLiveLocation = JsonRequest<StopMessageLiveLocation>
sourcefn stop_message_live_location<C>(
&self,
chat_id: C,
message_id: i32,
latitude: f64,
longitude: f64
) -> Self::StopMessageLiveLocation where
C: Into<Recipient>,
fn stop_message_live_location<C>(
&self,
chat_id: C,
message_id: i32,
latitude: f64,
longitude: f64
) -> Self::StopMessageLiveLocation where
C: Into<Recipient>,
For Telegram documentation see StopMessageLiveLocation.
type StopMessageLiveLocationInline = JsonRequest<StopMessageLiveLocationInline>
sourcefn stop_message_live_location_inline<I>(
&self,
inline_message_id: I,
latitude: f64,
longitude: f64
) -> Self::StopMessageLiveLocationInline where
I: Into<String>,
fn stop_message_live_location_inline<I>(
&self,
inline_message_id: I,
latitude: f64,
longitude: f64
) -> Self::StopMessageLiveLocationInline where
I: Into<String>,
For Telegram documentation see StopMessageLiveLocationInline.
type SendVenue = JsonRequest<SendVenue>
sourcefn send_venue<C, T, A>(
&self,
chat_id: C,
latitude: f64,
longitude: f64,
title: T,
address: A
) -> Self::SendVenue where
C: Into<Recipient>,
T: Into<String>,
A: Into<String>,
fn send_venue<C, T, A>(
&self,
chat_id: C,
latitude: f64,
longitude: f64,
title: T,
address: A
) -> Self::SendVenue where
C: Into<Recipient>,
T: Into<String>,
A: Into<String>,
For Telegram documentation see SendVenue.
type SendContact = JsonRequest<SendContact>
sourcefn send_contact<C, P, F>(
&self,
chat_id: C,
phone_number: P,
first_name: F
) -> Self::SendContact where
C: Into<Recipient>,
P: Into<String>,
F: Into<String>,
fn send_contact<C, P, F>(
&self,
chat_id: C,
phone_number: P,
first_name: F
) -> Self::SendContact where
C: Into<Recipient>,
P: Into<String>,
F: Into<String>,
For Telegram documentation see SendContact.
type SendPoll = JsonRequest<SendPoll>
sourcefn send_poll<C, Q, O>(&self, chat_id: C, question: Q, options: O) -> Self::SendPoll where
C: Into<Recipient>,
Q: Into<String>,
O: IntoIterator<Item = String>,
fn send_poll<C, Q, O>(&self, chat_id: C, question: Q, options: O) -> Self::SendPoll where
C: Into<Recipient>,
Q: Into<String>,
O: IntoIterator<Item = String>,
For Telegram documentation see SendPoll.
type SendDice = JsonRequest<SendDice>
sourcefn send_dice<C>(&self, chat_id: C) -> Self::SendDice where
C: Into<Recipient>,
fn send_dice<C>(&self, chat_id: C) -> Self::SendDice where
C: Into<Recipient>,
For Telegram documentation see SendDice.
type SendChatAction = JsonRequest<SendChatAction>
sourcefn send_chat_action<C>(
&self,
chat_id: C,
action: ChatAction
) -> Self::SendChatAction where
C: Into<Recipient>,
fn send_chat_action<C>(
&self,
chat_id: C,
action: ChatAction
) -> Self::SendChatAction where
C: Into<Recipient>,
For Telegram documentation see SendChatAction.
type GetUserProfilePhotos = JsonRequest<GetUserProfilePhotos>
sourcefn get_user_profile_photos(&self, user_id: UserId) -> Self::GetUserProfilePhotos
fn get_user_profile_photos(&self, user_id: UserId) -> Self::GetUserProfilePhotos
For Telegram documentation see GetUserProfilePhotos.
type GetFile = JsonRequest<GetFile>
sourcefn get_file<F>(&self, file_id: F) -> Self::GetFile where
F: Into<String>,
fn get_file<F>(&self, file_id: F) -> Self::GetFile where
F: Into<String>,
For Telegram documentation see GetFile.
type KickChatMember = JsonRequest<KickChatMember>
sourcefn kick_chat_member<C>(&self, chat_id: C, user_id: UserId) -> Self::KickChatMember where
C: Into<Recipient>,
fn kick_chat_member<C>(&self, chat_id: C, user_id: UserId) -> Self::KickChatMember where
C: Into<Recipient>,
For Telegram documentation see KickChatMember.
type BanChatMember = JsonRequest<BanChatMember>
sourcefn ban_chat_member<C>(&self, chat_id: C, user_id: UserId) -> Self::BanChatMember where
C: Into<Recipient>,
fn ban_chat_member<C>(&self, chat_id: C, user_id: UserId) -> Self::BanChatMember where
C: Into<Recipient>,
For Telegram documentation see BanChatMember.
type UnbanChatMember = JsonRequest<UnbanChatMember>
sourcefn unban_chat_member<C>(
&self,
chat_id: C,
user_id: UserId
) -> Self::UnbanChatMember where
C: Into<Recipient>,
fn unban_chat_member<C>(
&self,
chat_id: C,
user_id: UserId
) -> Self::UnbanChatMember where
C: Into<Recipient>,
For Telegram documentation see UnbanChatMember.
type RestrictChatMember = JsonRequest<RestrictChatMember>
sourcefn restrict_chat_member<C>(
&self,
chat_id: C,
user_id: UserId,
permissions: ChatPermissions
) -> Self::RestrictChatMember where
C: Into<Recipient>,
fn restrict_chat_member<C>(
&self,
chat_id: C,
user_id: UserId,
permissions: ChatPermissions
) -> Self::RestrictChatMember where
C: Into<Recipient>,
For Telegram documentation see RestrictChatMember.
type PromoteChatMember = JsonRequest<PromoteChatMember>
sourcefn promote_chat_member<C>(
&self,
chat_id: C,
user_id: UserId
) -> Self::PromoteChatMember where
C: Into<Recipient>,
fn promote_chat_member<C>(
&self,
chat_id: C,
user_id: UserId
) -> Self::PromoteChatMember where
C: Into<Recipient>,
For Telegram documentation see PromoteChatMember.
type SetChatAdministratorCustomTitle = JsonRequest<SetChatAdministratorCustomTitle>
sourcefn set_chat_administrator_custom_title<Ch, Cu>(
&self,
chat_id: Ch,
user_id: UserId,
custom_title: Cu
) -> Self::SetChatAdministratorCustomTitle where
Ch: Into<Recipient>,
Cu: Into<String>,
fn set_chat_administrator_custom_title<Ch, Cu>(
&self,
chat_id: Ch,
user_id: UserId,
custom_title: Cu
) -> Self::SetChatAdministratorCustomTitle where
Ch: Into<Recipient>,
Cu: Into<String>,
For Telegram documentation see SetChatAdministratorCustomTitle.
type BanChatSenderChat = JsonRequest<BanChatSenderChat>
sourcefn ban_chat_sender_chat<C, S>(
&self,
chat_id: C,
sender_chat_id: S
) -> Self::BanChatSenderChat where
C: Into<Recipient>,
S: Into<ChatId>,
fn ban_chat_sender_chat<C, S>(
&self,
chat_id: C,
sender_chat_id: S
) -> Self::BanChatSenderChat where
C: Into<Recipient>,
S: Into<ChatId>,
For Telegram documentation see BanChatSenderChat.
type UnbanChatSenderChat = JsonRequest<UnbanChatSenderChat>
sourcefn unban_chat_sender_chat<C, S>(
&self,
chat_id: C,
sender_chat_id: S
) -> Self::UnbanChatSenderChat where
C: Into<Recipient>,
S: Into<ChatId>,
fn unban_chat_sender_chat<C, S>(
&self,
chat_id: C,
sender_chat_id: S
) -> Self::UnbanChatSenderChat where
C: Into<Recipient>,
S: Into<ChatId>,
For Telegram documentation see UnbanChatSenderChat.
type SetChatPermissions = JsonRequest<SetChatPermissions>
sourcefn set_chat_permissions<C>(
&self,
chat_id: C,
permissions: ChatPermissions
) -> Self::SetChatPermissions where
C: Into<Recipient>,
fn set_chat_permissions<C>(
&self,
chat_id: C,
permissions: ChatPermissions
) -> Self::SetChatPermissions where
C: Into<Recipient>,
For Telegram documentation see SetChatPermissions.
type ExportChatInviteLink = JsonRequest<ExportChatInviteLink>
sourcefn export_chat_invite_link<C>(&self, chat_id: C) -> Self::ExportChatInviteLink where
C: Into<Recipient>,
fn export_chat_invite_link<C>(&self, chat_id: C) -> Self::ExportChatInviteLink where
C: Into<Recipient>,
For Telegram documentation see ExportChatInviteLink.
type CreateChatInviteLink = JsonRequest<CreateChatInviteLink>
sourcefn create_chat_invite_link<C>(&self, chat_id: C) -> Self::CreateChatInviteLink where
C: Into<Recipient>,
fn create_chat_invite_link<C>(&self, chat_id: C) -> Self::CreateChatInviteLink where
C: Into<Recipient>,
For Telegram documentation see CreateChatInviteLink.
type EditChatInviteLink = JsonRequest<EditChatInviteLink>
sourcefn edit_chat_invite_link<C, I>(
&self,
chat_id: C,
invite_link: I
) -> Self::EditChatInviteLink where
C: Into<Recipient>,
I: Into<String>,
fn edit_chat_invite_link<C, I>(
&self,
chat_id: C,
invite_link: I
) -> Self::EditChatInviteLink where
C: Into<Recipient>,
I: Into<String>,
For Telegram documentation see EditChatInviteLink.
type RevokeChatInviteLink = JsonRequest<RevokeChatInviteLink>
sourcefn revoke_chat_invite_link<C, I>(
&self,
chat_id: C,
invite_link: I
) -> Self::RevokeChatInviteLink where
C: Into<Recipient>,
I: Into<String>,
fn revoke_chat_invite_link<C, I>(
&self,
chat_id: C,
invite_link: I
) -> Self::RevokeChatInviteLink where
C: Into<Recipient>,
I: Into<String>,
For Telegram documentation see RevokeChatInviteLink.
type ApproveChatJoinRequest = JsonRequest<ApproveChatJoinRequest>
sourcefn approve_chat_join_request<C>(
&self,
chat_id: C,
user_id: UserId
) -> Self::ApproveChatJoinRequest where
C: Into<Recipient>,
fn approve_chat_join_request<C>(
&self,
chat_id: C,
user_id: UserId
) -> Self::ApproveChatJoinRequest where
C: Into<Recipient>,
For Telegram documentation see ApproveChatJoinRequest.
type DeclineChatJoinRequest = JsonRequest<DeclineChatJoinRequest>
sourcefn decline_chat_join_request<C>(
&self,
chat_id: C,
user_id: UserId
) -> Self::DeclineChatJoinRequest where
C: Into<Recipient>,
fn decline_chat_join_request<C>(
&self,
chat_id: C,
user_id: UserId
) -> Self::DeclineChatJoinRequest where
C: Into<Recipient>,
For Telegram documentation see DeclineChatJoinRequest.
type SetChatPhoto = MultipartRequest<SetChatPhoto>
sourcefn set_chat_photo<C>(&self, chat_id: C, photo: InputFile) -> Self::SetChatPhoto where
C: Into<Recipient>,
fn set_chat_photo<C>(&self, chat_id: C, photo: InputFile) -> Self::SetChatPhoto where
C: Into<Recipient>,
For Telegram documentation see SetChatPhoto.
type DeleteChatPhoto = JsonRequest<DeleteChatPhoto>
sourcefn delete_chat_photo<C>(&self, chat_id: C) -> Self::DeleteChatPhoto where
C: Into<Recipient>,
fn delete_chat_photo<C>(&self, chat_id: C) -> Self::DeleteChatPhoto where
C: Into<Recipient>,
For Telegram documentation see DeleteChatPhoto.
type SetChatTitle = JsonRequest<SetChatTitle>
sourcefn set_chat_title<C, T>(&self, chat_id: C, title: T) -> Self::SetChatTitle where
C: Into<Recipient>,
T: Into<String>,
fn set_chat_title<C, T>(&self, chat_id: C, title: T) -> Self::SetChatTitle where
C: Into<Recipient>,
T: Into<String>,
For Telegram documentation see SetChatTitle.
type SetChatDescription = JsonRequest<SetChatDescription>
sourcefn set_chat_description<C>(&self, chat_id: C) -> Self::SetChatDescription where
C: Into<Recipient>,
fn set_chat_description<C>(&self, chat_id: C) -> Self::SetChatDescription where
C: Into<Recipient>,
For Telegram documentation see SetChatDescription.
type PinChatMessage = JsonRequest<PinChatMessage>
sourcefn pin_chat_message<C>(&self, chat_id: C, message_id: i32) -> Self::PinChatMessage where
C: Into<Recipient>,
fn pin_chat_message<C>(&self, chat_id: C, message_id: i32) -> Self::PinChatMessage where
C: Into<Recipient>,
For Telegram documentation see PinChatMessage.
type UnpinChatMessage = JsonRequest<UnpinChatMessage>
sourcefn unpin_chat_message<C>(&self, chat_id: C) -> Self::UnpinChatMessage where
C: Into<Recipient>,
fn unpin_chat_message<C>(&self, chat_id: C) -> Self::UnpinChatMessage where
C: Into<Recipient>,
For Telegram documentation see UnpinChatMessage.
type LeaveChat = JsonRequest<LeaveChat>
sourcefn leave_chat<C>(&self, chat_id: C) -> Self::LeaveChat where
C: Into<Recipient>,
fn leave_chat<C>(&self, chat_id: C) -> Self::LeaveChat where
C: Into<Recipient>,
For Telegram documentation see LeaveChat.
type GetChat = JsonRequest<GetChat>
sourcefn get_chat<C>(&self, chat_id: C) -> Self::GetChat where
C: Into<Recipient>,
fn get_chat<C>(&self, chat_id: C) -> Self::GetChat where
C: Into<Recipient>,
For Telegram documentation see GetChat.
type GetChatAdministrators = JsonRequest<GetChatAdministrators>
sourcefn get_chat_administrators<C>(&self, chat_id: C) -> Self::GetChatAdministrators where
C: Into<Recipient>,
fn get_chat_administrators<C>(&self, chat_id: C) -> Self::GetChatAdministrators where
C: Into<Recipient>,
For Telegram documentation see GetChatAdministrators.
type GetChatMembersCount = JsonRequest<GetChatMembersCount>
sourcefn get_chat_members_count<C>(&self, chat_id: C) -> Self::GetChatMembersCount where
C: Into<Recipient>,
fn get_chat_members_count<C>(&self, chat_id: C) -> Self::GetChatMembersCount where
C: Into<Recipient>,
For Telegram documentation see GetChatMembersCount.
type GetChatMemberCount = JsonRequest<GetChatMemberCount>
sourcefn get_chat_member_count<C>(&self, chat_id: C) -> Self::GetChatMemberCount where
C: Into<Recipient>,
fn get_chat_member_count<C>(&self, chat_id: C) -> Self::GetChatMemberCount where
C: Into<Recipient>,
For Telegram documentation see GetChatMemberCount.
type GetChatMember = JsonRequest<GetChatMember>
sourcefn get_chat_member<C>(&self, chat_id: C, user_id: UserId) -> Self::GetChatMember where
C: Into<Recipient>,
fn get_chat_member<C>(&self, chat_id: C, user_id: UserId) -> Self::GetChatMember where
C: Into<Recipient>,
For Telegram documentation see GetChatMember.
type SetChatStickerSet = JsonRequest<SetChatStickerSet>
sourcefn set_chat_sticker_set<C, S>(
&self,
chat_id: C,
sticker_set_name: S
) -> Self::SetChatStickerSet where
C: Into<Recipient>,
S: Into<String>,
fn set_chat_sticker_set<C, S>(
&self,
chat_id: C,
sticker_set_name: S
) -> Self::SetChatStickerSet where
C: Into<Recipient>,
S: Into<String>,
For Telegram documentation see SetChatStickerSet.
type DeleteChatStickerSet = JsonRequest<DeleteChatStickerSet>
sourcefn delete_chat_sticker_set<C>(&self, chat_id: C) -> Self::DeleteChatStickerSet where
C: Into<Recipient>,
fn delete_chat_sticker_set<C>(&self, chat_id: C) -> Self::DeleteChatStickerSet where
C: Into<Recipient>,
For Telegram documentation see DeleteChatStickerSet.
type AnswerCallbackQuery = JsonRequest<AnswerCallbackQuery>
sourcefn answer_callback_query<C>(
&self,
callback_query_id: C
) -> Self::AnswerCallbackQuery where
C: Into<String>,
fn answer_callback_query<C>(
&self,
callback_query_id: C
) -> Self::AnswerCallbackQuery where
C: Into<String>,
For Telegram documentation see AnswerCallbackQuery.
type SetMyCommands = JsonRequest<SetMyCommands>
sourcefn set_my_commands<C>(&self, commands: C) -> Self::SetMyCommands where
C: IntoIterator<Item = BotCommand>,
fn set_my_commands<C>(&self, commands: C) -> Self::SetMyCommands where
C: IntoIterator<Item = BotCommand>,
For Telegram documentation see SetMyCommands.
type GetMyCommands = JsonRequest<GetMyCommands>
sourcefn get_my_commands(&self) -> Self::GetMyCommands
fn get_my_commands(&self) -> Self::GetMyCommands
For Telegram documentation see GetMyCommands.
type SetChatMenuButton = JsonRequest<SetChatMenuButton>
For Telegram documentation see SetChatMenuButton.
type GetChatMenuButton = JsonRequest<GetChatMenuButton>
For Telegram documentation see GetChatMenuButton.
type SetMyDefaultAdministratorRights = JsonRequest<SetMyDefaultAdministratorRights>
sourcefn set_my_default_administrator_rights(
&self
) -> Self::SetMyDefaultAdministratorRights
fn set_my_default_administrator_rights(
&self
) -> Self::SetMyDefaultAdministratorRights
For Telegram documentation see SetMyDefaultAdministratorRights.
type GetMyDefaultAdministratorRights = JsonRequest<GetMyDefaultAdministratorRights>
sourcefn get_my_default_administrator_rights(
&self
) -> Self::GetMyDefaultAdministratorRights
fn get_my_default_administrator_rights(
&self
) -> Self::GetMyDefaultAdministratorRights
For Telegram documentation see GetMyDefaultAdministratorRights.
type DeleteMyCommands = JsonRequest<DeleteMyCommands>
sourcefn delete_my_commands(&self) -> Self::DeleteMyCommands
fn delete_my_commands(&self) -> Self::DeleteMyCommands
For Telegram documentation see DeleteMyCommands.
type AnswerInlineQuery = JsonRequest<AnswerInlineQuery>
sourcefn answer_inline_query<I, R>(
&self,
inline_query_id: I,
results: R
) -> Self::AnswerInlineQuery where
I: Into<String>,
R: IntoIterator<Item = InlineQueryResult>,
fn answer_inline_query<I, R>(
&self,
inline_query_id: I,
results: R
) -> Self::AnswerInlineQuery where
I: Into<String>,
R: IntoIterator<Item = InlineQueryResult>,
For Telegram documentation see AnswerInlineQuery.
type AnswerWebAppQuery = JsonRequest<AnswerWebAppQuery>
sourcefn answer_web_app_query<W>(
&self,
web_app_query_id: W,
result: InlineQueryResult
) -> Self::AnswerWebAppQuery where
W: Into<String>,
fn answer_web_app_query<W>(
&self,
web_app_query_id: W,
result: InlineQueryResult
) -> Self::AnswerWebAppQuery where
W: Into<String>,
For Telegram documentation see AnswerWebAppQuery.
type EditMessageText = JsonRequest<EditMessageText>
sourcefn edit_message_text<C, T>(
&self,
chat_id: C,
message_id: i32,
text: T
) -> Self::EditMessageText where
C: Into<Recipient>,
T: Into<String>,
fn edit_message_text<C, T>(
&self,
chat_id: C,
message_id: i32,
text: T
) -> Self::EditMessageText where
C: Into<Recipient>,
T: Into<String>,
For Telegram documentation see EditMessageText.
type EditMessageTextInline = JsonRequest<EditMessageTextInline>
sourcefn edit_message_text_inline<I, T>(
&self,
inline_message_id: I,
text: T
) -> Self::EditMessageTextInline where
I: Into<String>,
T: Into<String>,
fn edit_message_text_inline<I, T>(
&self,
inline_message_id: I,
text: T
) -> Self::EditMessageTextInline where
I: Into<String>,
T: Into<String>,
For Telegram documentation see EditMessageTextInline.
type EditMessageCaption = JsonRequest<EditMessageCaption>
sourcefn edit_message_caption<C>(
&self,
chat_id: C,
message_id: i32
) -> Self::EditMessageCaption where
C: Into<Recipient>,
fn edit_message_caption<C>(
&self,
chat_id: C,
message_id: i32
) -> Self::EditMessageCaption where
C: Into<Recipient>,
For Telegram documentation see EditMessageCaption.
type EditMessageCaptionInline = JsonRequest<EditMessageCaptionInline>
sourcefn edit_message_caption_inline<I>(
&self,
inline_message_id: I
) -> Self::EditMessageCaptionInline where
I: Into<String>,
fn edit_message_caption_inline<I>(
&self,
inline_message_id: I
) -> Self::EditMessageCaptionInline where
I: Into<String>,
For Telegram documentation see EditMessageCaptionInline.
type EditMessageMedia = MultipartRequest<EditMessageMedia>
sourcefn edit_message_media<C>(
&self,
chat_id: C,
message_id: i32,
media: InputMedia
) -> Self::EditMessageMedia where
C: Into<Recipient>,
fn edit_message_media<C>(
&self,
chat_id: C,
message_id: i32,
media: InputMedia
) -> Self::EditMessageMedia where
C: Into<Recipient>,
For Telegram documentation see EditMessageMedia.
type EditMessageMediaInline = MultipartRequest<EditMessageMediaInline>
sourcefn edit_message_media_inline<I>(
&self,
inline_message_id: I,
media: InputMedia
) -> Self::EditMessageMediaInline where
I: Into<String>,
fn edit_message_media_inline<I>(
&self,
inline_message_id: I,
media: InputMedia
) -> Self::EditMessageMediaInline where
I: Into<String>,
For Telegram documentation see EditMessageMediaInline.
type EditMessageReplyMarkup = JsonRequest<EditMessageReplyMarkup>
sourcefn edit_message_reply_markup<C>(
&self,
chat_id: C,
message_id: i32
) -> Self::EditMessageReplyMarkup where
C: Into<Recipient>,
fn edit_message_reply_markup<C>(
&self,
chat_id: C,
message_id: i32
) -> Self::EditMessageReplyMarkup where
C: Into<Recipient>,
For Telegram documentation see EditMessageReplyMarkup.
type EditMessageReplyMarkupInline = JsonRequest<EditMessageReplyMarkupInline>
sourcefn edit_message_reply_markup_inline<I>(
&self,
inline_message_id: I
) -> Self::EditMessageReplyMarkupInline where
I: Into<String>,
fn edit_message_reply_markup_inline<I>(
&self,
inline_message_id: I
) -> Self::EditMessageReplyMarkupInline where
I: Into<String>,
For Telegram documentation see EditMessageReplyMarkupInline.
type StopPoll = JsonRequest<StopPoll>
sourcefn stop_poll<C>(&self, chat_id: C, message_id: i32) -> Self::StopPoll where
C: Into<Recipient>,
fn stop_poll<C>(&self, chat_id: C, message_id: i32) -> Self::StopPoll where
C: Into<Recipient>,
For Telegram documentation see StopPoll.
type DeleteMessage = JsonRequest<DeleteMessage>
sourcefn delete_message<C>(&self, chat_id: C, message_id: i32) -> Self::DeleteMessage where
C: Into<Recipient>,
fn delete_message<C>(&self, chat_id: C, message_id: i32) -> Self::DeleteMessage where
C: Into<Recipient>,
For Telegram documentation see DeleteMessage.
type SendSticker = MultipartRequest<SendSticker>
sourcefn send_sticker<C>(&self, chat_id: C, sticker: InputFile) -> Self::SendSticker where
C: Into<Recipient>,
fn send_sticker<C>(&self, chat_id: C, sticker: InputFile) -> Self::SendSticker where
C: Into<Recipient>,
For Telegram documentation see SendSticker.
type GetStickerSet = JsonRequest<GetStickerSet>
sourcefn get_sticker_set<N>(&self, name: N) -> Self::GetStickerSet where
N: Into<String>,
fn get_sticker_set<N>(&self, name: N) -> Self::GetStickerSet where
N: Into<String>,
For Telegram documentation see GetStickerSet.
type UploadStickerFile = MultipartRequest<UploadStickerFile>
sourcefn upload_sticker_file(
&self,
user_id: UserId,
png_sticker: InputFile
) -> Self::UploadStickerFile
fn upload_sticker_file(
&self,
user_id: UserId,
png_sticker: InputFile
) -> Self::UploadStickerFile
For Telegram documentation see UploadStickerFile.
type CreateNewStickerSet = MultipartRequest<CreateNewStickerSet>
sourcefn create_new_sticker_set<N, T, E>(
&self,
user_id: UserId,
name: N,
title: T,
sticker: InputSticker,
emojis: E
) -> Self::CreateNewStickerSet where
N: Into<String>,
T: Into<String>,
E: Into<String>,
fn create_new_sticker_set<N, T, E>(
&self,
user_id: UserId,
name: N,
title: T,
sticker: InputSticker,
emojis: E
) -> Self::CreateNewStickerSet where
N: Into<String>,
T: Into<String>,
E: Into<String>,
For Telegram documentation see CreateNewStickerSet.
type AddStickerToSet = MultipartRequest<AddStickerToSet>
sourcefn add_sticker_to_set<N, E>(
&self,
user_id: UserId,
name: N,
sticker: InputSticker,
emojis: E
) -> Self::AddStickerToSet where
N: Into<String>,
E: Into<String>,
fn add_sticker_to_set<N, E>(
&self,
user_id: UserId,
name: N,
sticker: InputSticker,
emojis: E
) -> Self::AddStickerToSet where
N: Into<String>,
E: Into<String>,
For Telegram documentation see AddStickerToSet.
type SetStickerPositionInSet = JsonRequest<SetStickerPositionInSet>
sourcefn set_sticker_position_in_set<S>(
&self,
sticker: S,
position: u32
) -> Self::SetStickerPositionInSet where
S: Into<String>,
fn set_sticker_position_in_set<S>(
&self,
sticker: S,
position: u32
) -> Self::SetStickerPositionInSet where
S: Into<String>,
For Telegram documentation see SetStickerPositionInSet.
type DeleteStickerFromSet = JsonRequest<DeleteStickerFromSet>
sourcefn delete_sticker_from_set<S>(&self, sticker: S) -> Self::DeleteStickerFromSet where
S: Into<String>,
fn delete_sticker_from_set<S>(&self, sticker: S) -> Self::DeleteStickerFromSet where
S: Into<String>,
For Telegram documentation see DeleteStickerFromSet.
type SetStickerSetThumb = MultipartRequest<SetStickerSetThumb>
sourcefn set_sticker_set_thumb<N>(
&self,
name: N,
user_id: UserId
) -> Self::SetStickerSetThumb where
N: Into<String>,
fn set_sticker_set_thumb<N>(
&self,
name: N,
user_id: UserId
) -> Self::SetStickerSetThumb where
N: Into<String>,
For Telegram documentation see SetStickerSetThumb.
type SendInvoice = JsonRequest<SendInvoice>
sourcefn send_invoice<Ch, T, D, Pa, P, C, Pri>(
&self,
chat_id: Ch,
title: T,
description: D,
payload: Pa,
provider_token: P,
currency: C,
prices: Pri
) -> Self::SendInvoice where
Ch: Into<Recipient>,
T: Into<String>,
D: Into<String>,
Pa: Into<String>,
P: Into<String>,
C: Into<String>,
Pri: IntoIterator<Item = LabeledPrice>,
fn send_invoice<Ch, T, D, Pa, P, C, Pri>(
&self,
chat_id: Ch,
title: T,
description: D,
payload: Pa,
provider_token: P,
currency: C,
prices: Pri
) -> Self::SendInvoice where
Ch: Into<Recipient>,
T: Into<String>,
D: Into<String>,
Pa: Into<String>,
P: Into<String>,
C: Into<String>,
Pri: IntoIterator<Item = LabeledPrice>,
For Telegram documentation see SendInvoice.
type CreateInvoiceLink = JsonRequest<CreateInvoiceLink>
sourcefn create_invoice_link<T, D, Pa, P, C, Pri>(
&self,
title: T,
description: D,
payload: Pa,
provider_token: P,
currency: C,
prices: Pri
) -> Self::CreateInvoiceLink where
T: Into<String>,
D: Into<String>,
Pa: Into<String>,
P: Into<String>,
C: Into<String>,
Pri: IntoIterator<Item = LabeledPrice>,
fn create_invoice_link<T, D, Pa, P, C, Pri>(
&self,
title: T,
description: D,
payload: Pa,
provider_token: P,
currency: C,
prices: Pri
) -> Self::CreateInvoiceLink where
T: Into<String>,
D: Into<String>,
Pa: Into<String>,
P: Into<String>,
C: Into<String>,
Pri: IntoIterator<Item = LabeledPrice>,
For Telegram documentation see CreateInvoiceLink.
type AnswerShippingQuery = JsonRequest<AnswerShippingQuery>
sourcefn answer_shipping_query<S>(
&self,
shipping_query_id: S,
ok: bool
) -> Self::AnswerShippingQuery where
S: Into<String>,
fn answer_shipping_query<S>(
&self,
shipping_query_id: S,
ok: bool
) -> Self::AnswerShippingQuery where
S: Into<String>,
For Telegram documentation see AnswerShippingQuery.
type AnswerPreCheckoutQuery = JsonRequest<AnswerPreCheckoutQuery>
sourcefn answer_pre_checkout_query<P>(
&self,
pre_checkout_query_id: P,
ok: bool
) -> Self::AnswerPreCheckoutQuery where
P: Into<String>,
fn answer_pre_checkout_query<P>(
&self,
pre_checkout_query_id: P,
ok: bool
) -> Self::AnswerPreCheckoutQuery where
P: Into<String>,
For Telegram documentation see AnswerPreCheckoutQuery.
type SetPassportDataErrors = JsonRequest<SetPassportDataErrors>
sourcefn set_passport_data_errors<E>(
&self,
user_id: UserId,
errors: E
) -> Self::SetPassportDataErrors where
E: IntoIterator<Item = PassportElementError>,
fn set_passport_data_errors<E>(
&self,
user_id: UserId,
errors: E
) -> Self::SetPassportDataErrors where
E: IntoIterator<Item = PassportElementError>,
For Telegram documentation see SetPassportDataErrors.
type SendGame = JsonRequest<SendGame>
sourcefn send_game<G>(&self, chat_id: u32, game_short_name: G) -> Self::SendGame where
G: Into<String>,
fn send_game<G>(&self, chat_id: u32, game_short_name: G) -> Self::SendGame where
G: Into<String>,
For Telegram documentation see SendGame.
type SetGameScore = JsonRequest<SetGameScore>
sourcefn set_game_score(
&self,
user_id: UserId,
score: u64,
chat_id: u32,
message_id: i64
) -> Self::SetGameScore
fn set_game_score(
&self,
user_id: UserId,
score: u64,
chat_id: u32,
message_id: i64
) -> Self::SetGameScore
For Telegram documentation see SetGameScore.
type SetGameScoreInline = JsonRequest<SetGameScoreInline>
sourcefn set_game_score_inline<I>(
&self,
user_id: UserId,
score: u64,
inline_message_id: I
) -> Self::SetGameScoreInline where
I: Into<String>,
fn set_game_score_inline<I>(
&self,
user_id: UserId,
score: u64,
inline_message_id: I
) -> Self::SetGameScoreInline where
I: Into<String>,
For Telegram documentation see SetGameScoreInline.
type GetGameHighScores = JsonRequest<GetGameHighScores>
sourcefn get_game_high_scores<T>(
&self,
user_id: UserId,
target: T
) -> Self::GetGameHighScores where
T: Into<TargetMessage>,
fn get_game_high_scores<T>(
&self,
user_id: UserId,
target: T
) -> Self::GetGameHighScores where
T: Into<TargetMessage>,
For Telegram documentation see GetGameHighScores.
type LogOut = JsonRequest<LogOut>
type Close = JsonRequest<Close>
type CopyMessage = JsonRequest<CopyMessage>
sourcefn copy_message<C, F>(
&self,
chat_id: C,
from_chat_id: F,
message_id: i32
) -> Self::CopyMessage where
C: Into<Recipient>,
F: Into<Recipient>,
fn copy_message<C, F>(
&self,
chat_id: C,
from_chat_id: F,
message_id: i32
) -> Self::CopyMessage where
C: Into<Recipient>,
F: Into<Recipient>,
For Telegram documentation see CopyMessage.
type UnpinAllChatMessages = JsonRequest<UnpinAllChatMessages>
sourcefn unpin_all_chat_messages<C>(&self, chat_id: C) -> Self::UnpinAllChatMessages where
C: Into<Recipient>,
fn unpin_all_chat_messages<C>(&self, chat_id: C) -> Self::UnpinAllChatMessages where
C: Into<Recipient>,
For Telegram documentation see UnpinAllChatMessages.
Auto Trait Implementations
impl !RefUnwindSafe for Bot
impl Send for Bot
impl Sync for Bot
impl Unpin for Bot
impl !UnwindSafe for Bot
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Erasable for T
impl<T> Erasable for T
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
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
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more
