mirror of
https://github.com/natsukagami/youmubot.git
synced 2025-05-24 01:00:49 +00:00
osu: make save
command use interaction
This commit is contained in:
parent
e777d4d634
commit
068dd48550
6 changed files with 94 additions and 59 deletions
|
@ -186,21 +186,31 @@ pub async fn save<U: HasOsuEnv>(
|
|||
CreateReply::default()
|
||||
.content(save_request_message(&u.username, score.beatmap_id, mode))
|
||||
.embed(beatmap_embed(&beatmap, mode, Mods::NOMOD, &info))
|
||||
.components(vec![beatmap_components(mode, ctx.guild_id())]),
|
||||
.components(vec![
|
||||
beatmap_components(mode, ctx.guild_id()),
|
||||
save_button(),
|
||||
]),
|
||||
)
|
||||
.await?
|
||||
.into_message()
|
||||
.await?;
|
||||
handle_save_respond(
|
||||
let mut p = (reply, ctx.clone());
|
||||
match handle_save_respond(
|
||||
ctx.serenity_context(),
|
||||
&env,
|
||||
ctx.author().id,
|
||||
reply,
|
||||
&mut p,
|
||||
&beatmap,
|
||||
u,
|
||||
mode,
|
||||
)
|
||||
.await?;
|
||||
.await
|
||||
{
|
||||
Ok(_) => (),
|
||||
Err(e) => {
|
||||
p.0.delete(ctx).await?;
|
||||
return Err(e.into());
|
||||
}
|
||||
};
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue