Struct telebot::bot::RcBot [−][src]
A clonable, single threaded bot
The outer API gets implemented on RcBot
Fields
inner: Rc<Bot>
Methods
impl RcBot
[src]
impl RcBot
impl RcBot
[src]
impl RcBot
pub fn update_interval(self, interval: u64) -> RcBot
[src]
pub fn update_interval(self, interval: u64) -> RcBot
Sets the update interval to an integer in milliseconds
pub fn timeout(self, timeout: u64) -> RcBot
[src]
pub fn timeout(self, timeout: u64) -> RcBot
Sets the timeout interval for long polling
pub fn new_cmd(
&self,
cmd: &str
) -> impl Stream<Item = (RcBot, Message), Error = Error>
[src]
pub fn new_cmd(
&self,
cmd: &str
) -> impl Stream<Item = (RcBot, Message), Error = Error>
Creates a new command and returns a stream which will yield a message when the command is send
pub fn unknown_cmd(
&self
) -> impl Stream<Item = (RcBot, Message), Error = Error>
[src]
pub fn unknown_cmd(
&self
) -> impl Stream<Item = (RcBot, Message), Error = Error>
Returns a stream which will yield a message when none of previously registered commands matches
pub fn register<T>(&self, hnd: T) where
T: Stream + 'static,
[src]
pub fn register<T>(&self, hnd: T) where
T: Stream + 'static,
Register a new commnd
pub fn get_stream<'a>(
&'a self
) -> impl Stream<Item = (RcBot, Update), Error = Error> + 'a
[src]
pub fn get_stream<'a>(
&'a self
) -> impl Stream<Item = (RcBot, Update), Error = Error> + 'a
The main update loop, the update function is called every update_interval milliseconds When an update is available the last_id will be updated and the message is filtered for commands The message is forwarded to the returned stream if no command was found
pub fn run<'a>(&'a self, core: &mut Core) -> Result<(), Error>
[src]
pub fn run<'a>(&'a self, core: &mut Core) -> Result<(), Error>
helper function to start the event loop
Trait Implementations
impl Clone for RcBot
[src]
impl Clone for RcBot
fn clone(&self) -> RcBot
[src]
fn clone(&self) -> RcBot
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl FunctionGetMe for RcBot
[src]
impl FunctionGetMe for RcBot
fn get_me(&self) -> WrapperGetMe
[src]
fn get_me(&self) -> WrapperGetMe
impl FunctionGetUpdates for RcBot
[src]
impl FunctionGetUpdates for RcBot
fn get_updates(&self) -> WrapperGetUpdates
[src]
fn get_updates(&self) -> WrapperGetUpdates
impl FunctionSendMessage for RcBot
[src]
impl FunctionSendMessage for RcBot
fn message(&self, _chat_id: Integer, _text: String) -> WrapperSendMessage
[src]
fn message(&self, _chat_id: Integer, _text: String) -> WrapperSendMessage
impl FunctionSendPhoto for RcBot
[src]
impl FunctionSendPhoto for RcBot
fn photo(&self, _chat_id: Integer) -> WrapperSendPhoto
[src]
fn photo(&self, _chat_id: Integer) -> WrapperSendPhoto
impl FunctionSendAudio for RcBot
[src]
impl FunctionSendAudio for RcBot
fn audio(&self, _chat_id: Integer) -> WrapperSendAudio
[src]
fn audio(&self, _chat_id: Integer) -> WrapperSendAudio
impl FunctionSendDocument for RcBot
[src]
impl FunctionSendDocument for RcBot
fn document(&self, _chat_id: Integer) -> WrapperSendDocument
[src]
fn document(&self, _chat_id: Integer) -> WrapperSendDocument
impl FunctionSendSticker for RcBot
[src]
impl FunctionSendSticker for RcBot
fn sticker(&self, _chat_id: Integer) -> WrapperSendSticker
[src]
fn sticker(&self, _chat_id: Integer) -> WrapperSendSticker
impl FunctionSendVideo for RcBot
[src]
impl FunctionSendVideo for RcBot
fn video(&self, _chat_id: Integer) -> WrapperSendVideo
[src]
fn video(&self, _chat_id: Integer) -> WrapperSendVideo
impl FunctionSendVoice for RcBot
[src]
impl FunctionSendVoice for RcBot
fn voice(&self, _chat_id: Integer) -> WrapperSendVoice
[src]
fn voice(&self, _chat_id: Integer) -> WrapperSendVoice
impl FunctionSendMediaGroup for RcBot
[src]
impl FunctionSendMediaGroup for RcBot
fn mediagroup(&self, _chat_id: Integer) -> WrapperSendMediaGroup
[src]
fn mediagroup(&self, _chat_id: Integer) -> WrapperSendMediaGroup
impl FunctionSendLocation for RcBot
[src]
impl FunctionSendLocation for RcBot
impl FunctionSendVenue for RcBot
[src]
impl FunctionSendVenue for RcBot
fn venue(
&self,
_chat_id: Integer,
_latitude: f32,
_longitude: f32,
_title: String,
_address: String
) -> WrapperSendVenue
[src]
fn venue(
&self,
_chat_id: Integer,
_latitude: f32,
_longitude: f32,
_title: String,
_address: String
) -> WrapperSendVenue
impl FunctionSendContact for RcBot
[src]
impl FunctionSendContact for RcBot
fn contact(
&self,
_chat_id: Integer,
_phone_number: String,
_first_name: String
) -> WrapperSendContact
[src]
fn contact(
&self,
_chat_id: Integer,
_phone_number: String,
_first_name: String
) -> WrapperSendContact
impl FunctionSendAction for RcBot
[src]
impl FunctionSendAction for RcBot
fn chat_action(&self, _chat_id: Integer, _action: String) -> WrapperSendAction
[src]
fn chat_action(&self, _chat_id: Integer, _action: String) -> WrapperSendAction
impl FunctionSendGame for RcBot
[src]
impl FunctionSendGame for RcBot
fn send_game(
&self,
_chat_id: Integer,
_game_short_name: String
) -> WrapperSendGame
[src]
fn send_game(
&self,
_chat_id: Integer,
_game_short_name: String
) -> WrapperSendGame
impl FunctionSetGameScore for RcBot
[src]
impl FunctionSetGameScore for RcBot
fn set_game_score(
&self,
_user_id: Integer,
_score: Integer
) -> WrapperSetGameScore
[src]
fn set_game_score(
&self,
_user_id: Integer,
_score: Integer
) -> WrapperSetGameScore
impl FunctionGetGameHighScores for RcBot
[src]
impl FunctionGetGameHighScores for RcBot
fn get_game_high_scores(&self, _user_id: Integer) -> WrapperGetGameHighScores
[src]
fn get_game_high_scores(&self, _user_id: Integer) -> WrapperGetGameHighScores
impl FunctionGetUserProfilePhotos for RcBot
[src]
impl FunctionGetUserProfilePhotos for RcBot
fn get_user_profile_photos(
&self,
_user_id: Integer
) -> WrapperGetUserProfilePhotos
[src]
fn get_user_profile_photos(
&self,
_user_id: Integer
) -> WrapperGetUserProfilePhotos
impl FunctionGetFile for RcBot
[src]
impl FunctionGetFile for RcBot
fn get_file(&self, _file_id: String) -> WrapperGetFile
[src]
fn get_file(&self, _file_id: String) -> WrapperGetFile
impl FunctionKickChatMember for RcBot
[src]
impl FunctionKickChatMember for RcBot
fn kick_chat_member(
&self,
_chat_id: Integer,
_user_id: Integer
) -> WrapperKickChatMember
[src]
fn kick_chat_member(
&self,
_chat_id: Integer,
_user_id: Integer
) -> WrapperKickChatMember
impl FunctionLeaveChat for RcBot
[src]
impl FunctionLeaveChat for RcBot
fn leave_chat(&self, _chat_id: Integer) -> WrapperLeaveChat
[src]
fn leave_chat(&self, _chat_id: Integer) -> WrapperLeaveChat
impl FunctionUnbanChatMember for RcBot
[src]
impl FunctionUnbanChatMember for RcBot
fn unban_chat_member(
&self,
_chat_id: Integer,
_user_id: Integer
) -> WrapperUnbanChatMember
[src]
fn unban_chat_member(
&self,
_chat_id: Integer,
_user_id: Integer
) -> WrapperUnbanChatMember
impl FunctionRestrictChatMember for RcBot
[src]
impl FunctionRestrictChatMember for RcBot
fn restrict_chat_member(
&self,
_chat_id: Integer,
_user_id: Integer
) -> WrapperRestrictChatMember
[src]
fn restrict_chat_member(
&self,
_chat_id: Integer,
_user_id: Integer
) -> WrapperRestrictChatMember
impl FunctionPromoteChatMember for RcBot
[src]
impl FunctionPromoteChatMember for RcBot
fn promote_chat_member(
&self,
_chat_id: Integer,
_user_id: Integer
) -> WrapperPromoteChatMember
[src]
fn promote_chat_member(
&self,
_chat_id: Integer,
_user_id: Integer
) -> WrapperPromoteChatMember
impl FunctionExportChatInviteLink for RcBot
[src]
impl FunctionExportChatInviteLink for RcBot
fn export_chat_invite_link(
&self,
_chat_id: Integer
) -> WrapperExportChatInviteLink
[src]
fn export_chat_invite_link(
&self,
_chat_id: Integer
) -> WrapperExportChatInviteLink
impl FunctionDeleteChatPhoto for RcBot
[src]
impl FunctionDeleteChatPhoto for RcBot
fn delete_chat_photo(&self, _chat_id: Integer) -> WrapperDeleteChatPhoto
[src]
fn delete_chat_photo(&self, _chat_id: Integer) -> WrapperDeleteChatPhoto
impl FunctionSetChatTitle for RcBot
[src]
impl FunctionSetChatTitle for RcBot
fn set_chat_title(
&self,
_chat_id: Integer,
_title: String
) -> WrapperSetChatTitle
[src]
fn set_chat_title(
&self,
_chat_id: Integer,
_title: String
) -> WrapperSetChatTitle
impl FunctionSetChatDescription for RcBot
[src]
impl FunctionSetChatDescription for RcBot
fn set_chat_description(
&self,
_chat_id: Integer,
_description: String
) -> WrapperSetChatDescription
[src]
fn set_chat_description(
&self,
_chat_id: Integer,
_description: String
) -> WrapperSetChatDescription
impl FunctionPinChatMessage for RcBot
[src]
impl FunctionPinChatMessage for RcBot
fn pin_chat_message(
&self,
_chat_id: Integer,
_message_id: Integer
) -> WrapperPinChatMessage
[src]
fn pin_chat_message(
&self,
_chat_id: Integer,
_message_id: Integer
) -> WrapperPinChatMessage
impl FunctionUnpinChatMessage for RcBot
[src]
impl FunctionUnpinChatMessage for RcBot
fn unpin_chat_message(&self, _chat_id: Integer) -> WrapperUnpinChatMessage
[src]
fn unpin_chat_message(&self, _chat_id: Integer) -> WrapperUnpinChatMessage
impl FunctionGetChat for RcBot
[src]
impl FunctionGetChat for RcBot
fn get_chat(&self, _chat_id: Integer) -> WrapperGetChat
[src]
fn get_chat(&self, _chat_id: Integer) -> WrapperGetChat
impl FunctionGetChatAdministrators for RcBot
[src]
impl FunctionGetChatAdministrators for RcBot
fn unban_chat_administrators(
&self,
_chat_id: Integer
) -> WrapperGetChatAdministrators
[src]
fn unban_chat_administrators(
&self,
_chat_id: Integer
) -> WrapperGetChatAdministrators
impl FunctionGetChatMemberCounts for RcBot
[src]
impl FunctionGetChatMemberCounts for RcBot
fn get_chat_members_count(
&self,
_chat_id: Integer
) -> WrapperGetChatMemberCounts
[src]
fn get_chat_members_count(
&self,
_chat_id: Integer
) -> WrapperGetChatMemberCounts
impl FunctionGetChatMember for RcBot
[src]
impl FunctionGetChatMember for RcBot
fn get_chat_member(
&self,
_chat_id: Integer,
_user_id: Integer
) -> WrapperGetChatMember
[src]
fn get_chat_member(
&self,
_chat_id: Integer,
_user_id: Integer
) -> WrapperGetChatMember
impl FunctionAnswerCallbackQuery for RcBot
[src]
impl FunctionAnswerCallbackQuery for RcBot
fn answer_callback_query(
&self,
_callback_query_id: String
) -> WrapperAnswerCallbackQuery
[src]
fn answer_callback_query(
&self,
_callback_query_id: String
) -> WrapperAnswerCallbackQuery
impl FunctionAnswerInlineQuery for RcBot
[src]
impl FunctionAnswerInlineQuery for RcBot
fn answer_inline_query(
&self,
_inline_query_id: String,
_results: Vec<Box<Serialize>>
) -> WrapperAnswerInlineQuery
[src]
fn answer_inline_query(
&self,
_inline_query_id: String,
_results: Vec<Box<Serialize>>
) -> WrapperAnswerInlineQuery
impl FunctionEditMessageText for RcBot
[src]
impl FunctionEditMessageText for RcBot
fn edit_message_text(&self, _text: String) -> WrapperEditMessageText
[src]
fn edit_message_text(&self, _text: String) -> WrapperEditMessageText
impl FunctionEditMessageCaption for RcBot
[src]
impl FunctionEditMessageCaption for RcBot
fn edit_message_caption(&self) -> WrapperEditMessageCaption
[src]
fn edit_message_caption(&self) -> WrapperEditMessageCaption
impl FunctionEditMessageReplyMarkup for RcBot
[src]
impl FunctionEditMessageReplyMarkup for RcBot
impl FunctionDeleteMessage for RcBot
[src]
impl FunctionDeleteMessage for RcBot
fn delete_message(
&self,
_chat_id: Integer,
_message_id: Integer
) -> WrapperDeleteMessage
[src]
fn delete_message(
&self,
_chat_id: Integer,
_message_id: Integer
) -> WrapperDeleteMessage
impl FunctionCreateNewStickerSet for RcBot
[src]
impl FunctionCreateNewStickerSet for RcBot
fn create_new_sticker_set(
&self,
_user_id: Integer,
_name: String,
_title: String,
_emojis: String
) -> WrapperCreateNewStickerSet
[src]
fn create_new_sticker_set(
&self,
_user_id: Integer,
_name: String,
_title: String,
_emojis: String
) -> WrapperCreateNewStickerSet
impl FunctionAddStickerToSet for RcBot
[src]
impl FunctionAddStickerToSet for RcBot
fn add_sticker_to_set(
&self,
_user_id: Integer,
_name: String,
_emojis: String
) -> WrapperAddStickerToSet
[src]
fn add_sticker_to_set(
&self,
_user_id: Integer,
_name: String,
_emojis: String
) -> WrapperAddStickerToSet
impl FunctionDeleteStickerFromSet for RcBot
[src]
impl FunctionDeleteStickerFromSet for RcBot
fn delete_sticker_from_set(
&self,
_sticker: String
) -> WrapperDeleteStickerFromSet
[src]
fn delete_sticker_from_set(
&self,
_sticker: String
) -> WrapperDeleteStickerFromSet