Skip to content

Commit

Permalink
fix: restricted user leaving this server made the bot throw TypeError
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyuunex committed Apr 23, 2023
1 parent 87483bc commit 3ee1a64
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions seija/cogs/MemberVerification.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,12 @@ async def on_member_remove(self, member):
if osu_id:
try:
fresh_osu_data = await self.bot.osuweb.get_user_array(osu_id[0])
embed = await osuwebembed.small_user_array(fresh_osu_data, 0xffffff, "User left")
member_name = fresh_osu_data["username"]
if fresh_osu_data:
embed = await osuwebembed.small_user_array(fresh_osu_data, 0xffffff, "User left")
member_name = fresh_osu_data["username"]
else:
embed = None
member_name = member.name
except aioosuwebapi_exceptions.HTTPException:
print("Connection issues?")
embed = None
Expand Down

0 comments on commit 3ee1a64

Please sign in to comment.