From 1aaaee1144f660af7a69d12f814d0073451da7be Mon Sep 17 00:00:00 2001 From: kwzrd Date: Fri, 12 Jun 2020 14:02:58 +0200 Subject: Incidents: make `on_message` ignore pinned messages This is now necessary as we call the listener ourselves from the crawl task. An already existing, pinned message, can be received. --- bot/cogs/moderation/incidents.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bot/cogs/moderation/incidents.py b/bot/cogs/moderation/incidents.py index e773636e7..1b9d26522 100644 --- a/bot/cogs/moderation/incidents.py +++ b/bot/cogs/moderation/incidents.py @@ -77,6 +77,7 @@ class Incidents(Cog): * Messages sent outside of #incidents * Messages Sent by bots * Messages starting with the hash symbol # + * Pinned (header) messages Prefix message with # in situations where a verbal response is necessary. Each such message must be deleted manually. @@ -88,4 +89,8 @@ class Incidents(Cog): log.debug(f"Ignoring comment message: {message.content=}") return + if message.pinned: + log.debug(f"Ignoring header message: {message.pinned=}") + return + await self.add_signals(message) -- cgit v1.2.3