diff options
| -rw-r--r-- | bot/__main__.py | 1 | ||||
| -rw-r--r-- | bot/cogs/security.py | 22 |
2 files changed, 23 insertions, 0 deletions
diff --git a/bot/__main__.py b/bot/__main__.py index 7e5269459..a6f6dce3d 100644 --- a/bot/__main__.py +++ b/bot/__main__.py @@ -7,6 +7,7 @@ bot = AutoShardedBot(command_prefix=when_mentioned_or(">>>", ">>> ")) # Internal/debug bot.load_extension("bot.cogs.logging") +bot.load_extension("bot.cogs.security") # Owner-only bot.load_extension("bot.cogs.eval") diff --git a/bot/cogs/security.py b/bot/cogs/security.py new file mode 100644 index 000000000..c7fa4a686 --- /dev/null +++ b/bot/cogs/security.py @@ -0,0 +1,22 @@ +# coding=utf-8 +from discord.ext.commands import AutoShardedBot, Context + +__author__ = "Gareth Coles" + + +class Security: + """ + Security-related helpers + """ + + def __init__(self, bot: AutoShardedBot): + self.bot = bot + self.bot.check(self.check_not_bot) + + async def check_not_bot(self, ctx: Context): + return not ctx.author.bot + + +def setup(bot): + bot.add_cog(Security(bot)) + print("Cog loaded: Security") |