From 2f49f09a279f9cc20e2ea1dc312e213442cc7bf3 Mon Sep 17 00:00:00 2001 From: Natsu Kagami Date: Thu, 16 Jan 2025 19:08:40 +0100 Subject: [PATCH] Check matching mod when saving --- youmubot-osu/src/discord/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/youmubot-osu/src/discord/mod.rs b/youmubot-osu/src/discord/mod.rs index 2dbe38b..a39670d 100644 --- a/youmubot-osu/src/discord/mod.rs +++ b/youmubot-osu/src/discord/mod.rs @@ -333,7 +333,7 @@ pub(crate) async fn handle_save_respond( mode: Mode, ) -> Result<()> { let osu_client = &env.client; - async fn check(client: &OsuHttpClient, u: &User, map_id: u64) -> Result { + async fn check(client: &OsuHttpClient, u: &User, mode: Mode, map_id: u64) -> Result { Ok(client .user_recent(UserID::ID(u.id), |f| f.mode(Mode::Std).limit(1)) .await? @@ -352,7 +352,7 @@ pub(crate) async fn handle_save_respond( .next() .await; if let Some(ur) = user_reaction { - if check(osu_client, &user, beatmap.beatmap_id).await? { + if check(osu_client, &user, mode, beatmap.beatmap_id).await? { break true; } ur.delete(&ctx).await?;