From ebca55efedc9feda342ff4386614f9a4011fb936 Mon Sep 17 00:00:00 2001 From: Leander Furumo Date: Sat, 20 Apr 2024 13:57:02 +0200 Subject: [PATCH] fetch discord profiles instead of users in galtinn register --- bot/src/cogs/galtinn.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bot/src/cogs/galtinn.py b/bot/src/cogs/galtinn.py index f95a91b..6b20974 100644 --- a/bot/src/cogs/galtinn.py +++ b/bot/src/cogs/galtinn.py @@ -442,8 +442,9 @@ class Galtinn(commands.Cog): await interaction.response.defer(ephemeral=True) # Check if user is already registered - galtinn_user = await self.fetch_galtinn_user(interaction.user.id) - if not galtinn_user: + discord_profile = await self.fetch_galtinn_discordprofiles(discord_id=interaction.user.id) + # API guarantees that there is only one or zero results so this is safe + if discord_profile.count == 1: embed = embed_templates.error_warning("Du er allerede registrert!") await interaction.followup.send(embed=embed) return