Discord MoMMI routing refactor. (#17112)

Now correctly uses meta routes instead of admin y/n. None of you know what this means so just merge this ¯\_(ツ)_/¯.
This commit is contained in:
Pieter-Jan Briers
2018-01-17 08:43:11 +01:00
committed by sood
parent 1b46da258b
commit 0d6c4d4b6b
2 changed files with 11 additions and 5 deletions

View File

@@ -1,12 +1,18 @@
// Sends to the SERVER STATUS channels.
// This sends to the "server_status" gamenudge route.
/proc/send2maindiscord(var/msg)
send2discord(msg, FALSE)
send2discord(msg, "server_status")
// Sends to the adminbus ahelp channels.
// This sends to the "adminhelp" gamenudge route.
/proc/send2admindiscord(var/msg, var/ping = FALSE)
send2discord(msg, TRUE, ping)
send2discord(msg, "adminhelp", ping)
/proc/send2discord(var/msg, var/admin = FALSE, var/ping = FALSE)
// Meta argument here is the MoMMI meta argument to send to the gamenudge route.
// AKA the MoMMI config file chooses where to send it based on this key.
/proc/send2discord(var/msg, var/meta, var/ping = FALSE)
if (!global.config.discord_url || !global.config.discord_password)
return
var/url = "[global.config.discord_url]?pass=[url_encode(global.config.discord_password)]&admin=[admin ? "true" : "false"]&content=[url_encode(msg)]&ping=[ping ? "true" : "false"]"
var/url = "[global.config.discord_url]?pass=[url_encode(global.config.discord_password)]&meta=[url_encode(meta)]&content=[url_encode(msg)]&ping=[ping ? "true" : "false"]"
world.Export(url)