Files
Bubberstation/code/modules/discord/tgs_commands.dm
oranges 6c9d88a4cd Overhauls discord verification system (#53289)
This completely replaces the previous verification system, for one that
will interoperate with a discord redbot instance that uses the cogs
located at you github.com/optimumtact/orangescogs

This cuts out several steps in the system, but it also leaves alone the
existing notify system (which just uses a file list of discord ids) as a
record of who to notify

SQL changes required for the new database system

Version 5.10, 7 August 2020, by oranges

Changes how the discord verification process works.
Adds the discord_links table, and migrates discord id entries from
player table to the discord links table in a once off operation and then
removes the discord id on the player table

The user connects to any tg server, and uses the "Verify Discord
Account" verb, this generates a six word one time use token, with a 4
hour time validity period (defined as 4 hours from the timestamp value)
in the discord links table.

This one time token, and the ckey of the user are stored in
discord_links

At this point the entire DM side is done, this is all it does
2020-08-30 18:24:23 -07:00

18 lines
674 B
Plaintext

// Notify
/datum/tgs_chat_command/notify
name = "notify"
help_text = "Pings the invoker when the round ends"
/datum/tgs_chat_command/notify/Run(datum/tgs_chat_user/sender, params)
if(!CONFIG_GET(string/chat_announce_new_game))
return "Notifcations are currently disabled"
for(var/member in SSdiscord.notify_members) // If they are in the list, take them out
if(member == sender.mention)
SSdiscord.notify_members -= sender.mention
return "You will no longer be notified when the server restarts"
// If we got here, they arent in the list. Chuck 'em in!
SSdiscord.notify_members += sender.mention
return "You will now be notified when the server restarts"