diff options
| author | 2021-04-15 19:18:47 +0530 | |
|---|---|---|
| committer | 2021-04-15 19:18:47 +0530 | |
| commit | c25976c654162cd4222b1d1e1088d978971bcabb (patch) | |
| tree | b455db8577d1746d7623e7b891a8549432246eea /bot/exts/easter/easter_riddle.py | |
| parent | Merge branch 'master' of https://github.com/python-discord/sir-lancebot (diff) | |
| parent | Merge pull request #679 from python-discord/vcokltfre/fix/timed-error-help (diff) | |
Update branch
Diffstat (limited to 'bot/exts/easter/easter_riddle.py')
| -rw-r--r-- | bot/exts/easter/easter_riddle.py | 13 |
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) |