From 9cd1734f0ff6c86b489636a0050acd59af39caa0 Mon Sep 17 00:00:00 2001 From: Phxntxm Date: Thu, 13 Oct 2016 16:23:25 -0500 Subject: [PATCH] Corrected the ID to use for the update when there is more than one raffle --- cogs/raffle.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cogs/raffle.py b/cogs/raffle.py index a7053cb..a49bc07 100644 --- a/cogs/raffle.py +++ b/cogs/raffle.py @@ -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))