mirror of
https://github.com/natsukagami/youmubot.git
synced 2025-04-19 00:38:54 +00:00
Check matching mod when saving
This commit is contained in:
parent
428ca8861f
commit
a5fd4f4eab
1 changed files with 2 additions and 2 deletions
|
@ -333,7 +333,7 @@ pub(crate) async fn handle_save_respond(
|
||||||
mode: Mode,
|
mode: Mode,
|
||||||
) -> Result<()> {
|
) -> Result<()> {
|
||||||
let osu_client = &env.client;
|
let osu_client = &env.client;
|
||||||
async fn check(client: &OsuHttpClient, u: &User, map_id: u64) -> Result<bool> {
|
async fn check(client: &OsuHttpClient, u: &User, mode: Mode, map_id: u64) -> Result<bool> {
|
||||||
Ok(client
|
Ok(client
|
||||||
.user_recent(UserID::ID(u.id), |f| f.mode(Mode::Std).limit(1))
|
.user_recent(UserID::ID(u.id), |f| f.mode(Mode::Std).limit(1))
|
||||||
.await?
|
.await?
|
||||||
|
@ -352,7 +352,7 @@ pub(crate) async fn handle_save_respond(
|
||||||
.next()
|
.next()
|
||||||
.await;
|
.await;
|
||||||
if let Some(ur) = user_reaction {
|
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;
|
break true;
|
||||||
}
|
}
|
||||||
ur.delete(&ctx).await?;
|
ur.delete(&ctx).await?;
|
||||||
|
|
Loading…
Add table
Reference in a new issue