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

Commit fbc2d14

Browse files
authored
Logic issue here
1 parent c7cca28 commit fbc2d14

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

cogs/guild.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -702,8 +702,8 @@ async def is_in_guild(userid, difficulty):
702702
user = await self.bot.pool.fetchrow(
703703
'SELECT guild, xp FROM profile WHERE "user"=$1;', userid
704704
)
705-
if user and user[0] == guild["id"]:
706-
difficulty += int(rpgtools.xptolevel(user[1]))
705+
if user and user["guild"] == guild["id"]:
706+
difficulty += int(rpgtools.xptolevel(user["xp"]))
707707
return difficulty
708708
return False
709709

@@ -712,13 +712,14 @@ def apply(r, u):
712712
r.message.id == msg.id
713713
and str(r.emoji) == "\U00002694"
714714
and u not in joined
715+
and not u.bot
715716
)
716717

717718
while not started:
718719
try:
719720
r, u = await self.bot.wait_for("reaction_add", check=apply, timeout=30)
720721
test = await is_in_guild(u.id, difficulty)
721-
if difficulty:
722+
if test:
722723
difficulty = test
723724
joined.append(u)
724725
await ctx.send(f"Alright, {u.mention}, you have been added.")

0 commit comments

Comments
 (0)