Changes the discord bot into a subsystem and adds quite a bit of additional logging (#17996)

* Changes the discord bot into a subsystem and adds quite a bit of additional logging

* Removes a forgotten todo

* replaces call with RUSTG_CALL (to make it compile) and adds a comment

* Re-Add log prefix

---------

Co-authored-by: Werner <Arrow768@users.noreply.github.com>
This commit is contained in:
Werner
2023-12-19 22:54:57 +00:00
committed by GitHub
co-authored by Werner
parent d0ca24467e
commit 3daec39efa
27 changed files with 219 additions and 135 deletions
@@ -1381,7 +1381,7 @@
to_chat(C, ccia_msg)
discord_bot.send_to_cciaa("Emergency message from the station: `[msg]`, sent by [src]! Gamemode: [SSticker.mode]")
SSdiscord.send_to_cciaa("Emergency message from the station: `[msg]`, sent by [src]! Gamemode: [SSticker.mode]")
var/discord_msg = "[cciaa_present] agents online."
if (cciaa_present)
@@ -1390,7 +1390,7 @@
else
discord_msg += " [cciaa_afk] AFK."
discord_bot.send_to_cciaa(discord_msg)
SSdiscord.send_to_cciaa(discord_msg)
post_webhook_event(WEBHOOK_CCIAA_EMERGENCY_MESSAGE, list("message"=msg, "sender"="[src]", "cciaa_present"=cciaa_present, "cciaa_afk"=cciaa_afk))
/mob/living/carbon/human/proc/hiveban() //Removes Hivenet completely from a Vaurca
+2 -2
View File
@@ -25,10 +25,10 @@
if (admins_number == 0) //Apparently the admin logging out is no longer an admin at this point, so we have to check this towards 0 and not towards 1. Awell.
post_webhook_event(WEBHOOK_ADMIN_IMPORTANT, list("title"="Admin has logged out", "message"="**[key_name(src)]** logged out - no more admins online."))
discord_bot.send_to_admins("@here [key_name(src)] logged out - no more admins online.")
SSdiscord.send_to_admins("@here [key_name(src)] logged out - no more admins online.")
else if ((admins_number - admins_number_afk) <= 0)
post_webhook_event(WEBHOOK_ADMIN, list("title"="Admin has logged out", "message"="**[key_name(src)]** logged out - only AFK admins _([admins_number_afk])_ are online."))
discord_bot.send_to_admins("[key_name(src)] logged out - only AFK admins ([admins_number_afk]) are online.")
SSdiscord.send_to_admins("[key_name(src)] logged out - only AFK admins ([admins_number_afk]) are online.")
if (mob_thinks)
MOB_START_THINKING(src)