aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bot/cogs/snekbox.py2
-rw-r--r--bot/constants.py1
-rw-r--r--bot/decorators.py15
-rw-r--r--config-default.yml1
4 files changed, 15 insertions, 4 deletions
diff --git a/bot/cogs/snekbox.py b/bot/cogs/snekbox.py
index 362968bd0..55a187ac1 100644
--- a/bot/cogs/snekbox.py
+++ b/bot/cogs/snekbox.py
@@ -176,7 +176,7 @@ class Snekbox(Cog):
@command(name="eval", aliases=("e",))
@guild_only()
- @in_channel(Channels.bot, bypass_roles=EVAL_ROLES)
+ @in_channel(Channels.bot, hidden_channels=(Channels.esoteric,), bypass_roles=EVAL_ROLES)
async def eval_command(self, ctx: Context, *, code: str = None) -> None:
"""
Run Python code and get the results.
diff --git a/bot/constants.py b/bot/constants.py
index a65c9ffa4..89504a2e0 100644
--- a/bot/constants.py
+++ b/bot/constants.py
@@ -353,6 +353,7 @@ class Channels(metaclass=YAMLGetter):
defcon: int
devlog: int
devtest: int
+ esoteric: int
help_0: int
help_1: int
help_2: int
diff --git a/bot/decorators.py b/bot/decorators.py
index 935df4af0..61587f406 100644
--- a/bot/decorators.py
+++ b/bot/decorators.py
@@ -27,11 +27,20 @@ class InChannelCheckFailure(CheckFailure):
super().__init__(f"Sorry, but you may only use this command within {channels_str}.")
-def in_channel(*channels: int, bypass_roles: Container[int] = None) -> Callable:
- """Checks that the message is in a whitelisted channel or optionally has a bypass role."""
+def in_channel(
+ *channels: int,
+ hidden_channels: Container[int] = None,
+ bypass_roles: Container[int] = None
+) -> Callable:
+ """
+ Checks that the message is in a whitelisted channel or optionally has a bypass role.
+
+ Hidden channels are channels which will not be displayed in the InChannelCheckFailure error
+ message.
+ """
def predicate(ctx: Context) -> bool:
"""In-channel checker predicate."""
- if ctx.channel.id in channels:
+ if ctx.channel.id in channels or ctx.channel.id in hidden_channels:
log.debug(f"{ctx.author} tried to call the '{ctx.command.name}' command. "
f"The command was used in a whitelisted channel.")
return True
diff --git a/config-default.yml b/config-default.yml
index b2ee1361f..930a1a0e6 100644
--- a/config-default.yml
+++ b/config-default.yml
@@ -108,6 +108,7 @@ guild:
defcon: &DEFCON 464469101889454091
devlog: &DEVLOG 622895325144940554
devtest: &DEVTEST 414574275865870337
+ esoteric: 470884583684964352
help_0: 303906576991780866
help_1: 303906556754395136
help_2: 303906514266226689