diff options
author | 2023-06-21 22:33:38 +0530 | |
---|---|---|
committer | 2023-06-21 23:01:19 +0530 | |
commit | dbe19b79f97ce735df4fe6287adcd2822f40f494 (patch) | |
tree | 0156e9232c55b3a27ad83355dcbfe9935d1f43d7 | |
parent | pre-commit-hooks 2.5.0 -> 4.4.0 (#2640) (diff) |
Allow use of msg reply to add context to incident
-rw-r--r-- | bot/exts/moderation/incidents.py | 3 | ||||
-rw-r--r-- | tests/bot/exts/moderation/test_incidents.py | 1 |
2 files changed, 3 insertions, 1 deletions
diff --git a/bot/exts/moderation/incidents.py b/bot/exts/moderation/incidents.py index e953eefe7..7fb8cac5a 100644 --- a/bot/exts/moderation/incidents.py +++ b/bot/exts/moderation/incidents.py @@ -134,7 +134,8 @@ def is_incident(message: discord.Message) -> bool: message.channel.id == Channels.incidents, # Message sent in #incidents not message.author.bot, # Not by a bot not message.content.startswith("#"), # Doesn't start with a hash - not message.pinned, # And isn't header + not message.pinned, # Isn't header + not message.reference, # And is not a reply ) return all(conditions) diff --git a/tests/bot/exts/moderation/test_incidents.py b/tests/bot/exts/moderation/test_incidents.py index 1a02339d4..bb337aeba 100644 --- a/tests/bot/exts/moderation/test_incidents.py +++ b/tests/bot/exts/moderation/test_incidents.py @@ -185,6 +185,7 @@ class TestIsIncident(unittest.TestCase): content="this is an incident", author=MockUser(bot=False), pinned=False, + reference=None, ) def test_is_incident_true(self): |