pub trait CommandHandler: Send + Sync {
// Required method
fn on_command<'life0, 'async_trait>(
&'life0 self,
ctx: CommandContext,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Handler invoked when a registered slash command is executed.
Returning Err(_) causes the SDK to forward the error message back to
the CLI via session.commands.handlePendingCommand so the TUI can
surface it. Returning Ok(()) reports success.
Required Methods§
Sourcefn on_command<'life0, 'async_trait>(
&'life0 self,
ctx: CommandContext,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn on_command<'life0, 'async_trait>(
&'life0 self,
ctx: CommandContext,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Called when the user invokes the command this handler is registered for.