mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-26 06:29:23 +01:00
Make sure the discordid of a user is always returned as text (#51531)
If it's not cast as a varchar when bringing it out of the database it will get auto converted to scientification notation, which is unexpected and causes bugs in code that expects the id to be available for discord API calls
This commit is contained in:
@@ -82,8 +82,10 @@ SUBSYSTEM_DEF(discord)
|
||||
|
||||
// Returns ID from ckey
|
||||
/datum/controller/subsystem/discord/proc/lookup_id(lookup_ckey)
|
||||
//We cast the discord ID to varchar to prevent BYOND mangling
|
||||
//it into it's scientific notation
|
||||
var/datum/DBQuery/query_get_discord_id = SSdbcore.NewQuery(
|
||||
"SELECT discord_id FROM [format_table_name("player")] WHERE ckey = :ckey",
|
||||
"SELECT CAST(discord_id AS VARCHAR(25)) FROM [format_table_name("player")] WHERE ckey = :ckey",
|
||||
list("ckey" = lookup_ckey)
|
||||
)
|
||||
if(!query_get_discord_id.Execute())
|
||||
|
||||
Reference in New Issue
Block a user