mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
* Steals tg's span macros * Fix alphabet * Updated some more spans * Misses a conflict * Fix compile errors * Converts more spans * oops
38 lines
1.7 KiB
Plaintext
38 lines
1.7 KiB
Plaintext
// Verb to manipulate IDs and ckeys
|
|
/client/proc/discord_id_manipulation()
|
|
set name = "Discord Manipulation"
|
|
set category = "Admin.Player Interaction"
|
|
|
|
if(!check_rights(R_ADMIN))
|
|
return
|
|
|
|
holder.discord_manipulation()
|
|
|
|
|
|
/datum/admins/proc/discord_manipulation()
|
|
if(!usr.client.holder)
|
|
return
|
|
|
|
var/lookup_choice = alert(usr, "Do you wish to lookup account by ID or ckey?", "Lookup Type", "ID", "Ckey", "Cancel")
|
|
switch(lookup_choice)
|
|
if("ID")
|
|
var/lookup_id = input(usr,"Enter Discord ID to lookup ckey") as text
|
|
var/returned_ckey = SSdiscord.lookup_ckey(lookup_id)
|
|
if(returned_ckey)
|
|
var/unlink_choice = alert(usr, "Discord ID [lookup_id] is linked to Ckey [returned_ckey]. Do you wish to unlink or cancel?", "Account Found", "Unlink", "Cancel")
|
|
if(unlink_choice == "Unlink")
|
|
SSdiscord.unlink_account(returned_ckey)
|
|
else
|
|
to_chat(usr, span_warning("Discord ID <b>[lookup_id]</b> has no associated ckey"))
|
|
if("Ckey")
|
|
var/lookup_ckey = input(usr,"Enter Ckey to lookup ID") as text
|
|
var/returned_id = SSdiscord.lookup_id(lookup_ckey)
|
|
if(returned_id)
|
|
to_chat(usr, span_notice("Ckey <b>[lookup_ckey]</b> is assigned to Discord ID <b>[returned_id]</b>"))
|
|
to_chat(usr, span_notice("Discord mention format: <b><@[returned_id]></b>")) // < and > print < > in HTML without using them as tags
|
|
var/unlink_choice = alert(usr, "Ckey [lookup_ckey] is linked to Discord ID [returned_id]. Do you wish to unlink or cancel?", "Account Found", "Unlink", "Cancel")
|
|
if(unlink_choice == "Unlink")
|
|
SSdiscord.unlink_account(lookup_ckey)
|
|
else
|
|
to_chat(usr, span_warning("Ckey <b>[lookup_ckey]</b> has no associated Discord ID!"))
|