From 9b5ec5aa069c2b1617b7ee56981ea34211be335e Mon Sep 17 00:00:00 2001
From: tec <tec@ucc.gu.uwa.edu.au>
Date: Sun, 20 Oct 2019 22:16:41 +0800
Subject: [PATCH] Ignore bot reactions, but care about bot messages

---
 src/main.rs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/main.rs b/src/main.rs
index 991ceb0..4898db6 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -89,7 +89,7 @@ impl EventHandler for Handler {
     fn reaction_add(&self, ctx: Context, add_reaction: channel::Reaction) {
         match add_reaction.message(&ctx.http) {
             Ok(message) => {
-                if message.author.id.0 == config::BOT_ID {
+                if message.author.id.0 != config::BOT_ID || add_reaction.user_id == config::BOT_ID {
                     return;
                 }
                 match message_type(&message) {
@@ -106,7 +106,7 @@ impl EventHandler for Handler {
     fn reaction_remove(&self, ctx: Context, removed_reaction: channel::Reaction) {
         match removed_reaction.message(&ctx.http) {
             Ok(message) => {
-                if message.author.id.0 == config::BOT_ID {
+                if message.author.id.0 != config::BOT_ID || removed_reaction.user_id == config::BOT_ID {
                     return;
                 }
                 match message_type(&message) {
-- 
GitLab