[−][src]Function teloxide::commands_repl_with_listener
pub async fn commands_repl_with_listener<'a, Cmd, H, Fut, L, ListenerE, HandlerE>(
bot: Bot,
bot_name: &'static str,
handler: H,
listener: L
) where
Cmd: BotCommand + Send + 'static,
H: Fn(UpdateWithCx<Message>, Cmd) -> Fut + Send + Sync + 'static,
Fut: Future<Output = Result<(), HandlerE>> + Send + 'static,
L: UpdateListener<ListenerE> + Send + 'a,
ListenerE: Debug + Send + 'a,
Result<(), HandlerE>: OnError<HandlerE>,
HandlerE: Debug + Send,
Like commands_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.