aboutsummaryrefslogtreecommitdiffstats
path: root/bot/exts/moderation/dm_relay.py
diff options
context:
space:
mode:
Diffstat (limited to 'bot/exts/moderation/dm_relay.py')
-rw-r--r--bot/exts/moderation/dm_relay.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/bot/exts/moderation/dm_relay.py b/bot/exts/moderation/dm_relay.py
index 1d2206e27..566422e29 100644
--- a/bot/exts/moderation/dm_relay.py
+++ b/bot/exts/moderation/dm_relay.py
@@ -1,13 +1,13 @@
-import logging
-
import discord
from discord.ext.commands import Cog, Context, command, has_any_role
from bot.bot import Bot
from bot.constants import Emojis, MODERATION_ROLES
+from bot.log import get_logger
+from bot.utils.channel import is_mod_channel
from bot.utils.services import send_to_paste_service
-log = logging.getLogger(__name__)
+log = get_logger(__name__)
class DMRelay(Cog):
@@ -63,8 +63,9 @@ class DMRelay(Cog):
await ctx.send(paste_link)
async def cog_check(self, ctx: Context) -> bool:
- """Only allow moderators to invoke the commands in this cog."""
- return await has_any_role(*MODERATION_ROLES).predicate(ctx)
+ """Only allow moderators to invoke the commands in this cog in mod channels."""
+ return (await has_any_role(*MODERATION_ROLES).predicate(ctx)
+ and is_mod_channel(ctx.channel))
def setup(bot: Bot) -> None: