aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/commands/meme.rs23
-rw-r--r--src/main.rs4
2 files changed, 18 insertions, 9 deletions
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::<PlayQueue>().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::<PlayQueue>().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(())
diff --git a/src/main.rs b/src/main.rs
index 1577c89..177f726 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -136,6 +136,10 @@ fn run() -> Result<()> {
trace!("command '{}' completed successfully", cmd);
},
Err(e) => {
+ if let Err(e) = msg.react("❌") {
+ error!("reacting to failed message: {}", e);
+ }
+
if let Err(e) = crate::commands::send(msg.channel_id, "BANIC", msg.tts) {
error!("sending BANIC: {}", e);
}