Struct teloxide_core::Bot [−][src]
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
impl Bot
[src]
Constructors
pub fn new<S>(token: S) -> Self where
S: Into<String>,
[src]
S: Into<String>,
Creates a new Bot
with the specified token and the default
http-client.
Panics
If it cannot create reqwest::Client
.
pub fn with_client<S>(token: S, client: Client) -> Self where
S: Into<String>,
[src]
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.
pub fn from_env() -> Self
[src]
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_TOKEN
environmental variable. - If it cannot create
reqwest::Client
.
pub fn from_env_with_client(client: Client) -> Self
[src]
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.
pub fn set_api_url(self, url: Url) -> Self
[src]
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().await
Multi-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/");
impl Bot
[src]
Getters
pub fn token(&self) -> &str
[src]
Returns currently used token.
pub fn client(&self) -> &Client
[src]
Returns currently used http-client.
pub fn api_url(&self) -> Url
[src]
Returns currently used token API url.
Trait Implementations
impl Clone for Bot
[src]
impl Debug for Bot
[src]
impl<'w> Download<'w> for Bot
[src]
type Err = DownloadError
An error returned from download_file
.
type Fut = BoxFuture<'w, Result<(), Self::Err>>
A future returned from download_file
.
fn download_file(
&self,
path: &str,
destination: &'w mut (dyn AsyncWrite + Unpin + Send)
) -> Self::Fut
[src]
&self,
path: &str,
destination: &'w mut (dyn AsyncWrite + Unpin + Send)
) -> Self::Fut
type StreamErr = Error
An error returned from
download_file_stream
. Read more
type Stream = BoxStream<'static, Result<Bytes, Self::StreamErr>>
A stream returned from download_file_stream
. Read more
fn download_file_stream(&self, path: &str) -> Self::Stream
[src]
impl Requester for Bot
[src]
type Err = RequestError
Error type returned by all requests.
type GetUpdates = JsonRequest<GetUpdates>
fn get_updates(&self) -> Self::GetUpdates
[src]
type SetWebhook = JsonRequest<SetWebhook>
fn set_webhook<U>(&self, url: U) -> Self::SetWebhook where
U: Into<String>,
[src]
U: Into<String>,
type DeleteWebhook = JsonRequest<DeleteWebhook>
fn delete_webhook(&self) -> Self::DeleteWebhook
[src]
type GetWebhookInfo = JsonRequest<GetWebhookInfo>
fn get_webhook_info(&self) -> Self::GetWebhookInfo
[src]
type GetMe = JsonRequest<GetMe>
fn get_me(&self) -> Self::GetMe
[src]
type SendMessage = JsonRequest<SendMessage>
fn send_message<C, T>(&self, chat_id: C, text: T) -> Self::SendMessage where
C: Into<ChatId>,
T: Into<String>,
[src]
C: Into<ChatId>,
T: Into<String>,
type ForwardMessage = JsonRequest<ForwardMessage>
fn forward_message<C, F>(
&self,
chat_id: C,
from_chat_id: F,
message_id: i32
) -> Self::ForwardMessage where
C: Into<ChatId>,
F: Into<ChatId>,
[src]
&self,
chat_id: C,
from_chat_id: F,
message_id: i32
) -> Self::ForwardMessage where
C: Into<ChatId>,
F: Into<ChatId>,
type SendPhoto = MultipartRequest<SendPhoto>
fn send_photo<C>(&self, chat_id: C, photo: InputFile) -> Self::SendPhoto where
C: Into<ChatId>,
[src]
C: Into<ChatId>,
type SendAudio = MultipartRequest<SendAudio>
fn send_audio<C>(&self, chat_id: C, audio: InputFile) -> Self::SendAudio where
C: Into<ChatId>,
[src]
C: Into<ChatId>,
type SendDocument = MultipartRequest<SendDocument>
fn send_document<C>(
&self,
chat_id: C,
document: InputFile
) -> Self::SendDocument where
C: Into<ChatId>,
[src]
&self,
chat_id: C,
document: InputFile
) -> Self::SendDocument where
C: Into<ChatId>,
type SendVideo = MultipartRequest<SendVideo>
fn send_video<C>(&self, chat_id: C, video: InputFile) -> Self::SendVideo where
C: Into<ChatId>,
[src]
C: Into<ChatId>,
type SendAnimation = MultipartRequest<SendAnimation>
fn send_animation<C>(
&self,
chat_id: C,
animation: InputFile
) -> Self::SendAnimation where
C: Into<ChatId>,
[src]
&self,
chat_id: C,
animation: InputFile
) -> Self::SendAnimation where
C: Into<ChatId>,
type SendVoice = MultipartRequest<SendVoice>
fn send_voice<C>(&self, chat_id: C, voice: InputFile) -> Self::SendVoice where
C: Into<ChatId>,
[src]
C: Into<ChatId>,
type SendVideoNote = MultipartRequest<SendVideoNote>
fn send_video_note<C>(
&self,
chat_id: C,
video_note: InputFile
) -> Self::SendVideoNote where
C: Into<ChatId>,
[src]
&self,
chat_id: C,
video_note: InputFile
) -> Self::SendVideoNote where
C: Into<ChatId>,
type SendMediaGroup = MultipartRequest<SendMediaGroup>
fn send_media_group<C, M>(&self, chat_id: C, media: M) -> Self::SendMediaGroup where
C: Into<ChatId>,
M: IntoIterator<Item = InputMedia>,
[src]
C: Into<ChatId>,
M: IntoIterator<Item = InputMedia>,
type SendLocation = JsonRequest<SendLocation>
fn send_location<C>(
&self,
chat_id: C,
latitude: f64,
longitude: f64
) -> Self::SendLocation where
C: Into<ChatId>,
[src]
&self,
chat_id: C,
latitude: f64,
longitude: f64
) -> Self::SendLocation where
C: Into<ChatId>,
type EditMessageLiveLocation = JsonRequest<EditMessageLiveLocation>
fn edit_message_live_location<C>(
&self,
chat_id: C,
message_id: i32,
latitude: f64,
longitude: f64
) -> Self::EditMessageLiveLocation where
C: Into<ChatId>,
[src]
&self,
chat_id: C,
message_id: i32,
latitude: f64,
longitude: f64
) -> Self::EditMessageLiveLocation where
C: Into<ChatId>,
type EditMessageLiveLocationInline = JsonRequest<EditMessageLiveLocationInline>
fn edit_message_live_location_inline<I>(
&self,
inline_message_id: I,
latitude: f64,
longitude: f64
) -> Self::EditMessageLiveLocationInline where
I: Into<String>,
[src]
&self,
inline_message_id: I,
latitude: f64,
longitude: f64
) -> Self::EditMessageLiveLocationInline where
I: Into<String>,
type StopMessageLiveLocation = JsonRequest<StopMessageLiveLocation>
fn stop_message_live_location<C>(
&self,
chat_id: C,
message_id: i32,
latitude: f64,
longitude: f64
) -> Self::StopMessageLiveLocation where
C: Into<ChatId>,
[src]
&self,
chat_id: C,
message_id: i32,
latitude: f64,
longitude: f64
) -> Self::StopMessageLiveLocation where
C: Into<ChatId>,
type StopMessageLiveLocationInline = JsonRequest<StopMessageLiveLocationInline>
fn stop_message_live_location_inline<I>(
&self,
inline_message_id: I,
latitude: f64,
longitude: f64
) -> Self::StopMessageLiveLocationInline where
I: Into<String>,
[src]
&self,
inline_message_id: I,
latitude: f64,
longitude: f64
) -> Self::StopMessageLiveLocationInline where
I: Into<String>,
type SendVenue = JsonRequest<SendVenue>
fn send_venue<C, T, A>(
&self,
chat_id: C,
latitude: f64,
longitude: f64,
title: T,
address: A
) -> Self::SendVenue where
C: Into<ChatId>,
T: Into<String>,
A: Into<String>,
[src]
&self,
chat_id: C,
latitude: f64,
longitude: f64,
title: T,
address: A
) -> Self::SendVenue where
C: Into<ChatId>,
T: Into<String>,
A: Into<String>,
type SendContact = JsonRequest<SendContact>
fn send_contact<C, P, F>(
&self,
chat_id: C,
phone_number: P,
first_name: F
) -> Self::SendContact where
C: Into<ChatId>,
P: Into<String>,
F: Into<String>,
[src]
&self,
chat_id: C,
phone_number: P,
first_name: F
) -> Self::SendContact where
C: Into<ChatId>,
P: Into<String>,
F: Into<String>,
type SendPoll = JsonRequest<SendPoll>
fn send_poll<C, Q, O>(
&self,
chat_id: C,
question: Q,
options: O,
type_: PollType
) -> Self::SendPoll where
C: Into<ChatId>,
Q: Into<String>,
O: IntoIterator<Item = String>,
[src]
&self,
chat_id: C,
question: Q,
options: O,
type_: PollType
) -> Self::SendPoll where
C: Into<ChatId>,
Q: Into<String>,
O: IntoIterator<Item = String>,
type SendDice = JsonRequest<SendDice>
fn send_dice<C>(&self, chat_id: C) -> Self::SendDice where
C: Into<ChatId>,
[src]
C: Into<ChatId>,
type SendChatAction = JsonRequest<SendChatAction>
fn send_chat_action<C>(
&self,
chat_id: C,
action: ChatAction
) -> Self::SendChatAction where
C: Into<ChatId>,
[src]
&self,
chat_id: C,
action: ChatAction
) -> Self::SendChatAction where
C: Into<ChatId>,
type GetUserProfilePhotos = JsonRequest<GetUserProfilePhotos>
fn get_user_profile_photos(&self, user_id: i64) -> Self::GetUserProfilePhotos
[src]
type GetFile = JsonRequest<GetFile>
fn get_file<F>(&self, file_id: F) -> Self::GetFile where
F: Into<String>,
[src]
F: Into<String>,
type KickChatMember = JsonRequest<KickChatMember>
fn kick_chat_member<C>(&self, chat_id: C, user_id: i64) -> Self::KickChatMember where
C: Into<ChatId>,
[src]
C: Into<ChatId>,
type UnbanChatMember = JsonRequest<UnbanChatMember>
fn unban_chat_member<C>(
&self,
chat_id: C,
user_id: i64
) -> Self::UnbanChatMember where
C: Into<ChatId>,
[src]
&self,
chat_id: C,
user_id: i64
) -> Self::UnbanChatMember where
C: Into<ChatId>,
type RestrictChatMember = JsonRequest<RestrictChatMember>
fn restrict_chat_member<C>(
&self,
chat_id: C,
user_id: i64,
permissions: ChatPermissions
) -> Self::RestrictChatMember where
C: Into<ChatId>,
[src]
&self,
chat_id: C,
user_id: i64,
permissions: ChatPermissions
) -> Self::RestrictChatMember where
C: Into<ChatId>,
type PromoteChatMember = JsonRequest<PromoteChatMember>
fn promote_chat_member<C>(
&self,
chat_id: C,
user_id: i64
) -> Self::PromoteChatMember where
C: Into<ChatId>,
[src]
&self,
chat_id: C,
user_id: i64
) -> Self::PromoteChatMember where
C: Into<ChatId>,
type SetChatAdministratorCustomTitle = JsonRequest<SetChatAdministratorCustomTitle>
fn set_chat_administrator_custom_title<Ch, Cu>(
&self,
chat_id: Ch,
user_id: i64,
custom_title: Cu
) -> Self::SetChatAdministratorCustomTitle where
Ch: Into<ChatId>,
Cu: Into<String>,
[src]
&self,
chat_id: Ch,
user_id: i64,
custom_title: Cu
) -> Self::SetChatAdministratorCustomTitle where
Ch: Into<ChatId>,
Cu: Into<String>,
type SetChatPermissions = JsonRequest<SetChatPermissions>
fn set_chat_permissions<C>(
&self,
chat_id: C,
permissions: ChatPermissions
) -> Self::SetChatPermissions where
C: Into<ChatId>,
[src]
&self,
chat_id: C,
permissions: ChatPermissions
) -> Self::SetChatPermissions where
C: Into<ChatId>,
type ExportChatInviteLink = JsonRequest<ExportChatInviteLink>
fn export_chat_invite_link<C>(&self, chat_id: C) -> Self::ExportChatInviteLink where
C: Into<ChatId>,
[src]
C: Into<ChatId>,
type CreateChatInviteLink = JsonRequest<CreateChatInviteLink>
fn create_chat_invite_link<C>(&self, chat_id: C) -> Self::CreateChatInviteLink where
C: Into<ChatId>,
[src]
C: Into<ChatId>,
type EditChatInviteLink = JsonRequest<EditChatInviteLink>
fn edit_chat_invite_link<C, I>(
&self,
chat_id: C,
invite_link: I
) -> Self::EditChatInviteLink where
C: Into<ChatId>,
I: Into<String>,
[src]
&self,
chat_id: C,
invite_link: I
) -> Self::EditChatInviteLink where
C: Into<ChatId>,
I: Into<String>,
type RevokeChatInviteLink = JsonRequest<RevokeChatInviteLink>
fn revoke_chat_invite_link<C, I>(
&self,
chat_id: C,
invite_link: I
) -> Self::RevokeChatInviteLink where
C: Into<ChatId>,
I: Into<String>,
[src]
&self,
chat_id: C,
invite_link: I
) -> Self::RevokeChatInviteLink where
C: Into<ChatId>,
I: Into<String>,
type SetChatPhoto = MultipartRequest<SetChatPhoto>
fn set_chat_photo<C>(&self, chat_id: C, photo: InputFile) -> Self::SetChatPhoto where
C: Into<ChatId>,
[src]
C: Into<ChatId>,
type DeleteChatPhoto = JsonRequest<DeleteChatPhoto>
fn delete_chat_photo<C>(&self, chat_id: C) -> Self::DeleteChatPhoto where
C: Into<ChatId>,
[src]
C: Into<ChatId>,
type SetChatTitle = JsonRequest<SetChatTitle>
fn set_chat_title<C, T>(&self, chat_id: C, title: T) -> Self::SetChatTitle where
C: Into<ChatId>,
T: Into<String>,
[src]
C: Into<ChatId>,
T: Into<String>,
type SetChatDescription = JsonRequest<SetChatDescription>
fn set_chat_description<C>(&self, chat_id: C) -> Self::SetChatDescription where
C: Into<ChatId>,
[src]
C: Into<ChatId>,
type PinChatMessage = JsonRequest<PinChatMessage>
fn pin_chat_message<C>(
&self,
chat_id: C,
message_id: i32
) -> Self::PinChatMessage where
C: Into<ChatId>,
[src]
&self,
chat_id: C,
message_id: i32
) -> Self::PinChatMessage where
C: Into<ChatId>,
type UnpinChatMessage = JsonRequest<UnpinChatMessage>
fn unpin_chat_message<C>(&self, chat_id: C) -> Self::UnpinChatMessage where
C: Into<ChatId>,
[src]
C: Into<ChatId>,
type LeaveChat = JsonRequest<LeaveChat>
fn leave_chat<C>(&self, chat_id: C) -> Self::LeaveChat where
C: Into<ChatId>,
[src]
C: Into<ChatId>,
type GetChat = JsonRequest<GetChat>
fn get_chat<C>(&self, chat_id: C) -> Self::GetChat where
C: Into<ChatId>,
[src]
C: Into<ChatId>,
type GetChatAdministrators = JsonRequest<GetChatAdministrators>
fn get_chat_administrators<C>(&self, chat_id: C) -> Self::GetChatAdministrators where
C: Into<ChatId>,
[src]
C: Into<ChatId>,
type GetChatMembersCount = JsonRequest<GetChatMembersCount>
fn get_chat_members_count<C>(&self, chat_id: C) -> Self::GetChatMembersCount where
C: Into<ChatId>,
[src]
C: Into<ChatId>,
type GetChatMember = JsonRequest<GetChatMember>
fn get_chat_member<C>(&self, chat_id: C, user_id: i64) -> Self::GetChatMember where
C: Into<ChatId>,
[src]
C: Into<ChatId>,
type SetChatStickerSet = JsonRequest<SetChatStickerSet>
fn set_chat_sticker_set<C, S>(
&self,
chat_id: C,
sticker_set_name: S
) -> Self::SetChatStickerSet where
C: Into<ChatId>,
S: Into<String>,
[src]
&self,
chat_id: C,
sticker_set_name: S
) -> Self::SetChatStickerSet where
C: Into<ChatId>,
S: Into<String>,
type DeleteChatStickerSet = JsonRequest<DeleteChatStickerSet>
fn delete_chat_sticker_set<C>(&self, chat_id: C) -> Self::DeleteChatStickerSet where
C: Into<ChatId>,
[src]
C: Into<ChatId>,
type AnswerCallbackQuery = JsonRequest<AnswerCallbackQuery>
fn answer_callback_query<C>(
&self,
callback_query_id: C
) -> Self::AnswerCallbackQuery where
C: Into<String>,
[src]
&self,
callback_query_id: C
) -> Self::AnswerCallbackQuery where
C: Into<String>,
type SetMyCommands = JsonRequest<SetMyCommands>
fn set_my_commands<C>(&self, commands: C) -> Self::SetMyCommands where
C: IntoIterator<Item = BotCommand>,
[src]
C: IntoIterator<Item = BotCommand>,
type GetMyCommands = JsonRequest<GetMyCommands>
fn get_my_commands(&self) -> Self::GetMyCommands
[src]
type AnswerInlineQuery = JsonRequest<AnswerInlineQuery>
fn answer_inline_query<I, R>(
&self,
inline_query_id: I,
results: R
) -> Self::AnswerInlineQuery where
I: Into<String>,
R: IntoIterator<Item = InlineQueryResult>,
[src]
&self,
inline_query_id: I,
results: R
) -> Self::AnswerInlineQuery where
I: Into<String>,
R: IntoIterator<Item = InlineQueryResult>,
type EditMessageText = JsonRequest<EditMessageText>
fn edit_message_text<C, T>(
&self,
chat_id: C,
message_id: i32,
text: T
) -> Self::EditMessageText where
C: Into<ChatId>,
T: Into<String>,
[src]
&self,
chat_id: C,
message_id: i32,
text: T
) -> Self::EditMessageText where
C: Into<ChatId>,
T: Into<String>,
type EditMessageTextInline = JsonRequest<EditMessageTextInline>
fn edit_message_text_inline<I, T>(
&self,
inline_message_id: I,
text: T
) -> Self::EditMessageTextInline where
I: Into<String>,
T: Into<String>,
[src]
&self,
inline_message_id: I,
text: T
) -> Self::EditMessageTextInline where
I: Into<String>,
T: Into<String>,
type EditMessageCaption = JsonRequest<EditMessageCaption>
fn edit_message_caption<C>(
&self,
chat_id: C,
message_id: i32
) -> Self::EditMessageCaption where
C: Into<ChatId>,
[src]
&self,
chat_id: C,
message_id: i32
) -> Self::EditMessageCaption where
C: Into<ChatId>,
type EditMessageCaptionInline = JsonRequest<EditMessageCaptionInline>
fn edit_message_caption_inline<I>(
&self,
inline_message_id: I
) -> Self::EditMessageCaptionInline where
I: Into<String>,
[src]
&self,
inline_message_id: I
) -> Self::EditMessageCaptionInline where
I: Into<String>,
type EditMessageMedia = MultipartRequest<EditMessageMedia>
fn edit_message_media<C>(
&self,
chat_id: C,
message_id: i32,
media: InputMedia
) -> Self::EditMessageMedia where
C: Into<ChatId>,
[src]
&self,
chat_id: C,
message_id: i32,
media: InputMedia
) -> Self::EditMessageMedia where
C: Into<ChatId>,
type EditMessageMediaInline = MultipartRequest<EditMessageMediaInline>
fn edit_message_media_inline<I>(
&self,
inline_message_id: I,
media: InputMedia
) -> Self::EditMessageMediaInline where
I: Into<String>,
[src]
&self,
inline_message_id: I,
media: InputMedia
) -> Self::EditMessageMediaInline where
I: Into<String>,
type EditMessageReplyMarkup = JsonRequest<EditMessageReplyMarkup>
fn edit_message_reply_markup<C>(
&self,
chat_id: C,
message_id: i32
) -> Self::EditMessageReplyMarkup where
C: Into<ChatId>,
[src]
&self,
chat_id: C,
message_id: i32
) -> Self::EditMessageReplyMarkup where
C: Into<ChatId>,
type EditMessageReplyMarkupInline = JsonRequest<EditMessageReplyMarkupInline>
fn edit_message_reply_markup_inline<I>(
&self,
inline_message_id: I
) -> Self::EditMessageReplyMarkupInline where
I: Into<String>,
[src]
&self,
inline_message_id: I
) -> Self::EditMessageReplyMarkupInline where
I: Into<String>,
type StopPoll = JsonRequest<StopPoll>
fn stop_poll<C>(&self, chat_id: C, message_id: i32) -> Self::StopPoll where
C: Into<ChatId>,
[src]
C: Into<ChatId>,
type DeleteMessage = JsonRequest<DeleteMessage>
fn delete_message<C>(&self, chat_id: C, message_id: i32) -> Self::DeleteMessage where
C: Into<ChatId>,
[src]
C: Into<ChatId>,
type SendSticker = MultipartRequest<SendSticker>
fn send_sticker<C>(&self, chat_id: C, sticker: InputFile) -> Self::SendSticker where
C: Into<ChatId>,
[src]
C: Into<ChatId>,
type GetStickerSet = JsonRequest<GetStickerSet>
fn get_sticker_set<N>(&self, name: N) -> Self::GetStickerSet where
N: Into<String>,
[src]
N: Into<String>,
type UploadStickerFile = MultipartRequest<UploadStickerFile>
fn upload_sticker_file(
&self,
user_id: i64,
png_sticker: InputFile
) -> Self::UploadStickerFile
[src]
&self,
user_id: i64,
png_sticker: InputFile
) -> Self::UploadStickerFile
type CreateNewStickerSet = MultipartRequest<CreateNewStickerSet>
fn create_new_sticker_set<N, T, E>(
&self,
user_id: i64,
name: N,
title: T,
sticker: InputSticker,
emojis: E
) -> Self::CreateNewStickerSet where
N: Into<String>,
T: Into<String>,
E: Into<String>,
[src]
&self,
user_id: i64,
name: N,
title: T,
sticker: InputSticker,
emojis: E
) -> Self::CreateNewStickerSet where
N: Into<String>,
T: Into<String>,
E: Into<String>,
type AddStickerToSet = MultipartRequest<AddStickerToSet>
fn add_sticker_to_set<N, E>(
&self,
user_id: i64,
name: N,
sticker: InputSticker,
emojis: E
) -> Self::AddStickerToSet where
N: Into<String>,
E: Into<String>,
[src]
&self,
user_id: i64,
name: N,
sticker: InputSticker,
emojis: E
) -> Self::AddStickerToSet where
N: Into<String>,
E: Into<String>,
type SetStickerPositionInSet = JsonRequest<SetStickerPositionInSet>
fn set_sticker_position_in_set<S>(
&self,
sticker: S,
position: u32
) -> Self::SetStickerPositionInSet where
S: Into<String>,
[src]
&self,
sticker: S,
position: u32
) -> Self::SetStickerPositionInSet where
S: Into<String>,
type DeleteStickerFromSet = JsonRequest<DeleteStickerFromSet>
fn delete_sticker_from_set<S>(&self, sticker: S) -> Self::DeleteStickerFromSet where
S: Into<String>,
[src]
S: Into<String>,
type SetStickerSetThumb = MultipartRequest<SetStickerSetThumb>
fn set_sticker_set_thumb<N>(
&self,
name: N,
user_id: i64
) -> Self::SetStickerSetThumb where
N: Into<String>,
[src]
&self,
name: N,
user_id: i64
) -> Self::SetStickerSetThumb where
N: Into<String>,
type SendInvoice = JsonRequest<SendInvoice>
fn send_invoice<T, D, Pa, P, S, C, Pri>(
&self,
chat_id: i32,
title: T,
description: D,
payload: Pa,
provider_token: P,
start_parameter: S,
currency: C,
prices: Pri
) -> Self::SendInvoice where
T: Into<String>,
D: Into<String>,
Pa: Into<String>,
P: Into<String>,
S: Into<String>,
C: Into<String>,
Pri: IntoIterator<Item = LabeledPrice>,
[src]
&self,
chat_id: i32,
title: T,
description: D,
payload: Pa,
provider_token: P,
start_parameter: S,
currency: C,
prices: Pri
) -> Self::SendInvoice where
T: Into<String>,
D: Into<String>,
Pa: Into<String>,
P: Into<String>,
S: Into<String>,
C: Into<String>,
Pri: IntoIterator<Item = LabeledPrice>,
type AnswerShippingQuery = JsonRequest<AnswerShippingQuery>
fn answer_shipping_query<S>(
&self,
shipping_query_id: S,
ok: bool
) -> Self::AnswerShippingQuery where
S: Into<String>,
[src]
&self,
shipping_query_id: S,
ok: bool
) -> Self::AnswerShippingQuery where
S: Into<String>,
type AnswerPreCheckoutQuery = JsonRequest<AnswerPreCheckoutQuery>
fn answer_pre_checkout_query<P>(
&self,
pre_checkout_query_id: P,
ok: bool
) -> Self::AnswerPreCheckoutQuery where
P: Into<String>,
[src]
&self,
pre_checkout_query_id: P,
ok: bool
) -> Self::AnswerPreCheckoutQuery where
P: Into<String>,
type SetPassportDataErrors = JsonRequest<SetPassportDataErrors>
fn set_passport_data_errors<E>(
&self,
user_id: i64,
errors: E
) -> Self::SetPassportDataErrors where
E: IntoIterator<Item = PassportElementError>,
[src]
&self,
user_id: i64,
errors: E
) -> Self::SetPassportDataErrors where
E: IntoIterator<Item = PassportElementError>,
type SendGame = JsonRequest<SendGame>
fn send_game<G>(&self, chat_id: u32, game_short_name: G) -> Self::SendGame where
G: Into<String>,
[src]
G: Into<String>,
type SetGameScore = JsonRequest<SetGameScore>
fn set_game_score(
&self,
user_id: i64,
score: u64,
chat_id: u32,
message_id: i64
) -> Self::SetGameScore
[src]
&self,
user_id: i64,
score: u64,
chat_id: u32,
message_id: i64
) -> Self::SetGameScore
type SetGameScoreInline = JsonRequest<SetGameScoreInline>
fn set_game_score_inline<I>(
&self,
user_id: i64,
score: u64,
inline_message_id: I
) -> Self::SetGameScoreInline where
I: Into<String>,
[src]
&self,
user_id: i64,
score: u64,
inline_message_id: I
) -> Self::SetGameScoreInline where
I: Into<String>,
type GetGameHighScores = JsonRequest<GetGameHighScores>
fn get_game_high_scores<T>(
&self,
user_id: i64,
target: T
) -> Self::GetGameHighScores where
T: Into<TargetMessage>,
[src]
&self,
user_id: i64,
target: T
) -> Self::GetGameHighScores where
T: Into<TargetMessage>,
type LogOut = JsonRequest<LogOut>
fn log_out(&self) -> Self::LogOut
[src]
type Close = JsonRequest<Close>
fn close(&self) -> Self::Close
[src]
type CopyMessage = JsonRequest<CopyMessage>
fn copy_message<C, F>(
&self,
chat_id: C,
from_chat_id: F,
message_id: i32
) -> Self::CopyMessage where
C: Into<ChatId>,
F: Into<ChatId>,
[src]
&self,
chat_id: C,
from_chat_id: F,
message_id: i32
) -> Self::CopyMessage where
C: Into<ChatId>,
F: Into<ChatId>,
type UnpinAllChatMessages = JsonRequest<UnpinAllChatMessages>
fn unpin_all_chat_messages<C>(&self, chat_id: C) -> Self::UnpinAllChatMessages where
C: Into<ChatId>,
[src]
C: Into<ChatId>,
type GetUpdatesFaultTolerant = JsonRequest<GetUpdatesFaultTolerant>
fn get_updates_fault_tolerant(&self) -> Self::GetUpdatesFaultTolerant
[src]
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
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,