1
0
Fork 0
mirror of synced 2024-06-26 10:10:44 +12:00

Corrected the ID to use for the update when there is more than one raffle

This commit is contained in:
Phxntxm 2016-10-13 16:23:25 -05:00
parent ed072994e6
commit 9cd1734f0f

View file

@ -123,7 +123,7 @@ class Raffle:
await config.update_content('raffles', update, r_filter)
await self.bot.say("{} you have just entered the raffle!".format(author.mention))
# Otherwise, make sure the author gave a valid raffle_id
elif raffle_id in range(raffle_count):
elif raffle_id in range(raffle_count - 1):
entrants = raffles[raffle_id]['entrants']
# Lets make sure that the user hasn't already entered the raffle
@ -133,7 +133,7 @@ class Raffle:
entrants.append(author.id)
# Since we have no good thing to filter things off of, lets use the internal rethinkdb id
r_filter = {'id': raffles[1]['id']}
r_filter = {'id': raffles[raffle_id]['id']}
update = {'entrants': entrants}
await config.update_content('raffles', update, r_filter)
await self.bot.say("{} you have just entered the raffle!".format(author.mention))