@commands.slash_command(
name="modify",
description="Modify a User."[:99],
dm_permission=False,
guild_ids=guild_ids(),
)
@commands.check(check_moderator_predicate)
def check_moderator_predicate(context):
return is_moderator(context.author)
def is_moderator(member: Member) -> bool:
"""Check if a User is a Moderator."""
member_role_ids = [role.id for role in member.roles]
for moderator_role_id in get_moderator_roles():
if moderator_role_id in member_role_ids:
return True
return False
I want to use the same check for prefix/slash commands. The decorator didn't afect the command's output to a non-moderator user.
Goal:
- Slash Command Checks, check if User has a Role