aboutsummaryrefslogtreecommitdiffstats
path: root/bot/exts/easter/easter_riddle.py
diff options
context:
space:
mode:
authorGravatar Chris <[email protected]>2021-04-11 16:25:26 +0100
committerGravatar Chris <[email protected]>2021-04-11 16:25:26 +0100
commitc2a7f6b407765a0d2a4d4db6e28d54f8a967e40c (patch)
tree5c9c3eef83c94f8cacebf07d5a8b86da7658cb02 /bot/exts/easter/easter_riddle.py
parentEnsure to await ctx.send() calls (diff)
parentMerge pull request #666 from onerandomusername/remove-topic (diff)
Merge branch 'main' into Enforce-image-processing-concurrency
Diffstat (limited to 'bot/exts/easter/easter_riddle.py')
-rw-r--r--bot/exts/easter/easter_riddle.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/bot/exts/easter/easter_riddle.py b/bot/exts/easter/easter_riddle.py
index 3c612eb1..a93b3745 100644
--- a/bot/exts/easter/easter_riddle.py
+++ b/bot/exts/easter/easter_riddle.py
@@ -7,7 +7,7 @@ from pathlib import Path
import discord
from discord.ext import commands
-from bot.constants import Colours
+from bot.constants import Colours, NEGATIVE_REPLIES
log = logging.getLogger(__name__)
@@ -36,6 +36,17 @@ class EasterRiddle(commands.Cog):
if self.current_channel:
return await ctx.send(f"A riddle is already being solved in {self.current_channel.mention}!")
+ # Don't let users start in a DM
+ if not ctx.guild:
+ await ctx.send(
+ embed=discord.Embed(
+ title=random.choice(NEGATIVE_REPLIES),
+ description="You can't start riddles in DMs",
+ colour=discord.Colour.red()
+ )
+ )
+ return
+
self.current_channel = ctx.message.channel
random_question = random.choice(RIDDLE_QUESTIONS)