[−][src]Struct tbot::Bot
Provides methods to call the Bots API.
A Bot
lets you call methods from the methods
module.
use tbot::prelude::*; let bot = tbot::bot!("BOT_TOKEN"); let me = bot .get_me() .into_future() .map(|me| { dbg!(me); }) .map_err(|err| { dbg!(err); }); tbot::run(me);
Besides, a Bot
is used to construct an EventLoop
— a struct
responsible for configuring handlers and listening to updates.
Methods
impl Bot<Https>
[src]
pub fn new(token: Token) -> Self
[src]
Constructs a new Bot
.
pub fn from_env(env_var: &'static str) -> Self
[src]
Constructs a new Bot
, extracting the token from the environment at
runtime.
If you need to extract the token at compile time, use bot!
.
Example
use tbot::{Bot, prelude::*}; let mut bot = Bot::from_env("BOT_TOKEN"); let me = bot .get_me() .into_future() .map(|me| { dbg!(me); }) .map_err(|err| { dbg!(err); }); tbot::run(me);
impl<C> Bot<C>
[src]
pub fn event_loop(self) -> EventLoop<C>
[src]
Constructs an EventLoop
.
pub fn add_sticker_to_set<'a>(
&'a self,
user_id: Id,
name: &'a str,
png_sticker: PngSticker<'a>,
emojis: &'a str
) -> AddStickerToSet<'a, C>
[src]
&'a self,
user_id: Id,
name: &'a str,
png_sticker: PngSticker<'a>,
emojis: &'a str
) -> AddStickerToSet<'a, C>
Constructs a new AddStickerToSet
inferring your bot's token.
pub fn create_new_sticker_set<'a>(
&'a self,
user_id: Id,
name: &'a str,
title: &'a str,
png_sticker: PngSticker<'a>,
emojis: &'a str
) -> CreateNewStickerSet<'a, C>
[src]
&'a self,
user_id: Id,
name: &'a str,
title: &'a str,
png_sticker: PngSticker<'a>,
emojis: &'a str
) -> CreateNewStickerSet<'a, C>
Constructs a new CreateNewStickerSet
inferring your bot's token.
pub fn delete_chat_photo<'a>(
&'a self,
chat_id: impl ImplicitChatId<'a>
) -> DeleteChatPhoto<'a, C>
[src]
&'a self,
chat_id: impl ImplicitChatId<'a>
) -> DeleteChatPhoto<'a, C>
Constructs a new DeleteChatPhoto
inferring your bot's token.
pub fn delete_chat_sticker_set<'a>(
&'a self,
chat_id: impl ImplicitChatId<'a>
) -> DeleteChatStickerSet<'a, C>
[src]
&'a self,
chat_id: impl ImplicitChatId<'a>
) -> DeleteChatStickerSet<'a, C>
Constructs a new DeleteChatStickerSet
inferring your bot's token.
pub fn delete_message<'a>(
&'a self,
chat_id: impl ImplicitChatId<'a>,
message_id: Id
) -> DeleteMessage<'a, C>
[src]
&'a self,
chat_id: impl ImplicitChatId<'a>,
message_id: Id
) -> DeleteMessage<'a, C>
Constructs a new DeleteMessage
inferring your bot's token.
pub fn delete_sticker_from_set<'a>(
&'a self,
sticker: &'a str
) -> DeleteStickerFromSet<'a, C>
[src]
&'a self,
sticker: &'a str
) -> DeleteStickerFromSet<'a, C>
Constructs a new DeleteStickerFromSet
inferring your bot's token.
pub fn edit_inline_caption<'a>(
&'a self,
inline_message_id: Ref<'a>,
caption: impl Into<Text<'a>>
) -> EditInlineCaption<'a, C>
[src]
&'a self,
inline_message_id: Ref<'a>,
caption: impl Into<Text<'a>>
) -> EditInlineCaption<'a, C>
Constructs a new EditInlineCaption
inferring your bot's token.
pub fn edit_inline_location<'a>(
&'a self,
inline_message_id: Ref<'a>,
position: (f64, f64)
) -> EditInlineLocation<'a, C>
[src]
&'a self,
inline_message_id: Ref<'a>,
position: (f64, f64)
) -> EditInlineLocation<'a, C>
Constructs a new EditInlineLocation
inferring your bot's token.
pub fn edit_inline_media<'a>(
&'a self,
inline_message_id: Ref<'a>,
media: impl Into<EditableMedia<'a>>
) -> EditInlineMedia<'a, C>
[src]
&'a self,
inline_message_id: Ref<'a>,
media: impl Into<EditableMedia<'a>>
) -> EditInlineMedia<'a, C>
Constructs a new EditInlineMedia
inferring your bot's token.
pub fn edit_inline_reply_markup<'a>(
&'a self,
inline_message_id: Ref<'a>,
reply_markup: Keyboard<'a>
) -> EditInlineReplyMarkup<'a, C>
[src]
&'a self,
inline_message_id: Ref<'a>,
reply_markup: Keyboard<'a>
) -> EditInlineReplyMarkup<'a, C>
Constructs a new EditInlineReplyMarkup
inferring your bot's token.
pub fn edit_inline_text<'a>(
&'a self,
inline_message_id: Ref<'a>,
text: impl Into<Text<'a>>
) -> EditInlineText<'a, C>
[src]
&'a self,
inline_message_id: Ref<'a>,
text: impl Into<Text<'a>>
) -> EditInlineText<'a, C>
Constructs a new EditInlineText
inferring your bot's token.
pub fn edit_message_caption<'a>(
&'a self,
chat_id: impl ImplicitChatId<'a>,
message_id: Id,
caption: impl Into<Text<'a>>
) -> EditMessageCaption<'a, C>
[src]
&'a self,
chat_id: impl ImplicitChatId<'a>,
message_id: Id,
caption: impl Into<Text<'a>>
) -> EditMessageCaption<'a, C>
Constructs a new EditMessageCaption
inferring your bot's token.
pub fn edit_message_location<'a>(
&'a self,
chat_id: impl ImplicitChatId<'a>,
message_id: Id,
position: (f64, f64)
) -> EditMessageLocation<'a, C>
[src]
&'a self,
chat_id: impl ImplicitChatId<'a>,
message_id: Id,
position: (f64, f64)
) -> EditMessageLocation<'a, C>
Constructs a new EditMessageLocation
inferring your bot's token.
pub fn edit_message_media<'a>(
&'a self,
chat_id: impl ImplicitChatId<'a>,
message_id: Id,
media: impl Into<EditableMedia<'a>>
) -> EditMessageMedia<'a, C>
[src]
&'a self,
chat_id: impl ImplicitChatId<'a>,
message_id: Id,
media: impl Into<EditableMedia<'a>>
) -> EditMessageMedia<'a, C>
Constructs a new EditMessageMedia
inferring your bot's token.
pub fn edit_message_reply_markup<'a>(
&'a self,
chat_id: impl ImplicitChatId<'a>,
message_id: Id,
reply_markup: Keyboard<'a>
) -> EditMessageReplyMarkup<'a, C>
[src]
&'a self,
chat_id: impl ImplicitChatId<'a>,
message_id: Id,
reply_markup: Keyboard<'a>
) -> EditMessageReplyMarkup<'a, C>
Constructs a new EditMessageReplyMarkup
inferring your bot's token.
pub fn edit_message_text<'a>(
&'a self,
chat_id: impl ImplicitChatId<'a>,
message_id: Id,
text: impl Into<Text<'a>>
) -> EditMessageText<'a, C>
[src]
&'a self,
chat_id: impl ImplicitChatId<'a>,
message_id: Id,
text: impl Into<Text<'a>>
) -> EditMessageText<'a, C>
Constructs a new EditMessageText
inferring your bot's token.
pub fn export_chat_invite_link<'a>(
&'a self,
chat_id: impl ImplicitChatId<'a>
) -> ExportChatInviteLink<'a, C>
[src]
&'a self,
chat_id: impl ImplicitChatId<'a>
) -> ExportChatInviteLink<'a, C>
Constructs a new ExportChatInviteLink
inferring your bot's token.
pub fn forward_message<'a>(
&'a self,
chat_id: impl ImplicitChatId<'a>,
from_chat_id: impl ImplicitChatId<'a>,
message_id: Id
) -> ForwardMessage<'a, C>
[src]
&'a self,
chat_id: impl ImplicitChatId<'a>,
from_chat_id: impl ImplicitChatId<'a>,
message_id: Id
) -> ForwardMessage<'a, C>
Constructs a new ForwardMessage
inferring your bot's token.
pub fn get_chat<'a>(
&'a self,
chat_id: impl ImplicitChatId<'a>
) -> GetChat<'a, C>
[src]
&'a self,
chat_id: impl ImplicitChatId<'a>
) -> GetChat<'a, C>
Constructs a new GetChat
inferring your bot's token.
pub fn get_file<'a>(&'a self, file_id: &'a impl AsFileId) -> GetFile<'a, C>
[src]
Constructs a new GetFile
inferring your bot's token.
pub fn get_inline_game_high_scores<'a>(
&'a self,
inline_message_id: Ref<'a>,
user_id: Id
) -> GetInlineGameHighScores<'a, C>
[src]
&'a self,
inline_message_id: Ref<'a>,
user_id: Id
) -> GetInlineGameHighScores<'a, C>
Constructs a new GetInlineGameHighScores
inferring your bot's token.
pub fn get_chat_administrators<'a>(
&'a self,
chat_id: impl ImplicitChatId<'a>
) -> GetChatAdministrators<'a, C>
[src]
&'a self,
chat_id: impl ImplicitChatId<'a>
) -> GetChatAdministrators<'a, C>
Constructs a new GetChatAdministrators
inferring your bot's token.
pub fn get_chat_member<'a>(
&'a self,
chat_id: impl ImplicitChatId<'a>,
user_id: Id
) -> GetChatMember<'a, C>
[src]
&'a self,
chat_id: impl ImplicitChatId<'a>,
user_id: Id
) -> GetChatMember<'a, C>
Constructs a new GetChatMember
inferring your bot's token.
pub fn get_chat_members_count<'a>(
&'a self,
chat_id: impl ImplicitChatId<'a>
) -> GetChatMembersCount<'a, C>
[src]
&'a self,
chat_id: impl ImplicitChatId<'a>
) -> GetChatMembersCount<'a, C>
Constructs a new GetChatMembersCount
inferring your bot's token.
pub fn get_message_game_high_scores<'a>(
&'a self,
chat_id: impl ImplicitChatId<'a>,
message_id: Id,
user_id: Id
) -> GetMessageGameHighScores<'a, C>
[src]
&'a self,
chat_id: impl ImplicitChatId<'a>,
message_id: Id,
user_id: Id
) -> GetMessageGameHighScores<'a, C>
Constructs a new GetMessageGameHighScores
inferring your bot's token.
pub fn get_me(&self) -> GetMe<C>
[src]
Constructs a new GetMe
inferring your bot's token.
pub fn get_sticker_set<'a>(&'a self, name: &'a str) -> GetStickerSet<'a, C>
[src]
Constructs a new GetStickerSet
inferring your bot's token.
pub fn get_user_profile_photos(&self, user_id: Id) -> GetUserProfilePhotos<C>
[src]
Constructs a new GetUserProfilePhotos
inferring your bot's token.
pub fn get_webhook_info(&self) -> GetWebhookInfo<C>
[src]
Constructs a new GetWebhookInfo
inferring your bot's token.
pub fn kick_chat_member<'a>(
&'a self,
chat_id: impl ImplicitChatId<'a>,
user_id: Id
) -> KickChatMember<'a, C>
[src]
&'a self,
chat_id: impl ImplicitChatId<'a>,
user_id: Id
) -> KickChatMember<'a, C>
Constructs a new KickChatMember
inferring your bot's token.
pub fn leave_chat<'a>(
&'a self,
chat_id: impl ImplicitChatId<'a>
) -> LeaveChat<'a, C>
[src]
&'a self,
chat_id: impl ImplicitChatId<'a>
) -> LeaveChat<'a, C>
Constructs a new LeaveChat
inferring your bot's token.
pub fn pin_chat_message<'a>(
&'a self,
chat_id: impl ImplicitChatId<'a>,
message_id: Id
) -> PinChatMessage<'a, C>
[src]
&'a self,
chat_id: impl ImplicitChatId<'a>,
message_id: Id
) -> PinChatMessage<'a, C>
Constructs a new PinChatMessage
inferring your bot's token.
pub fn promote_chat_member<'a>(
&'a self,
chat_id: impl ImplicitChatId<'a>,
user_id: Id
) -> PromoteChatMember<'a, C>
[src]
&'a self,
chat_id: impl ImplicitChatId<'a>,
user_id: Id
) -> PromoteChatMember<'a, C>
Constructs a new PromoteChatMember
inferring your bot's token.
pub fn restrict_chat_member<'a>(
&'a self,
chat_id: impl ImplicitChatId<'a>,
user_id: Id
) -> RestrictChatMember<'a, C>
[src]
&'a self,
chat_id: impl ImplicitChatId<'a>,
user_id: Id
) -> RestrictChatMember<'a, C>
Constructs a new RestrictChatMember
inferring your bot's token.
pub fn send_animation<'a>(
&'a self,
chat_id: impl ImplicitChatId<'a>,
animation: Animation<'a>
) -> SendAnimation<'a, C>
[src]
&'a self,
chat_id: impl ImplicitChatId<'a>,
animation: Animation<'a>
) -> SendAnimation<'a, C>
Constructs a new SendAnimation
inferring your bot's token.
pub fn send_audio<'a>(
&'a self,
chat_id: impl ImplicitChatId<'a>,
audio: Audio<'a>
) -> SendAudio<'a, C>
[src]
&'a self,
chat_id: impl ImplicitChatId<'a>,
audio: Audio<'a>
) -> SendAudio<'a, C>
Constructs a new SendAudio
inferring your bot's token.
pub fn send_chat_action<'a>(
&'a self,
chat_id: impl ImplicitChatId<'a>,
action: Action
) -> SendChatAction<'a, C>
[src]
&'a self,
chat_id: impl ImplicitChatId<'a>,
action: Action
) -> SendChatAction<'a, C>
Constructs a new SendChatAction
inferring your bot's token.
pub fn send_contact<'a>(
&'a self,
chat_id: impl ImplicitChatId<'a>,
phone_number: &'a str,
first_name: &'a str
) -> SendContact<'a, C>
[src]
&'a self,
chat_id: impl ImplicitChatId<'a>,
phone_number: &'a str,
first_name: &'a str
) -> SendContact<'a, C>
Constructs a new SendContact
inferring your bot's token.
pub fn send_game<'a>(
&'a self,
chat_id: impl ImplicitChatId<'a>,
game_short_name: &'a str
) -> SendGame<'a, C>
[src]
&'a self,
chat_id: impl ImplicitChatId<'a>,
game_short_name: &'a str
) -> SendGame<'a, C>
Constructs a new SendGame
inferring your bot's token.
pub fn send_document<'a>(
&'a self,
chat_id: impl ImplicitChatId<'a>,
document: Document<'a>
) -> SendDocument<'a, C>
[src]
&'a self,
chat_id: impl ImplicitChatId<'a>,
document: Document<'a>
) -> SendDocument<'a, C>
Constructs a new SendDocument
inferring your bot's token.
pub fn send_invoice<'a>(
&'a self,
chat_id: impl Into<Id>,
title: &'a str,
description: &'a str,
payload: &'a str,
provider_token: &'a str,
start_parameter: &'a str,
currency: &'a str,
prices: &'a [LabeledPrice<'a>]
) -> SendInvoice<'a, C>
[src]
&'a self,
chat_id: impl Into<Id>,
title: &'a str,
description: &'a str,
payload: &'a str,
provider_token: &'a str,
start_parameter: &'a str,
currency: &'a str,
prices: &'a [LabeledPrice<'a>]
) -> SendInvoice<'a, C>
Constructs a new SendInvoice
inerring your bot's token.
pub fn send_location<'a>(
&'a self,
chat_id: impl ImplicitChatId<'a>,
position: (f64, f64)
) -> SendLocation<'a, C>
[src]
&'a self,
chat_id: impl ImplicitChatId<'a>,
position: (f64, f64)
) -> SendLocation<'a, C>
Constructs a new SendLocation
inferring your bot's token.
pub fn send_media_group<'a>(
&'a self,
chat_id: impl ImplicitChatId<'a>,
media: &'a [GroupMedia<'a>]
) -> SendMediaGroup<'a, C>
[src]
&'a self,
chat_id: impl ImplicitChatId<'a>,
media: &'a [GroupMedia<'a>]
) -> SendMediaGroup<'a, C>
Constructs a new SendMediaGroup
inferring your bot's token.
pub fn send_message<'a>(
&'a self,
chat_id: impl ImplicitChatId<'a>,
text: impl Into<Text<'a>>
) -> SendMessage<'a, C>
[src]
&'a self,
chat_id: impl ImplicitChatId<'a>,
text: impl Into<Text<'a>>
) -> SendMessage<'a, C>
Constructs a new SendMessage
inferring your bot's token.
pub fn send_photo<'a>(
&'a self,
chat_id: impl ImplicitChatId<'a>,
photo: Photo<'a>
) -> SendPhoto<'a, C>
[src]
&'a self,
chat_id: impl ImplicitChatId<'a>,
photo: Photo<'a>
) -> SendPhoto<'a, C>
Constructs a new SendPhoto
inferring your bot's token.
pub fn send_poll<'a>(
&'a self,
chat_id: impl ImplicitChatId<'a>,
question: &'a str,
options: &'a [&'a str]
) -> SendPoll<'a, C>
[src]
&'a self,
chat_id: impl ImplicitChatId<'a>,
question: &'a str,
options: &'a [&'a str]
) -> SendPoll<'a, C>
Constructs a new SendPoll
inferring your bot's token.
pub fn send_sticker<'a>(
&'a self,
chat_id: impl ImplicitChatId<'a>,
sticker: Sticker<'a>
) -> SendSticker<'a, C>
[src]
&'a self,
chat_id: impl ImplicitChatId<'a>,
sticker: Sticker<'a>
) -> SendSticker<'a, C>
Constructs a new SendSticker
inferring your bot's token.
pub fn send_venue<'a>(
&'a self,
chat_id: impl ImplicitChatId<'a>,
position: (f64, f64),
title: &'a str,
address: &'a str
) -> SendVenue<'a, C>
[src]
&'a self,
chat_id: impl ImplicitChatId<'a>,
position: (f64, f64),
title: &'a str,
address: &'a str
) -> SendVenue<'a, C>
Constructs a new SendVenue
inferring your bot's token.
pub fn send_video_note<'a>(
&'a self,
chat_id: impl ImplicitChatId<'a>,
video_note: VideoNote<'a>
) -> SendVideoNote<'a, C>
[src]
&'a self,
chat_id: impl ImplicitChatId<'a>,
video_note: VideoNote<'a>
) -> SendVideoNote<'a, C>
Constructs a new SendVideoNote
inferring your bot's token.
pub fn send_video<'a>(
&'a self,
chat_id: impl ImplicitChatId<'a>,
video: Video<'a>
) -> SendVideo<'a, C>
[src]
&'a self,
chat_id: impl ImplicitChatId<'a>,
video: Video<'a>
) -> SendVideo<'a, C>
Constructs a new SendVideo
inferring your bot's token.
pub fn send_voice<'a>(
&'a self,
chat_id: impl ImplicitChatId<'a>,
voice: Voice<'a>
) -> SendVoice<'a, C>
[src]
&'a self,
chat_id: impl ImplicitChatId<'a>,
voice: Voice<'a>
) -> SendVoice<'a, C>
Constructs a new SendVoice
inferring your bot's token.
pub fn set_chat_description<'a>(
&'a self,
chat_id: impl ImplicitChatId<'a>,
description: &'a str
) -> SetChatDescription<'a, C>
[src]
&'a self,
chat_id: impl ImplicitChatId<'a>,
description: &'a str
) -> SetChatDescription<'a, C>
Constructs a new SetChatDescription
inferring your bot's token.
pub fn set_chat_photo<'a>(
&'a self,
chat_id: impl ImplicitChatId<'a>,
photo: ChatPhoto<'a>
) -> SetChatPhoto<'a, C>
[src]
&'a self,
chat_id: impl ImplicitChatId<'a>,
photo: ChatPhoto<'a>
) -> SetChatPhoto<'a, C>
Constructs a new SetChatPhoto
inferring your bot's token.
pub fn set_chat_sticker_set<'a>(
&'a self,
chat_id: impl ImplicitChatId<'a>,
sticker_set_name: &'a str
) -> SetChatStickerSet<'a, C>
[src]
&'a self,
chat_id: impl ImplicitChatId<'a>,
sticker_set_name: &'a str
) -> SetChatStickerSet<'a, C>
Constructs a new SetChatStickerSet
inferring your bot's token.
pub fn set_chat_title<'a>(
&'a self,
chat_id: impl ImplicitChatId<'a>,
title: &'a str
) -> SetChatTitle<'a, C>
[src]
&'a self,
chat_id: impl ImplicitChatId<'a>,
title: &'a str
) -> SetChatTitle<'a, C>
Constructs a new SetChatTitle
inferring your bot's token.
pub fn set_inline_game_score<'a>(
&'a self,
inline_message_id: Ref<'a>,
user_id: Id,
score: u32
) -> SetInlineGameScore<'a, C>
[src]
&'a self,
inline_message_id: Ref<'a>,
user_id: Id,
score: u32
) -> SetInlineGameScore<'a, C>
Constructs a new SetInlineGameScore
inferring your bot's token.
pub fn set_message_game_score<'a>(
&'a self,
chat_id: impl ImplicitChatId<'a>,
message_id: Id,
user_id: Id,
score: u32
) -> SetMessageGameScore<'a, C>
[src]
&'a self,
chat_id: impl ImplicitChatId<'a>,
message_id: Id,
user_id: Id,
score: u32
) -> SetMessageGameScore<'a, C>
Constructs a new SetMessageGameScore
inferring your bot's token.
pub fn set_passport_data_errors<'a>(
&'a self,
user_id: Id,
errors: &'a [Error<'a>]
) -> SetPassportDataErrors<'a, C>
[src]
&'a self,
user_id: Id,
errors: &'a [Error<'a>]
) -> SetPassportDataErrors<'a, C>
Constructs a new SetPassportDataErrors
inferring your bot's token.
pub fn set_sticker_position_in_set<'a>(
&'a self,
sticker: &'a str,
position: u32
) -> SetStickerPositionInSet<'a, C>
[src]
&'a self,
sticker: &'a str,
position: u32
) -> SetStickerPositionInSet<'a, C>
Constructs a new SetStickerPositionInSet
inferring your bot's token.
pub fn stop_inline_location<'a>(
&'a self,
inline_message_id: Ref<'a>
) -> StopInlineLocation<'a, C>
[src]
&'a self,
inline_message_id: Ref<'a>
) -> StopInlineLocation<'a, C>
Constructs a new StopInlineLocation
inferring your bot's token.
pub fn stop_message_location<'a>(
&'a self,
chat_id: impl ImplicitChatId<'a>,
message_id: Id
) -> StopMessageLocation<'a, C>
[src]
&'a self,
chat_id: impl ImplicitChatId<'a>,
message_id: Id
) -> StopMessageLocation<'a, C>
Constructs a new StopMessageLocation
inferring your bot's token.
pub fn stop_poll<'a>(
&'a self,
chat_id: impl ImplicitChatId<'a>,
message_id: Id
) -> StopPoll<'a, C>
[src]
&'a self,
chat_id: impl ImplicitChatId<'a>,
message_id: Id
) -> StopPoll<'a, C>
Constructs a new StopPoll
inferring your bot's token.
pub fn unban_chat_member<'a>(
&'a self,
chat_id: impl ImplicitChatId<'a>,
user_id: Id
) -> UnbanChatMember<'a, C>
[src]
&'a self,
chat_id: impl ImplicitChatId<'a>,
user_id: Id
) -> UnbanChatMember<'a, C>
Constructs a new UnbanChatMember
inferring your bot's token.
pub fn unpin_chat_message<'a>(
&'a self,
chat_id: impl ImplicitChatId<'a>
) -> UnpinChatMessage<'a, C>
[src]
&'a self,
chat_id: impl ImplicitChatId<'a>
) -> UnpinChatMessage<'a, C>
Constructs a new UnpinChatMessage
inferring your bot's token.
pub fn upload_sticker_file<'a>(
&'a self,
user_id: Id,
png_sticker: &'a [u8]
) -> UploadStickerFile<'a, C>
[src]
&'a self,
user_id: Id,
png_sticker: &'a [u8]
) -> UploadStickerFile<'a, C>
Constructs a new UploadStickerFile
inferring your bot's token.
impl<C> Bot<C> where
C: Connect + Sync + 'static,
C::Transport: 'static,
C::Future: 'static,
[src]
C: Connect + Sync + 'static,
C::Transport: 'static,
C::Future: 'static,
pub fn with_connector(token: Token, connector: C) -> Self
[src]
Constructs a Bot
with a custom connector.
pub fn from_env_with_connector(env_var: &'static str, connector: C) -> Self
[src]
Like Bot::from_env
with a custom connector.
pub fn download_file(
&self,
file: &File
) -> impl Future<Item = Vec<u8>, Error = Download>
[src]
&self,
file: &File
) -> impl Future<Item = Vec<u8>, Error = Download>
Downloads a file.
Trait Implementations
impl<C: Clone> Clone for Bot<C>
[src]
fn clone(&self) -> Bot<C>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<C: Debug> Debug for Bot<C>
[src]
Auto Trait Implementations
impl<C> Sync for Bot<C> where
C: Send + Sync,
C: Send + Sync,
impl<C> Unpin for Bot<C>
impl<C> Send for Bot<C> where
C: Send + Sync,
C: Send + Sync,
impl<C> !UnwindSafe for Bot<C>
impl<C> !RefUnwindSafe for Bot<C>
Blanket Implementations
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.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> From<T> for 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.
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.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Erased for T
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,