checks.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:RPGBot 作者: henry232323 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号