Skip to content

Commit ad9752f

Browse files
committed
Make the cog check more specific
The commands in this cog don't make sense for admins and directors who aren't in the mod team
1 parent 6f43318 commit ad9752f

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

bot/exts/moderation/modpings.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
from async_rediscache import RedisCache
66
from dateutil.parser import isoparse, parse as dateutil_parse
77
from discord import Member
8-
from discord.ext.commands import BadArgument, Cog, Context, group, has_any_role
8+
from discord.ext.commands import BadArgument, Cog, Context, group
99
from pydis_core.utils.members import get_or_fetch_member
1010
from pydis_core.utils.scheduling import Scheduler
1111

1212
from bot.bot import Bot
13-
from bot.constants import Emojis, Guild, MODERATION_ROLES, Roles
13+
from bot.constants import Emojis, Guild, Roles
1414
from bot.converters import Expiry
1515
from bot.log import get_logger
1616
from bot.utils.time import TimestampFormats, discord_timestamp
@@ -44,7 +44,7 @@ def __init__(self, bot: Bot):
4444

4545
async def cog_check(self, ctx: Context) -> bool:
4646
"""Only allow moderators to invoke the commands in this cog."""
47-
return await has_any_role(*MODERATION_ROLES).predicate(ctx)
47+
return ctx.author.get_role(Roles.mod_team) is not None
4848

4949
async def cog_load(self) -> None:
5050
"""Schedule both when to reapply role and all mod ping schedules."""

0 commit comments

Comments
 (0)