def poll(self, ctx, *, string: str):
"""Formatting: Question|Option 1|Option 2|etc."""
await self.bot.delete_message(ctx.message)
string = string.strip("| *")
split = string.split("|")
emojibet = ['??', '??', '??', '??', '??', '??', '??', '??', '??', '??', '??', '??', '??', '??', '??', '??', '??', '??', '??', '??', '??', '??', '??', '??', '??', '??']
alphabet = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
question = split[0].strip(" ")
query = [x.strip(" ") for x in split[1:] if x.strip(" ") != ""]
em = discord.Embed(description=question, colour=ctx.message.author.color)
for i, q in enumerate(query):
em.add_field(name = "Option " + alphabet[i], value = q, inline = False)
em.set_author(name=ctx.message.author.display_name, icon_url=ctx.message.author.avatar_url)
em.set_footer(text="React to this message to vote! (Sorry mobile users)")
sent = await self.bot.send_message(ctx.message.channel, embed = em)
for i, _ in enumerate(query):
await self.bot.add_reaction(sent, emojibet[i])
评论列表
文章目录