From fbc2d14854699afc90e782b2e9040758fbdad35d Mon Sep 17 00:00:00 2001 From: Jens Reidel Date: Sat, 18 May 2019 20:04:47 +0200 Subject: [PATCH] Logic issue here --- cogs/guild.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cogs/guild.py b/cogs/guild.py index f5c238755..30925282d 100755 --- a/cogs/guild.py +++ b/cogs/guild.py @@ -702,8 +702,8 @@ async def is_in_guild(userid, difficulty): user = await self.bot.pool.fetchrow( 'SELECT guild, xp FROM profile WHERE "user"=$1;', userid ) - if user and user[0] == guild["id"]: - difficulty += int(rpgtools.xptolevel(user[1])) + if user and user["guild"] == guild["id"]: + difficulty += int(rpgtools.xptolevel(user["xp"])) return difficulty return False @@ -712,13 +712,14 @@ def apply(r, u): r.message.id == msg.id and str(r.emoji) == "\U00002694" and u not in joined + and not u.bot ) while not started: try: r, u = await self.bot.wait_for("reaction_add", check=apply, timeout=30) test = await is_in_guild(u.id, difficulty) - if difficulty: + if test: difficulty = test joined.append(u) await ctx.send(f"Alright, {u.mention}, you have been added.")