aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Gareth Coles <[email protected]>2018-11-18 13:47:03 +0000
committerGravatar Gareth Coles <[email protected]>2018-11-18 13:47:03 +0000
commit772fcc92cecdaa982534387a985232047bc6601d (patch)
tree82f434c37765029aaf1772e7a58c161b83019f69
parentAdd badges to README (diff)
parentDisable All Commands Except !accept in Verification Channel (#197) (diff)
Merge remote-tracking branch 'origin/master'
-rw-r--r--azure-pipelines.yml9
-rw-r--r--bot/cogs/verification.py11
2 files changed, 15 insertions, 5 deletions
diff --git a/azure-pipelines.yml b/azure-pipelines.yml
index fe7486a5c..bc523fb31 100644
--- a/azure-pipelines.yml
+++ b/azure-pipelines.yml
@@ -1,11 +1,10 @@
# https://aka.ms/yaml
variables:
- ENV LIBRARY_PATH: /lib:/usr/lib
- ENV PIPENV_HIDE_EMOJIS: 1
- ENV PIPENV_IGNORE_VIRTUALENVS: 1
- ENV PIPENV_NOSPIN: 1
- ENV PIPENV_VENV_IN_PROJECT: 1
+ PIPENV_HIDE_EMOJIS: 1
+ PIPENV_IGNORE_VIRTUALENVS: 1
+ PIPENV_NOSPIN: 1
+ PIPENV_VENV_IN_PROJECT: 1
jobs:
- job: test
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))