From 2685e6028dd775bcd618a3d8d2b22e32730454a3 Mon Sep 17 00:00:00 2001 From: Nathan Perry Date: Fri, 15 Mar 2019 07:54:16 -0400 Subject: add reaction whenever playing audio and reaction to message failure --- src/commands/meme.rs | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'src/commands') diff --git a/src/commands/meme.rs b/src/commands/meme.rs index 064486d..5dbd831 100644 --- a/src/commands/meme.rs +++ b/src/commands/meme.rs @@ -466,16 +466,21 @@ fn send_meme(ctx: &Context, t: &Meme, conn: &PgConnection, msg: &Message) -> Res // not worrying about it if let Some(audio) = audio { let audio = audio?; - let queue_lock = ctx.data.lock().get::().cloned().unwrap(); - let mut play_queue = queue_lock.write().unwrap(); - - play_queue.meme_queue.push_back(PlayArgs{ - initiator: msg.author.name.clone(), - data: ::either::Right(audio.data.clone()), - sender_channel: msg.channel_id, - start: None, - end: None, - }); + + { + let queue_lock = ctx.data.lock().get::().cloned().unwrap(); + let mut play_queue = queue_lock.write().unwrap(); + + play_queue.meme_queue.push_back(PlayArgs{ + initiator: msg.author.name.clone(), + data: ::either::Right(audio.data.clone()), + sender_channel: msg.channel_id, + start: None, + end: None, + }); + } + + msg.react("📣")?; } Ok(()) -- cgit v1.3.1