From 50c457ac2efb5ec0b8e9285fdf8ca56c42c355c5 Mon Sep 17 00:00:00 2001 From: trivernis Date: Sat, 17 Apr 2021 16:10:18 +0200 Subject: [PATCH] Fix now playing message not being updated Signed-off-by: trivernis --- bot-serenityutils/Cargo.toml | 2 +- src/commands/music/play.rs | 4 +++- src/commands/music/play_next.rs | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/bot-serenityutils/Cargo.toml b/bot-serenityutils/Cargo.toml index fbebef9..8e1b28f 100644 --- a/bot-serenityutils/Cargo.toml +++ b/bot-serenityutils/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bot-serenityutils" -version = "0.2.2" +version = "0.2.3" authors = ["trivernis "] edition = "2018" diff --git a/src/commands/music/play.rs b/src/commands/music/play.rs index 2664018..00e022e 100644 --- a/src/commands/music/play.rs +++ b/src/commands/music/play.rs @@ -69,7 +69,9 @@ async fn play(ctx: &Context, msg: &Message, args: Args) -> CommandResult { while !play_next_in_queue(&ctx.http, &msg.channel_id, &queue, &handler_lock).await {} } if create_now_playing { - create_now_playing_msg(ctx, queue, msg.channel_id).await?; + let handle = create_now_playing_msg(ctx, queue.clone(), msg.channel_id).await?; + let mut queue_lock = queue.lock().await; + queue_lock.now_playing_msg = Some(handle); } handle_autodelete(ctx, msg).await?; diff --git a/src/commands/music/play_next.rs b/src/commands/music/play_next.rs index c4d3b45..b188bfc 100644 --- a/src/commands/music/play_next.rs +++ b/src/commands/music/play_next.rs @@ -60,7 +60,9 @@ async fn play_next(ctx: &Context, msg: &Message, args: Args) -> CommandResult { while !play_next_in_queue(&ctx.http, &msg.channel_id, &queue, &handler).await {} } if create_now_playing { - create_now_playing_msg(ctx, queue, msg.channel_id).await?; + let handle = create_now_playing_msg(ctx, queue.clone(), msg.channel_id).await?; + let mut queue_lock = queue.lock().await; + queue_lock.now_playing_msg = Some(handle); } handle_autodelete(ctx, msg).await?;