pub trait BotProtocol: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn on_message<'life0, 'async_trait>(
&'life0 self,
message: BotMessage,
) -> Pin<Box<dyn Future<Output = Result<BotResponse>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn on_command<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
command: &'life1 str,
args: &'life2 [&'life3 str],
) -> Pin<Box<dyn Future<Output = Result<BotResponse>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
fn start<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn stop<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Bot protocol for chat integrations.
Required Methods§
Sourcefn on_message<'life0, 'async_trait>(
&'life0 self,
message: BotMessage,
) -> Pin<Box<dyn Future<Output = Result<BotResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn on_message<'life0, 'async_trait>(
&'life0 self,
message: BotMessage,
) -> Pin<Box<dyn Future<Output = Result<BotResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle incoming message
Sourcefn on_command<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
command: &'life1 str,
args: &'life2 [&'life3 str],
) -> Pin<Box<dyn Future<Output = Result<BotResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn on_command<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
command: &'life1 str,
args: &'life2 [&'life3 str],
) -> Pin<Box<dyn Future<Output = Result<BotResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Handle command