From dd7514b41386fde3a66d113a3b23a5b59d0c17d2 Mon Sep 17 00:00:00 2001 From: ShiftyRail <31417754+ShiftyRail@users.noreply.github.com> Date: Tue, 26 Jan 2021 01:27:43 +0100 Subject: [PATCH] Sends a discord killphrase after a round has ended (#28546) * Sends a discord killphrase after a round has ended * Move it to a config --- code/__HELPERS/files.dm | 1 + code/controllers/configuration.dm | 4 ++++ code/modules/ext_scripts/discord.dm | 3 +++ 3 files changed, 8 insertions(+) diff --git a/code/__HELPERS/files.dm b/code/__HELPERS/files.dm index 70a4bc760a3..d7cb5559e7d 100644 --- a/code/__HELPERS/files.dm +++ b/code/__HELPERS/files.dm @@ -113,6 +113,7 @@ var/list/maplist = get_list_of_keys(maps) send2maindiscord("A map vote was initiated with these options: [english_list(maplist)].") send2mainirc("A map vote was initiated with these options: [english_list(maplist)].") + send2ickdiscord(config.kill_phrase) // This the magic kill phrase vote.allmaps = all_maps return maps diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index 4acde744bef..ea7b4210ed1 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -194,6 +194,7 @@ // Discord crap. var/discord_url var/discord_password + var/kill_phrase = "All your bases are belong to us." // Weighted Votes var/weighted_votes = 0 @@ -618,6 +619,9 @@ if("weighted_votes") weighted_votes = TRUE + if ("kill_phrase") + kill_phrase = value + else diary << "Unknown setting in configuration: '[name]'" diff --git a/code/modules/ext_scripts/discord.dm b/code/modules/ext_scripts/discord.dm index 9fe91cb7d13..da31bf6a56f 100644 --- a/code/modules/ext_scripts/discord.dm +++ b/code/modules/ext_scripts/discord.dm @@ -8,6 +8,9 @@ /proc/send2admindiscord(var/msg, var/ping = FALSE) send2discord(msg, "adminhelp", ping) +/proc/send2ickdiscord(var/msg, var/ping = FALSE) + send2discord(msg, "ick", ping) + // 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)