def _show_question(self, n):
question = self._current_question
self._choices = question.choices
leader = self.leader
leader_text = f'{leader[0]} with {leader[1]} points' if leader else None
description = self.category.description
is_tf = question.type == 'boolean'
tf_header = '**True or False**\n' * is_tf
question_field = f'{tf_header}{question.question}'
possible_answers = '\n'.join(itertools.starmap('{0}. {1}'.format, enumerate(self._choices, 1)))
embed = (discord.Embed(description=description, colour=random.randint(0, 0xFFFFFF))
.set_author(name=self.category.name)
.add_field(name='Category', value=question.category, inline=False)
.add_field(name=f'Question #{n}', value=question_field, inline=False)
.set_footer(text=f'Current leader: {leader_text}')
)
if not is_tf:
embed.add_field(name='Possible answers', value=possible_answers, inline=True)
await self.ctx.send(embed=embed)
评论列表
文章目录