1
0
Fork 0
mirror of synced 2024-06-29 03:30:57 +12:00

Corrected printing of polls

This commit is contained in:
Phxntxm 2016-08-13 23:01:25 -05:00
parent 0b67796c8d
commit 1899618b81

View file

@ -39,7 +39,7 @@ class Strawpoll:
await self.bot.say("There are currently no strawpolls running on this server!")
return
if not poll_id:
fmt = "\n".join("{}: https://strawpoll.me/{}".format(title, id) for id, title in server_polls.items())
fmt = "\n".join("{}: https://strawpoll.me/{}".format(data['title'], id) for id, data in server_polls.items())
await self.bot.say("```\n{}```".format(fmt))
elif poll_id in server_polls.keys():
poll = server_polls[poll_id]
@ -80,7 +80,7 @@ class Strawpoll:
all_polls = config.getContent('strawpolls') or {}
server_polls = all_polls.get(ctx.message.server.id) or {}
server_polls[data['id']] = {'author': ctx.message.author.id,'date': str(pendulum.utcnow())}
server_polls[data['id']] = {'author': ctx.message.author.id,'date': str(pendulum.utcnow()), 'title': title}
all_polls[ctx.message.server.id] = server_polls
config.saveContent('strawpolls',all_polls)