commandhandler.py 文件源码

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

项目:ddmbot 作者: Budovi 项目源码 文件源码
def _command_check(self, ctx):
        # if the channel is not private, delete the command immediately regardless of the response
        if not isinstance(ctx.message.channel, discord.PrivateChannel):
            self._bot.loop.create_task(self._bot.client.delete_message(ctx.message))

        # if privileged, check the member role
        if hasattr(ctx.command, 'privileged'):
            if not self._bot.is_operator(ctx.message.author):
                raise dec.CommandError('You don\'t have a permission to use the *{}* command'.format(ctx.command))

        return True

    #
    # Listeners
    #
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号