aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar ChrisJL <[email protected]>2022-03-04 10:04:53 +0000
committerGravatar GitHub <[email protected]>2022-03-04 10:04:53 +0000
commit34a650a5b137cf4d03da48cb0912655ee5de1aa9 (patch)
treeadc0d806a2a4fbffd0279324c6d25b536b39795e
parentMerge pull request #2107 from an-dyy/patch-1 (diff)
parentMerge branch 'main' into fix-bot-2081 (diff)
Merge pull request #2086 from python-discord/fix-bot-2081
Fix DM handling for code snippets.
-rw-r--r--bot/exts/info/code_snippets.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/bot/exts/info/code_snippets.py b/bot/exts/info/code_snippets.py
index 07b1b8a2d..f2f29020f 100644
--- a/bot/exts/info/code_snippets.py
+++ b/bot/exts/info/code_snippets.py
@@ -246,6 +246,9 @@ class CodeSnippets(Cog):
if message.author.bot:
return
+ if message.guild is None:
+ return
+
message_to_send = await self._parse_snippets(message.content)
destination = message.channel