[−][src]Struct telegrambot::TelegramBot
Methods
impl TelegramBot
[src]
pub fn new(cfg: Config) -> TGBotResult<Self>
[src]
pub fn on_start<F>(&mut self, fnc: F) -> &mut Self where
F: Fn((BotApi, VCommand)) + Send + Sync + 'static,
[src]
F: Fn((BotApi, VCommand)) + Send + Sync + 'static,
pub fn on_command<S, F>(&mut self, command: S, fnc: F) -> &mut Self where
S: AsRef<str> + 'static,
F: Fn((BotApi, VCommand)) + Send + Sync + 'static,
[src]
S: AsRef<str> + 'static,
F: Fn((BotApi, VCommand)) + Send + Sync + 'static,
pub fn on_incoming<F>(&mut self, fnc: F) -> &mut Self where
F: Fn((BotApi, Incoming)) -> bool + Send + Sync + 'static,
[src]
F: Fn((BotApi, Incoming)) -> bool + Send + Sync + 'static,
incoming update return bool, if true will run next listener else be back (stop this update).
pub fn on_precommand<F>(&mut self, fnc: F) -> &mut Self where
F: Fn((BotApi, VCommand)) + Send + Sync + 'static,
[src]
F: Fn((BotApi, VCommand)) + Send + Sync + 'static,
pub fn on_none_command<F>(&mut self, fnc: F) -> &mut Self where
F: Fn((BotApi, VCommand)) + Send + Sync + 'static,
[src]
F: Fn((BotApi, VCommand)) + Send + Sync + 'static,
pub fn on_callback_query<F>(&mut self, fnc: F) -> &mut Self where
F: Fn((BotApi, VCallbackQuery)) + Send + Sync + 'static,
[src]
F: Fn((BotApi, VCallbackQuery)) + Send + Sync + 'static,
pub fn on_error<F>(&mut self, fnc: F) -> &mut Self where
F: Fn((BotApi, String)) + Send + Sync + 'static,
[src]
F: Fn((BotApi, String)) + Send + Sync + 'static,
pub fn on_update<F>(&mut self, fnc: F) -> &mut Self where
F: Fn((BotApi, Update)) + Send + Sync + 'static,
[src]
F: Fn((BotApi, Update)) + Send + Sync + 'static,
pub fn on_text<F>(&mut self, fnc: F) -> &mut Self where
F: Fn((BotApi, VTextMessage)) + Send + Sync + 'static,
[src]
F: Fn((BotApi, VTextMessage)) + Send + Sync + 'static,
pub fn on_audio<F>(&mut self, fnc: F) -> &mut Self where
F: Fn((BotApi, VAudioMessage)) + Send + Sync + 'static,
[src]
F: Fn((BotApi, VAudioMessage)) + Send + Sync + 'static,
pub fn on_document<F>(&mut self, fnc: F) -> &mut Self where
F: Fn((BotApi, VDocumentMessage)) + Send + Sync + 'static,
[src]
F: Fn((BotApi, VDocumentMessage)) + Send + Sync + 'static,
pub fn on_photo<F>(&mut self, fnc: F) -> &mut Self where
F: Fn((BotApi, VPhotoMessage)) + Send + Sync + 'static,
[src]
F: Fn((BotApi, VPhotoMessage)) + Send + Sync + 'static,
pub fn on_sticker<F>(&mut self, fnc: F) -> &mut Self where
F: Fn((BotApi, VStickerMessage)) + Send + Sync + 'static,
[src]
F: Fn((BotApi, VStickerMessage)) + Send + Sync + 'static,
pub fn on_video<F>(&mut self, fnc: F) -> &mut Self where
F: Fn((BotApi, VVideoMessage)) + Send + Sync + 'static,
[src]
F: Fn((BotApi, VVideoMessage)) + Send + Sync + 'static,
pub fn on_voice<F>(&mut self, fnc: F) -> &mut Self where
F: Fn((BotApi, VVoiceMessage)) + Send + Sync + 'static,
[src]
F: Fn((BotApi, VVoiceMessage)) + Send + Sync + 'static,
pub fn on_video_note<F>(&mut self, fnc: F) -> &mut Self where
F: Fn((BotApi, VVideoNoteMessage)) + Send + Sync + 'static,
[src]
F: Fn((BotApi, VVideoNoteMessage)) + Send + Sync + 'static,
pub fn on_contact<F>(&mut self, fnc: F) -> &mut Self where
F: Fn((BotApi, VContactMessage)) + Send + Sync + 'static,
[src]
F: Fn((BotApi, VContactMessage)) + Send + Sync + 'static,
pub fn on_location<F>(&mut self, fnc: F) -> &mut Self where
F: Fn((BotApi, VLocationMessage)) + Send + Sync + 'static,
[src]
F: Fn((BotApi, VLocationMessage)) + Send + Sync + 'static,
pub fn on_venue<F>(&mut self, fnc: F) -> &mut Self where
F: Fn((BotApi, VVenueMessage)) + Send + Sync + 'static,
[src]
F: Fn((BotApi, VVenueMessage)) + Send + Sync + 'static,
pub fn on_new_chat_members<F>(&mut self, fnc: F) -> &mut Self where
F: Fn((BotApi, VNewChatMembersMessage)) + Send + Sync + 'static,
[src]
F: Fn((BotApi, VNewChatMembersMessage)) + Send + Sync + 'static,
pub fn on_left_chat_member<F>(&mut self, fnc: F) -> &mut Self where
F: Fn((BotApi, VLeftChatMemberMessage)) + Send + Sync + 'static,
[src]
F: Fn((BotApi, VLeftChatMemberMessage)) + Send + Sync + 'static,
pub fn on_new_chat_title<F>(&mut self, fnc: F) -> &mut Self where
F: Fn((BotApi, VChatTitleMessage)) + Send + Sync + 'static,
[src]
F: Fn((BotApi, VChatTitleMessage)) + Send + Sync + 'static,
pub fn on_new_chat_photo<F>(&mut self, fnc: F) -> &mut Self where
F: Fn((BotApi, VChatPhotoMessage)) + Send + Sync + 'static,
[src]
F: Fn((BotApi, VChatPhotoMessage)) + Send + Sync + 'static,
pub fn on_delete_chat_photo<F>(&mut self, fnc: F) -> &mut Self where
F: Fn((BotApi, Message)) + Send + Sync + 'static,
[src]
F: Fn((BotApi, Message)) + Send + Sync + 'static,
pub fn on_group_chat_created<F>(&mut self, fnc: F) -> &mut Self where
F: Fn((BotApi, Message)) + Send + Sync + 'static,
[src]
F: Fn((BotApi, Message)) + Send + Sync + 'static,
pub fn on_supergroup_chat_created<F>(&mut self, fnc: F) -> &mut Self where
F: Fn((BotApi, Message)) + Send + Sync + 'static,
[src]
F: Fn((BotApi, Message)) + Send + Sync + 'static,
pub fn on_channel_chat_create<F>(&mut self, fnc: F) -> &mut Self where
F: Fn((BotApi, Message)) + Send + Sync + 'static,
[src]
F: Fn((BotApi, Message)) + Send + Sync + 'static,
pub fn on_migrate_to_chat<F>(&mut self, fnc: F) -> &mut Self where
F: Fn((BotApi, VMigrateToChatIdMessage)) + Send + Sync + 'static,
[src]
F: Fn((BotApi, VMigrateToChatIdMessage)) + Send + Sync + 'static,
pub fn on_migrate_from_chat<F>(&mut self, fnc: F) -> &mut Self where
F: Fn((BotApi, VMigrateFromChatIdMessage)) + Send + Sync + 'static,
[src]
F: Fn((BotApi, VMigrateFromChatIdMessage)) + Send + Sync + 'static,
pub fn on_pinned<F>(&mut self, fnc: F) -> &mut Self where
F: Fn((BotApi, VPinnedMessageMessage)) + Send + Sync + 'static,
[src]
F: Fn((BotApi, VPinnedMessageMessage)) + Send + Sync + 'static,
pub fn start(&self) -> TGBotResult<()>
[src]
Auto Trait Implementations
impl Send for TelegramBot
impl Sync for TelegramBot
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom 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> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto 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> Erased for T
impl<T, U> TryInto for T where
U: TryFrom<T>,
U: TryFrom<T>,