mirror of
https://github.com/AsgardEternal/DiscordWhitelist.git
synced 2024-12-30 14:09:13 -06:00
better steamid handling
This commit is contained in:
parent
9205638625
commit
b095eacade
@ -25,14 +25,17 @@ class Whitelist(commands.Cog):
|
||||
return
|
||||
updatecur = self.client.squadjs.cursor(buffered=True)
|
||||
try:
|
||||
updatecur.execute(self.client.squadjs_updateDiscordID, (interaction.user.id, steam64))
|
||||
if updatecur.execute(self.client.squadjs_updateDiscordID, (interaction.user.id, steam64)) <= 0:
|
||||
await interaction.response.send_message("Cound not find SteamID!")
|
||||
self.client.squadjs.commit()
|
||||
return
|
||||
except mysql.connector.Error as err:
|
||||
log.error("MYSQL error!")
|
||||
await interaction.response.send_message("Could not find steamID!")
|
||||
await interaction.response.send_message("There was an internal server error, pls contact skillet")
|
||||
return
|
||||
for urole in interaction.user.roles:
|
||||
if urole.id in self.client.whitelistGrps.keys():
|
||||
disusername = interaction.user.nick if interaction.user.nick is not None else interaction.user.name
|
||||
self.client.whitelistGrps[urole.id].addMember(config.WhitelistMember(interaction.user.id, disusername, steam64))
|
||||
self.client.squadjs.commit()
|
||||
await interaction.response.send_message("SteamID is linked, roles updated.")
|
||||
await interaction.response.send_message(f"discord is linked to steamID {steam64}, roles updated.")
|
||||
|
Loading…
Reference in New Issue
Block a user