mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2025-12-21 15:42:35 +00:00
34 lines
903 B
Plaintext
34 lines
903 B
Plaintext
#define CHAN_ADMIN "admin_channel"
|
|
#define CHAN_CCIAA "cciaa_channel"
|
|
|
|
/proc/send_to_discord(var/channel, var/message)
|
|
if (!config.use_discord_bot)
|
|
return
|
|
if (!channel)
|
|
log_game("send_to_discord() called without channel arg.")
|
|
return
|
|
if (!message)
|
|
log_game("send_to_discord() called without message arg.")
|
|
return
|
|
|
|
var/arguments = " --key=\"[config.comms_password]\""
|
|
arguments += " --channel=\"[channel]\""
|
|
if (config.discord_bot_host)
|
|
arguments += " --host=\"[config.discord_bot_host]\""
|
|
if (config.discord_bot_port)
|
|
arguments += " --port=[config.discord_bot_port]"
|
|
|
|
message = replacetext(message, "\"", "\\\"")
|
|
|
|
ext_python("discordbot_message.py", "[arguments] [message]")
|
|
return
|
|
|
|
/proc/send_to_admin_discord(var/message)
|
|
send_to_discord(CHAN_ADMIN, message)
|
|
|
|
/proc/send_to_cciaa_discord(var/message)
|
|
send_to_discord(CHAN_CCIAA, message)
|
|
|
|
#undef CHAN_CCIAA
|
|
#undef CHAN_ADMIN
|