pub trait HandlerExt<Output> {
    fn filter_command<C>(self) -> Self
    where
        C: BotCommands + Send + Sync + 'static
; fn enter_dialogue<Upd, S, D>(self) -> Self
    where
        S: Storage<D> + ?Sized + Send + Sync + 'static,
        <S as Storage<D>>::Error: Debug + Send,
        D: Default + Send + Sync + 'static,
        Upd: GetChatId + Clone + Send + Sync + 'static
; }
Expand description

Extension methods for working with dptree handlers.

Required Methods§

Returns a handler that accepts a parsed command C.

Dependency requirements

Passes Dialogue<D, S> and D as handler dependencies.

It does so by the following steps:

  1. If an incoming update has no chat ID (GetChatId::chat_id returns None), the rest of the chain will not be executed. Otherwise, passes Dialogue::new(storage, chat_id) forwards.
  2. If Dialogue::get_or_default on the passed dialogue returns Ok, passes the dialogue state forwards. Otherwise, logs an error and the rest of the chain is not executed.
Dependency requirements
  • Arc<S>
  • Upd

Implementors§