Return whether command handled message
This commit is contained in:
parent
a6331d50b8
commit
4479126500
12 changed files with 142 additions and 47 deletions
|
|
@ -30,11 +30,13 @@ where
|
|||
msg: &Message,
|
||||
ctx: &Context,
|
||||
_bot: &mut B,
|
||||
) -> Result<(), E> {
|
||||
) -> Result<bool, E> {
|
||||
if arg.trim().is_empty() {
|
||||
ctx.reply(msg.id, &self.0).await?;
|
||||
Ok(true)
|
||||
} else {
|
||||
Ok(false)
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -55,8 +57,8 @@ where
|
|||
msg: &Message,
|
||||
ctx: &Context,
|
||||
_bot: &mut B,
|
||||
) -> Result<(), E> {
|
||||
) -> Result<bool, E> {
|
||||
ctx.reply(msg.id, &self.0).await?;
|
||||
Ok(())
|
||||
Ok(true)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue