Shiptest 13 - Modules - TypesVar Details - Proc Details

discord

Vars

common_wordsCommon words list, used to generate one time tokens
enabledIs TGS enabled (If not we won't fire because otherwise this is useless)
notify_fileThe file where notification status is saved
notify_membersPeople to save to notify file
notify_members_cacheCopy of previous list, so the SS doesnt have to fire if no new members have been added
people_to_notifyPeople to notify on roundstart
reverify_cachePeople who have tried to verify this round already

Procs

find_discord_link_by_ckeyFind discord link entry by the passed in user ckey
find_discord_link_by_discord_idFind discord link entry by the passed in user ckey
find_discord_link_by_tokenFind discord link entry by the passed in user token
generate_one_time_tokenGenerate a timebound token for discord verification
lookup_ckeyGiven a discord id as a string, look up the ckey attached to that account, if any
lookup_idGiven a ckey, look up the discord user id attached to the user, if any

Var Details

common_words

Common words list, used to generate one time tokens

enabled

Is TGS enabled (If not we won't fire because otherwise this is useless)

notify_file

The file where notification status is saved

notify_members

People to save to notify file

notify_members_cache

Copy of previous list, so the SS doesnt have to fire if no new members have been added

people_to_notify

People to notify on roundstart

reverify_cache

People who have tried to verify this round already

Proc Details

Find discord link entry by the passed in user ckey

This will look into the discord link table and return the first entry that matches the given ckey

Remember, multiple entries can exist

Arguments:

Returns a /datum/discord_link_record

Find discord link entry by the passed in user ckey

This will look into the discord link table and return the first entry that matches the given ckey

Remember, multiple entries can exist

Arguments:

Returns a /datum/discord_link_record

Find discord link entry by the passed in user token

This will look into the discord link table and return the first entry that matches the given one time token

Remember, multiple entries can exist, as they are only guaranteed to be unique for their validity period

Arguments:

Returns a /datum/discord_link_record

generate_one_time_token

Generate a timebound token for discord verification

This uses the common word list to generate a six word random token, this token can then be fed to a discord bot that has access to the same database, and it can use it to link a ckey to a discord id, with minimal user effort

It returns the token to the calling proc, after inserting an entry into the discord_link table of the following form

(unique_id, ckey, null, the current time, the one time token generated)
the null value will be filled out with the discord id by the integrated discord bot when a user verifies

Notes:

Arguments:

Returns a string representing the one time token

lookup_ckey

Given a discord id as a string, look up the ckey attached to that account, if any

This gets the most recent entry from the discord_link table that is associated with this discord id snowflake

Arguments:

lookup_id

Given a ckey, look up the discord user id attached to the user, if any

This gets the most recent entry from the discord link table that is associated with the given ckey

Arguments: