Function teloxide::repl_with_listener[][src]

pub async fn repl_with_listener<'a, R, H, Fut, E, L, ListenerE>(
    requester: R,
    handler: H,
    listener: L
) where
    H: Fn(UpdateWithCx<R, Message>) -> Fut + Send + Sync + 'static,
    Fut: Future<Output = Result<(), E>> + Send + 'static,
    L: UpdateListener<ListenerE> + Send + 'a,
    ListenerE: Debug,
    Result<(), E>: OnError<E>,
    E: Debug + Send,
    R: Requester + Clone + Send + 'static, 

Like repl, but with a custom UpdateListener.

All errors from an update listener and handler will be logged.

Caution

DO NOT use this function together with Dispatcher and other REPLs, because Telegram disallow multiple requests at the same time from the same bot.