aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Sebastiaan Zeeff <[email protected]>2020-04-20 19:00:41 +0200
committerGravatar Sebastiaan Zeeff <[email protected]>2020-04-23 16:15:18 +0200
commit092474487d75ef6430e533b85fe386d837fbf3a6 (patch)
tree5d41aa2bb87159b57b4ba5709e6e3c07cbc85619
parentAdd tests for `in_whitelisted_context` decorator (diff)
Allow `!eval` in help channel categories
As help conversations now take place in their own, dedicated channels, there's no longer a pressing need to restrict the `!eval` command in help channels for regular members. As the command can be a valuable tool in explaining and teaching Python, we've therefore chosen to allow it in channels in `Help: Available` and `Help: Occupied` catagories.
-rw-r--r--bot/cogs/snekbox.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/bot/cogs/snekbox.py b/bot/cogs/snekbox.py
index 8827cb585..4999074b6 100644
--- a/bot/cogs/snekbox.py
+++ b/bot/cogs/snekbox.py
@@ -12,7 +12,7 @@ from discord import HTTPException, Message, NotFound, Reaction, User
from discord.ext.commands import Cog, Context, command, guild_only
from bot.bot import Bot
-from bot.constants import Channels, Roles, URLs
+from bot.constants import Categories, Channels, Roles, URLs
from bot.decorators import in_whitelisted_context
from bot.utils.messages import wait_for_deletion
@@ -41,6 +41,7 @@ MAX_PASTE_LEN = 1000
# `!eval` command whitelists
EVAL_CHANNELS = (Channels.bot_commands, Channels.esoteric)
+EVAL_CATEGORIES = (Categories.help_available, Categories.help_in_use)
EVAL_ROLES = (Roles.helpers, Roles.moderators, Roles.admins, Roles.owners, Roles.python_community, Roles.partners)
SIGKILL = 9
@@ -270,6 +271,7 @@ class Snekbox(Cog):
@guild_only()
@in_whitelisted_context(
whitelisted_channels=EVAL_CHANNELS,
+ whitelisted_categories=EVAL_CATEGORIES,
whitelisted_roles=EVAL_ROLES,
redirect_channel=Channels.bot_commands,
)