aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Amrou Bellalouna <[email protected]>2023-06-21 20:47:46 +0200
committerGravatar GitHub <[email protected]>2023-06-21 20:47:46 +0200
commit3ca011f72115545b7e674dc6917ae8bc86a11995 (patch)
tree3833a33cae6dc984cd7d7c89ad135acc16b115bd
parentMerge pull request #2653 from python-discord/compf_pings (diff)
parentMerge branch 'main' into vivek/incidents-context (diff)
Merge pull request #2652 from python-discord/vivek/incidents-context
Allow use of message reply feature to add additional context to incident reports
-rw-r--r--bot/exts/moderation/incidents.py3
-rw-r--r--tests/bot/exts/moderation/test_incidents.py1
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):