pub trait SlashCommand: Send + Sync {
// Required methods
fn name(&self) -> &'static str;
fn description(&self) -> &'static str;
fn usage(&self) -> &'static str;
fn execute<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
state: &'life1 mut ActorState,
args: &'life2 [&'life3 str],
) -> Pin<Box<dyn Future<Output = Vec<ChatMessage>> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
// Provided method
fn hidden(&self) -> bool { ... }
}Expand description
A slash command that can be provided by a module. Modules implement this trait for commands they want to register.
Required Methods§
Sourcefn name(&self) -> &'static str
fn name(&self) -> &'static str
The command name without the leading slash (e.g., “memory” for /memory)
Sourcefn description(&self) -> &'static str
fn description(&self) -> &'static str
Short description shown in help
Sourcefn execute<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
state: &'life1 mut ActorState,
args: &'life2 [&'life3 str],
) -> Pin<Box<dyn Future<Output = Vec<ChatMessage>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn execute<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
state: &'life1 mut ActorState,
args: &'life2 [&'life3 str],
) -> Pin<Box<dyn Future<Output = Vec<ChatMessage>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Execute the command with the given arguments
Provided Methods§
Whether to hide this command from /help output