mirror of
https://github.com/UiO-Gaming/mustafa.git
synced 2026-11-05 13:56:48 +01:00
handle users that have left the guild
This commit is contained in:
1 parent
e3f2b11007
commit
d24cf49d2a
1 file changed
+7
-5
@@ -229,12 +229,14 @@ class UserFacts(commands.Cog):
|
|||||||
|
|
||||||
others = []
|
others = []
|
||||||
for discord_id, mbti in results:
|
for discord_id, mbti in results:
|
||||||
if user := self.bot.get_user(discord_id):
|
user = self.bot.get_user(discord_id)
|
||||||
|
if not user and interaction.guild:
|
||||||
|
try:
|
||||||
|
user = await interaction.guild.fetch_member(discord_id)
|
||||||
|
except discord.NotFound:
|
||||||
|
pass
|
||||||
|
if user:
|
||||||
others.append((user, mbti))
|
others.append((user, mbti))
|
||||||
elif user := await interaction.guild.fetch_member(discord_id):
|
|
||||||
others.append((user, mbti))
|
|
||||||
else:
|
|
||||||
others.append((discord_id, mbti))
|
|
||||||
|
|
||||||
self.create_mbti_graph((bruker, user_mbti), others)
|
self.create_mbti_graph((bruker, user_mbti), others)
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user