mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-12 19:22:56 +00:00
* 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.
39 lines
792 B
Plaintext
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
|