Corrected printing of polls
This commit is contained in:
parent
0b67796c8d
commit
1899618b81
1 changed files with 2 additions and 2 deletions
|
@ -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)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue