[][src]Struct telegrambot::TelegramBot

pub struct TelegramBot { /* fields omitted */ }

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]

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]

pub fn on_incoming<F>(&mut self, fnc: F) -> &mut Self where
    F: Fn((BotApi, Incoming)) -> bool + Send + Sync + 'static, 
[src]

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]

pub fn on_none_command<F>(&mut self, fnc: F) -> &mut Self where
    F: Fn((BotApi, VCommand)) + Send + Sync + 'static, 
[src]

pub fn on_callback_query<F>(&mut self, fnc: F) -> &mut Self where
    F: Fn((BotApi, VCallbackQuery)) + Send + Sync + 'static, 
[src]

pub fn on_error<F>(&mut self, fnc: F) -> &mut Self where
    F: Fn((BotApi, String)) + Send + Sync + 'static, 
[src]

pub fn on_update<F>(&mut self, fnc: F) -> &mut Self where
    F: Fn((BotApi, Update)) + Send + Sync + 'static, 
[src]

pub fn on_text<F>(&mut self, fnc: F) -> &mut Self where
    F: Fn((BotApi, VTextMessage)) + Send + Sync + 'static, 
[src]

pub fn on_audio<F>(&mut self, fnc: F) -> &mut Self where
    F: Fn((BotApi, VAudioMessage)) + Send + Sync + 'static, 
[src]

pub fn on_document<F>(&mut self, fnc: F) -> &mut Self where
    F: Fn((BotApi, VDocumentMessage)) + Send + Sync + 'static, 
[src]

pub fn on_photo<F>(&mut self, fnc: F) -> &mut Self where
    F: Fn((BotApi, VPhotoMessage)) + Send + Sync + 'static, 
[src]

pub fn on_sticker<F>(&mut self, fnc: F) -> &mut Self where
    F: Fn((BotApi, VStickerMessage)) + Send + Sync + 'static, 
[src]

pub fn on_video<F>(&mut self, fnc: F) -> &mut Self where
    F: Fn((BotApi, VVideoMessage)) + Send + Sync + 'static, 
[src]

pub fn on_voice<F>(&mut self, fnc: F) -> &mut Self where
    F: Fn((BotApi, VVoiceMessage)) + Send + Sync + 'static, 
[src]

pub fn on_video_note<F>(&mut self, fnc: F) -> &mut Self where
    F: Fn((BotApi, VVideoNoteMessage)) + Send + Sync + 'static, 
[src]

pub fn on_contact<F>(&mut self, fnc: F) -> &mut Self where
    F: Fn((BotApi, VContactMessage)) + Send + Sync + 'static, 
[src]

pub fn on_location<F>(&mut self, fnc: F) -> &mut Self where
    F: Fn((BotApi, VLocationMessage)) + Send + Sync + 'static, 
[src]

pub fn on_venue<F>(&mut self, fnc: F) -> &mut Self where
    F: Fn((BotApi, VVenueMessage)) + Send + Sync + 'static, 
[src]

pub fn on_new_chat_members<F>(&mut self, fnc: F) -> &mut Self where
    F: Fn((BotApi, VNewChatMembersMessage)) + Send + Sync + 'static, 
[src]

pub fn on_left_chat_member<F>(&mut self, fnc: F) -> &mut Self where
    F: Fn((BotApi, VLeftChatMemberMessage)) + Send + Sync + 'static, 
[src]

pub fn on_new_chat_title<F>(&mut self, fnc: F) -> &mut Self where
    F: Fn((BotApi, VChatTitleMessage)) + Send + Sync + 'static, 
[src]

pub fn on_new_chat_photo<F>(&mut self, fnc: F) -> &mut Self where
    F: Fn((BotApi, VChatPhotoMessage)) + Send + Sync + 'static, 
[src]

pub fn on_delete_chat_photo<F>(&mut self, fnc: F) -> &mut Self where
    F: Fn((BotApi, Message)) + Send + Sync + 'static, 
[src]

pub fn on_group_chat_created<F>(&mut self, fnc: F) -> &mut Self where
    F: Fn((BotApi, Message)) + Send + Sync + 'static, 
[src]

pub fn on_supergroup_chat_created<F>(&mut self, fnc: F) -> &mut Self where
    F: Fn((BotApi, Message)) + Send + Sync + 'static, 
[src]

pub fn on_channel_chat_create<F>(&mut self, fnc: F) -> &mut Self where
    F: Fn((BotApi, Message)) + Send + Sync + 'static, 
[src]

pub fn on_migrate_to_chat<F>(&mut self, fnc: F) -> &mut Self where
    F: Fn((BotApi, VMigrateToChatIdMessage)) + Send + Sync + 'static, 
[src]

pub fn on_migrate_from_chat<F>(&mut self, fnc: F) -> &mut Self where
    F: Fn((BotApi, VMigrateFromChatIdMessage)) + Send + Sync + 'static, 
[src]

pub fn on_pinned<F>(&mut self, fnc: F) -> &mut Self where
    F: Fn((BotApi, VPinnedMessageMessage)) + Send + Sync + 'static, 
[src]

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]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Erased for T

impl<T, U> TryInto for T where
    U: TryFrom<T>, 

type Err = <U as TryFrom<T>>::Err