__init__.py 文件源码

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

项目:pcbot 作者: pckv 项目源码 文件源码
def can_use_command(cmd: Command, author, channel: discord.Channel=None):
    """ Return True if the member who sent the message can use this command. """
    if cmd.owner and not is_owner(author):
        return False
    if channel is not None and not has_permissions(cmd, author, channel):
        return False
    if not has_roles(cmd, author):
        return False

    # Handle server specific commands for both server and PM commands
    if type(author) is discord.User and cmd.servers:
        return False
    if type(author) is discord.Member and not is_valid_server(cmd, author.server):
        return False

    return True
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号