handle users that have left the guild

This commit is contained in:
leander committed 2026-10-24 04:32:40 +02:00
1 parent e3f2b11007
commit d24cf49d2a
1 file changed
+7 -5
+7 -5
View File
@@ -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)