Return whether command handled message

This commit is contained in:
Joscha 2023-02-27 12:41:49 +01:00
parent a6331d50b8
commit 4479126500
12 changed files with 142 additions and 47 deletions

View file

@ -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)
}
}