Files
CHOMPStation2/code/controllers/configuration_vr.dm
Leshana 6b26f620c2 Add discord integration for faxes
* Transmit a message to a webhook that sends a message to discord when an admin fax is sent.
* Its not feasible to send the text of the fax (considering it might be just a picture!) to discord, so instead we export it to a file, and discord links back to it.
* Obviously to fully work this also requires a webhook script and webhosting of the faxes folder.
2016-11-04 21:58:25 -04:00

39 lines
792 B
Plaintext

//
// Lets read our settings from the configuration file on startup too!
//
/hook/startup/proc/read_vs_config()
var/list/Lines = file2list("config/config.txt")
for(var/t in Lines)
if(!t) continue
t = trim(t)
if (length(t) == 0)
continue
else if (copytext(t, 1, 2) == "#")
continue
var/pos = findtext(t, " ")
var/name = null
var/value = null
if (pos)
name = lowertext(copytext(t, 1, pos))
value = copytext(t, pos + 1)
else
name = lowertext(t)
if (!name)
continue
switch (name)
if ("chat_webhook_url")
config.chat_webhook_url = value
if ("chat_webhook_key")
config.chat_webhook_key = value
if ("fax_export_dir")
config.fax_export_dir = value
if ("items_survive_digestion")
config.items_survive_digestion = 1
return 1