Files
Bubberstation/code/modules/discord/accountlink.dm
SkyratBot 647b408d01 [MIRROR] Fixes typos in span, other html elements [MDB IGNORE] (#10222)
* Fixes typos in span, other html elements (#63510)

Atomizes a much larger PR for another time...
There are typos in span and other html messages that causes them to not render correctly or at all.
Bug fixes
Converts those instances of span to use the macro

* Fixes typos in span, other html elements

Co-authored-by: Jeremiah <42397676+jlsnow301@users.noreply.github.com>
2021-12-23 17:18:43 +00:00

39 lines
1.9 KiB
Plaintext

// IF you have linked your account, this will trigger a verify of the user
/client/verb/verify_in_discord()
set category = "OOC"
set name = "Verify Discord Account"
set desc = "Verify your discord account with your BYOND account"
// Safety checks
if(!CONFIG_GET(flag/sql_enabled))
to_chat(src, span_warning("This feature requires the SQL backend to be running."))
return
// Why this would ever be unset, who knows
var/prefix = CONFIG_GET(string/discordbotcommandprefix)
if(!prefix)
to_chat(src, span_warning("This feature is disabled."))
if(!SSdiscord || !SSdiscord.reverify_cache)
to_chat(src, span_warning("Wait for the Discord subsystem to finish initialising"))
return
var/message = ""
// Simple sanity check to prevent a user doing this too often
var/cached_one_time_token = SSdiscord.reverify_cache[usr.ckey]
if(cached_one_time_token && cached_one_time_token != "")
message = "You already generated your one time token, it is [cached_one_time_token], if you need a new one, you will have to wait until the round ends, or switch to another server, try verifying yourself in discord by using the command <span class='warning'>\" [prefix]verify [cached_one_time_token] \"</span>"
else
// 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], Assuming you have the required living minutes in game, you can now verify yourself in discord by using the command <span class='warning'>\" [prefix]verify [one_time_token] \"</span>"
//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")
window.set_content("<span>[message]</span>")
window.open()