diff options
| -rw-r--r-- | bot/cogs/security.py | 4 | 
1 files changed, 4 insertions, 0 deletions
diff --git a/bot/cogs/security.py b/bot/cogs/security.py index 443dd08e8..f4a843fbf 100644 --- a/bot/cogs/security.py +++ b/bot/cogs/security.py @@ -13,10 +13,14 @@ class Security:      def __init__(self, bot: Bot):          self.bot = bot          self.bot.check(self.check_not_bot)  # Global commands check - no bots can run any commands at all +        self.bot.check(self.check_on_guild)  # Global commands check - commands can't be run in a DM      def check_not_bot(self, ctx: Context):          return not ctx.author.bot +    def check_on_guild(self, ctx: Context): +        return ctx.guild is not None +  def setup(bot):      bot.add_cog(Security(bot))  |