From ff40de92eec43dbbb8fd50517195d9075b515a8e Mon Sep 17 00:00:00 2001 From: Joey Hines Date: Sat, 23 May 2020 16:35:19 -0500 Subject: [PATCH] Reactions are only checked in they are in the event channel --- src/main.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index ff00af9..e8fefed 100644 --- a/src/main.rs +++ b/src/main.rs @@ -64,7 +64,8 @@ struct Handler; impl EventHandler for Handler { /// On reaction add fn reaction_add(&self, ctx: Context, reaction: Reaction) { - if reaction.emoji.as_data() == INTERESTED_EMOJI { + let config = get_config(&ctx.data).unwrap(); + if reaction.channel_id.0 == config.event_channel && reaction.emoji.as_data() == INTERESTED_EMOJI { send_message_to_reaction_users( &ctx, &reaction, @@ -75,7 +76,8 @@ impl EventHandler for Handler { /// On reaction remove fn reaction_remove(&self, ctx: Context, reaction: Reaction) { - if reaction.emoji.as_data() == INTERESTED_EMOJI { + let config = get_config(&ctx.data).unwrap(); + if reaction.channel_id.0 == config.event_channel && reaction.emoji.as_data() == INTERESTED_EMOJI { send_message_to_reaction_users( &ctx, &reaction,