mirror of
https://github.com/natsukagami/youmubot.git
synced 2025-04-18 00:08:54 +00:00
Pagination: just delete our own reaction as fallback
... happens if we don't have message management permissions. We definitely don't want to vomit errors to the user.
This commit is contained in:
parent
2a279e62e4
commit
431f295b41
1 changed files with 5 additions and 2 deletions
|
@ -1,4 +1,4 @@
|
|||
use crate::{Context, Result};
|
||||
use crate::{Context, OkPrint, Result};
|
||||
use futures_util::{future::Future, StreamExt as _};
|
||||
use serenity::{
|
||||
builder::CreateMessage,
|
||||
|
@ -174,7 +174,10 @@ async fn paginate_with_first_message(
|
|||
};
|
||||
|
||||
for reaction in reactions {
|
||||
reaction.delete_all(&ctx).await?;
|
||||
if let None = reaction.delete_all(&ctx).await.pls_ok() {
|
||||
// probably no permission to delete all reactions, fall back to delete my own.
|
||||
reaction.delete(&ctx).await.pls_ok();
|
||||
}
|
||||
}
|
||||
|
||||
res
|
||||
|
|
Loading…
Add table
Reference in a new issue