diff options
| author | 2020-06-12 14:02:58 +0200 | |
|---|---|---|
| committer | 2020-06-12 14:02:58 +0200 | |
| commit | 1aaaee1144f660af7a69d12f814d0073451da7be (patch) | |
| tree | fea8d247ea3f443d85cbf3fc8be8217bf7341fe7 | |
| parent | Incidents: implement & schedule `crawl_incidents` task (diff) | |
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.
| -rw-r--r-- | bot/cogs/moderation/incidents.py | 5 |
1 files changed, 5 insertions, 0 deletions
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) |