1
0
Fork 0
mirror of synced 2024-09-29 08:51:53 +13:00

Corrected what value was checked on polls

This commit is contained in:
phxntxm 2016-09-28 19:27:38 -05:00
parent 19ff5c95b1
commit fc3e947ea4

View file

@ -44,14 +44,14 @@ class Strawpoll:
polls = await config.get_content('strawpolls', r_filter)
# Now output all polls if a poll ID was not provided
if poll_id is None:
if len(polls) == 0:
if polls is None:
await self.bot.say("There are currently no strawpolls running on this server!")
return
fmt = "\n".join(
"{}: https://strawpoll.me/{}".format(data['title'], data['poll_id']) for data in polls)
await self.bot.say("```\n{}```".format(fmt))
# Otherwise, a poll ID was provided, and we searched based on the poll ID earlier, so just check the length
elif len(polls) > 0:
elif polls is None:
# Since strawpoll should never allow us to have more than one poll with the same ID
# It's safe to assume there's only one result
poll = polls[0]