osu: make save command use interaction

This commit is contained in:
Natsu Kagami 2025-02-22 17:13:57 +01:00 committed by Natsu Kagami
parent e777d4d634
commit 068dd48550
6 changed files with 94 additions and 59 deletions

View file

@ -8,12 +8,6 @@ use serenity::{
builder::CreateMessage,
model::{channel::Message, id::ChannelId},
};
use tokio::time as tokio_time;
// const ARROW_RIGHT: &str = "➡️";
// const ARROW_LEFT: &str = "⬅️";
// const REWIND: &str = "⏪";
// const FAST_FORWARD: &str = "⏩";
const NEXT: &str = "youmubot_pagination_next";
const PREV: &str = "youmubot_pagination_prev";
@ -269,10 +263,9 @@ pub async fn paginate_with_first_message(
// Loop the handler function.
let res: Result<()> = loop {
match tokio_time::timeout(timeout, recv.clone().into_recv_async()).await {
Err(_) => break Ok(()),
Ok(Err(_)) => break Ok(()),
Ok(Ok(reaction)) => {
match recv.next(timeout).await {
None => break Ok(()),
Some(reaction) => {
page = match pager
.handle_reaction(page, ctx, &mut message, &reaction)
.await