Skip to content
This repository has been archived by the owner on Aug 23, 2024. It is now read-only.

Commit

Permalink
Logic issue here
Browse files Browse the repository at this point in the history
  • Loading branch information
Gelbpunkt authored May 18, 2019
1 parent c7cca28 commit fbc2d14
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cogs/guild.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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.")
Expand Down

0 comments on commit fbc2d14

Please sign in to comment.