Add error type parameter to commands
This commit is contained in:
parent
4dcc021f73
commit
ec9c4c9dd4
3 changed files with 41 additions and 33 deletions
|
|
@ -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>;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue