Files
Aurora.3/code/modules/ext_scripts/discord.dm
skull132 f5ea40b94d Discord.dm Update
Port's an integer, not a string.
2016-02-16 21:34:41 +02:00

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