[−][src]Struct telebot::bot::Bot
Fields
request: RequestHandle
handlers: HashMap<String, UnboundedSender<(RequestHandle, Message)>>
unknown_handler: Option<UnboundedSender<(RequestHandle, Message)>>
callback_handler: Option<UnboundedSender<(RequestHandle, CallbackQuery)>>
inline_handler: Option<UnboundedSender<(RequestHandle, InlineQuery)>>
Methods
impl Bot
[src]
pub fn new(key: &str) -> Bot
[src]
pub fn update_interval(self, interval: u64) -> Bot
[src]
Sets the update interval to an integer in milliseconds
pub fn timeout(self, timeout: u64) -> Bot
[src]
Sets the timeout interval for long polling
pub fn new_cmd(
&mut self,
cmd: &str
) -> impl Stream<Item = (RequestHandle, Message), Error = Error>
[src]
&mut self,
cmd: &str
) -> impl Stream<Item = (RequestHandle, 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(
&mut self
) -> impl Stream<Item = (RequestHandle, Message), Error = Error>
[src]
&mut self
) -> impl Stream<Item = (RequestHandle, Message), Error = Error>
Returns a stream which will yield a message when none of previously registered commands matches
pub fn callback(
&mut self
) -> impl Stream<Item = (RequestHandle, CallbackQuery), Error = Error>
[src]
&mut self
) -> impl Stream<Item = (RequestHandle, CallbackQuery), Error = Error>
Returns a stream which will yield a received CallbackQuery
pub fn inline(
&mut self
) -> impl Stream<Item = (RequestHandle, InlineQuery), Error = Error>
[src]
&mut self
) -> impl Stream<Item = (RequestHandle, InlineQuery), Error = Error>
Returns a stream which will yield a received CallbackQuery
pub fn resolve_name(&self) -> impl Future<Item = Option<String>, Error = Error>
[src]
pub fn process_updates(
self,
last_id: Arc<AtomicUsize>
) -> impl Stream<Item = (RequestHandle, Update), Error = Error>
[src]
self,
last_id: Arc<AtomicUsize>
) -> impl Stream<Item = (RequestHandle, Update), Error = Error>
pub fn get_stream(
self,
name: Option<String>
) -> impl Stream<Item = (RequestHandle, Update), Error = Error>
[src]
self,
name: Option<String>
) -> impl Stream<Item = (RequestHandle, Update), Error = Error>
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 into_future(&self) -> impl Future<Item = (), Error = Error>
[src]
pub fn run_with<I>(self, other: I) where
I: IntoFuture<Error = Error>,
<I as IntoFuture>::Future: Send + 'static,
<I as IntoFuture>::Item: Send,
[src]
I: IntoFuture<Error = Error>,
<I as IntoFuture>::Future: Send + 'static,
<I as IntoFuture>::Item: Send,
pub fn run(self)
[src]
Trait Implementations
Auto Trait Implementations
Blanket Implementations
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, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,