Add error type parameter to commands

This commit is contained in:
Joscha 2023-01-24 14:44:17 +01:00
parent 4dcc021f73
commit ec9c4c9dd4
3 changed files with 41 additions and 33 deletions

View file

@ -76,10 +76,10 @@ impl Context {
}
#[async_trait]
pub trait Command<B> {
pub trait Command<B, E> {
fn description(&self) -> Option<String> {
None
}
async fn execute(&self, arg: &str, msg: &Message, ctx: &Context, bot: &mut B);
async fn execute(&self, arg: &str, msg: &Message, ctx: &Context, bot: &mut B) -> Result<(), E>;
}