aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bot/cogs/security.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/bot/cogs/security.py b/bot/cogs/security.py
index f4a843fbf..9523766af 100644
--- a/bot/cogs/security.py
+++ b/bot/cogs/security.py
@@ -1,6 +1,6 @@
import logging
-from discord.ext.commands import Bot, Context
+from discord.ext.commands import Bot, Context, NoPrivateMessage
log = logging.getLogger(__name__)
@@ -19,7 +19,9 @@ class Security:
return not ctx.author.bot
def check_on_guild(self, ctx: Context):
- return ctx.guild is not None
+ if ctx.guild is None:
+ raise NoPrivateMessage("This command cannot be used in private messages.")
+ return True
def setup(bot):