def role_or_permissions(ctx, check, **perms):
if check_permissions(ctx, perms):
return True
ch = ctx.message.channel
author = ctx.message.author
if isinstance(ch, (discord.DMChannel, discord.GroupChannel)):
return False # can't have roles in PMs
role = discord.utils.find(check, author.roles)
if role is None:
raise commands.CommandError("You need a special role to do this! (A discord role with the name \"Bot Mod\" or \"Bot Admin\")")
return True
评论列表
文章目录