From dbe19b79f97ce735df4fe6287adcd2822f40f494 Mon Sep 17 00:00:00 2001 From: vivekashok1221 Date: Wed, 21 Jun 2023 22:33:38 +0530 Subject: Allow use of msg reply to add context to incident --- bot/exts/moderation/incidents.py | 3 ++- tests/bot/exts/moderation/test_incidents.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) 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): -- cgit v1.2.3