示例#1
0
 async def poll(self, ctx, title: str):
     """Create a poll with a one-word title!"""
     # add check for poll with existing name
     poll = Poll(title, ctx.guild.id, ctx.channel.id, ctx.author.id)
     await self.get_config_from_user(ctx, poll, new_poll=True)
     entries = await self.get_entries_from_user(ctx)
     poll.add_entries(
         entries[:poll.max_entries])  # TODO add feedback for max entries
     if not self.add_poll(poll):
         await ctx.send('Couldn\'t create poll')
         return
     await ctx.send('Poll created!', embed=self.make_poll_embed(poll, ctx))