1
0
Fork 0
mirror of synced 2024-09-30 09:17:13 +13: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!") await self.bot.say("There are currently no strawpolls running on this server!")
return return
if not poll_id: 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)) await self.bot.say("```\n{}```".format(fmt))
elif poll_id in server_polls.keys(): elif poll_id in server_polls.keys():
poll = server_polls[poll_id] poll = server_polls[poll_id]
@ -80,7 +80,7 @@ class Strawpoll:
all_polls = config.getContent('strawpolls') or {} all_polls = config.getContent('strawpolls') or {}
server_polls = all_polls.get(ctx.message.server.id) 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 all_polls[ctx.message.server.id] = server_polls
config.saveContent('strawpolls',all_polls) config.saveContent('strawpolls',all_polls)