Struct telebot::bot::RcBot
[−]
[src]
pub struct RcBot { pub inner: Rc<Bot>, }
A clonable, single threaded bot
The outer API gets implemented on RcBot
Fields
inner: Rc<Bot>
Methods
impl RcBot
[src]
impl RcBot
[src]
fn update_interval(self, interval: u64) -> RcBot
Sets the update interval to an integer in milliseconds
fn new_cmd(
&self,
cmd: &str
) -> impl Stream<Item = (RcBot, Message), Error = Error>
&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
fn register<T>(&self, hnd: T) where
T: Stream + 'static,
T: Stream + 'static,
Register a new commnd
fn get_stream<'a>(
&'a self
) -> impl Stream<Item = (RcBot, Update), Error = Error> + '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
fn run<'a>(&'a self, core: &mut Core) -> Result<(), Error>
helper function to start the event loop
Trait Implementations
impl Clone for RcBot
[src]
fn clone(&self) -> RcBot
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl FunctionGetMe for RcBot
[src]
fn get_me(&self) -> WrapperGetMe
impl FunctionGetUpdates for RcBot
[src]
fn get_updates(&self) -> WrapperGetUpdates
impl FunctionMessage for RcBot
[src]
fn message(&self, _chat_id: Integer, _text: String) -> WrapperMessage
impl FunctionSendPhoto for RcBot
[src]
fn photo(&self, _chat_id: Integer) -> WrapperSendPhoto
impl FunctionSendAudio for RcBot
[src]
fn audio(&self, _chat_id: Integer) -> WrapperSendAudio
impl FunctionSendDocument for RcBot
[src]
fn document(&self, _chat_id: Integer) -> WrapperSendDocument
impl FunctionSendSticker for RcBot
[src]
fn sticker(&self, _chat_id: Integer) -> WrapperSendSticker
impl FunctionSendVideo for RcBot
[src]
fn video(&self, _chat_id: Integer) -> WrapperSendVideo
impl FunctionSendVoice for RcBot
[src]
fn voice(&self, _chat_id: Integer) -> WrapperSendVoice
impl FunctionSendLocation for RcBot
[src]
fn location(
&self,
_chat_id: Integer,
_latitude: f32,
_longitude: f32
) -> WrapperSendLocation
&self,
_chat_id: Integer,
_latitude: f32,
_longitude: f32
) -> WrapperSendLocation
impl FunctionSendVenue for RcBot
[src]
fn venue(
&self,
_chat_id: Integer,
_latitude: f32,
_longitude: f32,
_title: String,
_address: String
) -> WrapperSendVenue
&self,
_chat_id: Integer,
_latitude: f32,
_longitude: f32,
_title: String,
_address: String
) -> WrapperSendVenue
impl FunctionSendContact for RcBot
[src]
fn contact(
&self,
_chat_id: Integer,
_phone_number: String,
_first_name: String
) -> WrapperSendContact
&self,
_chat_id: Integer,
_phone_number: String,
_first_name: String
) -> WrapperSendContact
impl FunctionSendAction for RcBot
[src]
fn chat_action(&self, _chat_id: Integer, _action: String) -> WrapperSendAction
impl FunctionGetUserProfilePhotos for RcBot
[src]
fn get_user_profile_photos(
&self,
_user_id: Integer
) -> WrapperGetUserProfilePhotos
&self,
_user_id: Integer
) -> WrapperGetUserProfilePhotos
impl FunctionGetFile for RcBot
[src]
fn get_file(&self, _file_id: String) -> WrapperGetFile
impl FunctionKickChatMember for RcBot
[src]
fn kick_chat_member(
&self,
_chat_id: Integer,
_user_id: Integer
) -> WrapperKickChatMember
&self,
_chat_id: Integer,
_user_id: Integer
) -> WrapperKickChatMember
impl FunctionLeaveChat for RcBot
[src]
fn leave_chat(&self, _chat_id: Integer) -> WrapperLeaveChat
impl FunctionUnbanChatMember for RcBot
[src]
fn unban_chat_member(
&self,
_chat_id: Integer,
_user_id: Integer
) -> WrapperUnbanChatMember
&self,
_chat_id: Integer,
_user_id: Integer
) -> WrapperUnbanChatMember
impl FunctionGetChat for RcBot
[src]
fn get_chat(&self, _chat_id: Integer) -> WrapperGetChat
impl FunctionGetChatAdministrators for RcBot
[src]
fn unban_chat_administrators(
&self,
_chat_id: Integer
) -> WrapperGetChatAdministrators
&self,
_chat_id: Integer
) -> WrapperGetChatAdministrators
impl FunctionGetChatMemberCounts for RcBot
[src]
fn get_chat_members_count(
&self,
_chat_id: Integer
) -> WrapperGetChatMemberCounts
&self,
_chat_id: Integer
) -> WrapperGetChatMemberCounts
impl FunctionGetChatMember for RcBot
[src]
fn get_chat_members_count(
&self,
_chat_id: Integer,
_user_id: Integer
) -> WrapperGetChatMember
&self,
_chat_id: Integer,
_user_id: Integer
) -> WrapperGetChatMember
impl FunctionAnwerCallbackQuery for RcBot
[src]
fn answer_callback_query(
&self,
_callback_query_id: String
) -> WrapperAnwerCallbackQuery
&self,
_callback_query_id: String
) -> WrapperAnwerCallbackQuery
impl FunctionAnswerInlineQuery for RcBot
[src]
fn answer_inline_query(
&self,
_inline_query_id: String,
_results: Vec<Box<Serialize>>
) -> WrapperAnswerInlineQuery
&self,
_inline_query_id: String,
_results: Vec<Box<Serialize>>
) -> WrapperAnswerInlineQuery