Suppress errors. Restyle

This commit is contained in:
jude
2023-07-31 17:59:38 +01:00
parent ea2cea573e
commit 3605d71b73
3 changed files with 15 additions and 5 deletions

View File

@ -176,6 +176,20 @@ async fn _main(tx: Sender<()>) -> Result<(), Box<dyn StdError + Send + Sync>> {
allowed_mentions: None,
command_check: Some(|ctx| Box::pin(all_checks(ctx))),
event_handler: |ctx, event, _framework, data| Box::pin(listener(ctx, event, data)),
on_error: |error| {
Box::pin(async move {
match error {
poise::FrameworkError::CommandCheckFailed { .. } => {
// suppress error
}
error => {
if let Err(e) = poise::builtins::on_error(error).await {
log::error!("Error while handling error: {}", e);
}
}
}
})
},
..Default::default()
};