aboutsummaryrefslogtreecommitdiffstats
path: root/bot/exts/evergreen/issues.py
diff options
context:
space:
mode:
authorGravatar Chris <[email protected]>2021-02-05 19:17:59 +0000
committerGravatar Chris <[email protected]>2021-02-05 19:17:59 +0000
commit0d5da9e1304865034e8a2349d33b132e149ad890 (patch)
treee39b5f94a79c98cc121d0b97714ead21fe96c5cb /bot/exts/evergreen/issues.py
parentMerge pull request #572 from Shivansh-007/feature/cheat.sh (diff)
First pass of easy to produce errors
Diffstat (limited to 'bot/exts/evergreen/issues.py')
-rw-r--r--bot/exts/evergreen/issues.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/bot/exts/evergreen/issues.py b/bot/exts/evergreen/issues.py
index 73ebe547..1f22f287 100644
--- a/bot/exts/evergreen/issues.py
+++ b/bot/exts/evergreen/issues.py
@@ -178,7 +178,12 @@ class Issues(commands.Cog):
@commands.Cog.listener()
async def on_message(self, message: discord.Message) -> None:
"""Command to retrieve issue(s) from a GitHub repository using automatic linking if matching <repo>#<issue>."""
- if not(
+ # Ignore messages from DMs
+ if not message.guild:
+ return
+
+ # Ignore messages not in whitelisted categories / channels
+ if not (
message.channel.category.id in WHITELISTED_CATEGORIES
or message.channel.id in WHITELISTED_CHANNELS_ON_MESSAGE
):