others.py 文件源码

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

项目:ddmbot 作者: Budovi 项目源码 文件源码
def skip(self, ctx, force: str = None):
        # if the skip is forced, check the privilege and do it
        if force and force.lower() in ['f', 'force']:
            if not self._bot.is_operator(ctx.message.author):
                raise dec.CommandError('You don\'t have a permission to force the skip')
            await self._bot.player.force_skip()
            await self._bot.message('Skip forced by {}'.format(ctx.message.author.mention))
            return

        # if the argument is not none, raise an error
        if force is not None:
            raise dec.UserInputError('*force* is the only argument allowed for the *skip* command')

        # now do the "normal voting"
        await self._bot.player.skip_vote(int(ctx.message.author.id))
        await self._bot.log('User {} has voted to skip'.format(ctx.message.author))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号