diff options
| author | 2020-06-12 17:37:27 +0200 | |
|---|---|---|
| committer | 2020-06-12 17:37:57 +0200 | |
| commit | 506f91a77d3dd1bb92222bd3fce4a7316677ddbb (patch) | |
| tree | 5a3a89beb1eba2fa81541f86d72992770c6605e7 | |
| parent | Incidents: implement `process_event` coroutine (diff) | |
Incidents: do not process reaction events from bots
| -rw-r--r-- | bot/cogs/moderation/incidents.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/bot/cogs/moderation/incidents.py b/bot/cogs/moderation/incidents.py index 00cceca7d..f19bdb41f 100644 --- a/bot/cogs/moderation/incidents.py +++ b/bot/cogs/moderation/incidents.py @@ -248,7 +248,8 @@ class Incidents(Cog): """ Pre-process `payload` and pass it to `process_event` if appropriate. - We abort instantly if `payload` doesn't relate to a message sent in #incidents. + We abort instantly if `payload` doesn't relate to a message sent in #incidents, + or if it was sent by a bot. If `payload` relates to a message in #incidents, we first ensure that `crawl_task` has finished, to make sure we don't mutate channel state as we're crawling it. @@ -266,7 +267,7 @@ class Incidents(Cog): which were not cached in the current session. As a result, a certain amount of complexity is introduced, but at the moment this doesn't appear to be avoidable. """ - if payload.channel_id != Channels.incidents: + if payload.channel_id != Channels.incidents or payload.member.bot: return log.debug(f"Received reaction add event in #incidents, waiting for crawler: {self.crawl_task.done()=}") |