From 309faab5638e1ca91d63c5bfcaaa0546be36d564 Mon Sep 17 00:00:00 2001
From: BongaTheProto <93835010+BongaTheProto@users.noreply.github.com>
Date: Mon, 21 Mar 2022 14:33:35 -0500
Subject: [PATCH] Update accountlink.dm
should've done this way before
---
modular_splurt/code/modules/discord/accountlink.dm | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/modular_splurt/code/modules/discord/accountlink.dm b/modular_splurt/code/modules/discord/accountlink.dm
index 2779ae28e9..28d98f5c2b 100644
--- a/modular_splurt/code/modules/discord/accountlink.dm
+++ b/modular_splurt/code/modules/discord/accountlink.dm
@@ -26,10 +26,15 @@
else
+ var/existing_id = SSdiscord.lookup_id(usr?.ckey)
+ //Do not create a new entry if they already have a linked account
+ if(existing_id)
+ message = "You already have a linked account with discord ID ([existing_id]). If you desire to change your account please contact staff."
// Will generate one if an expired one doesn't exist already, otherwise will grab existing token
- var/one_time_token = SSdiscord.get_or_generate_one_time_token_for_ckey(ckey)
- SSdiscord.reverify_cache[usr.ckey] = one_time_token
- message = "Your one time token is: \"[one_time_token]\". You can now verify yourself in discord by using the command \"[prefix][command] [one_time_token]\""
+ else
+ var/one_time_token = SSdiscord.get_or_generate_one_time_token_for_ckey(ckey)
+ SSdiscord.reverify_cache[usr.ckey] = one_time_token
+ message = "Your one time token is: \"[one_time_token]\". You can now verify yourself in discord by using the command \"[prefix][command] [one_time_token]\""
//Now give them a browse window so they can't miss whatever we told them
var/datum/browser/window = new/datum/browser(usr, "discordverification", "Discord verification")