diff options
author | 2018-11-18 01:18:14 -0800 | |
---|---|---|
committer | 2018-11-18 10:18:14 +0100 | |
commit | 61c33ec3a4d123258f6cb67f6a6c218a3b8c7f49 (patch) | |
tree | 90580833d84c13baed062dbca5d863bbfb8085e7 | |
parent | Azure: Fix env vars in YAML (diff) |
Disable All Commands Except !accept in Verification Channel (#197)
* disable all commands except !accept in verification channel
* replace add_check with __global special method
Co-Authored-By: MarkKoz <[email protected]>
-rw-r--r-- | bot/cogs/verification.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/bot/cogs/verification.py b/bot/cogs/verification.py index 8d29a4bee..56fcd63eb 100644 --- a/bot/cogs/verification.py +++ b/bot/cogs/verification.py @@ -151,6 +151,17 @@ class Verification: f"{ctx.author.mention} Unsubscribed from <#{Channels.announcements}> notifications." ) + @staticmethod + def __global_check(ctx: Context): + """ + Block any command within the verification channel that is not !accept. + """ + + if ctx.channel.id == Channels.verification: + return ctx.command.name == "accept" + else: + return True + def setup(bot): bot.add_cog(Verification(bot)) |