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))
评论列表
文章目录