From b3fe4a825b23db13ac20c1f3ba18be56801281cf Mon Sep 17 00:00:00 2001 From: Skillet Date: Mon, 17 Apr 2023 23:30:18 -0400 Subject: [PATCH] fixes --- autowl/Cogs/Whitelist.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/autowl/Cogs/Whitelist.py b/autowl/Cogs/Whitelist.py index 54aa3ff..0418c36 100644 --- a/autowl/Cogs/Whitelist.py +++ b/autowl/Cogs/Whitelist.py @@ -28,7 +28,15 @@ class Whitelist(commands.Cog): updatecur.execute(self.client.squadjs_updateDiscordID, (interaction.user.id, steam64)) rowsaffected = updatecur.rowcount if rowsaffected <= 0: - await interaction.response.send_message("Cound not find SteamID or already linked!") + updatecur.execute(self.client.squadjs_findByDiscordID, [interaction.user.id]) + if updatecur.rowcount <= 0: + await interaction.response.send_message("Cound not find SteamID!") + else: + for urole in interaction.user.roles: + if urole.id in self.client.whitelistGrps.keys(): + self.client.whitelistGrps[urole.id].members[f"{interaction.user.id}"].steam64 = steam64 + self.client.whitelistGrps[urole.id].updateGroup() + await interaction.response.send_message("SteamID already linked, roles updated.") self.client.squadjs.commit() return except mysql.connector.Error as err: