discutils.py 文件源码

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

项目:cryopodbot 作者: TGWaffles 项目源码 文件源码
def permcheck(**kwargs):
    def predicate(ctx):
        owners_ = kwargs.get('owners', [])
        check = kwargs.get('check', '')

        if type(owners_) is not list:
            owners_ = [owners_]

        if ctx.message.author.id in [owners[x] for x in owners_]:
            return True

        if check == 'dm_only' and ctx.message.server is None:
            return True

        return False

    return commands.check(predicate)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号