mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2025-12-25 09:31:13 +00:00
discord.dm
Adds the DM side of sending messages to discord via nudge.
This commit is contained in:
33
code/modules/ext_scripts/discord.dm
Normal file
33
code/modules/ext_scripts/discord.dm
Normal file
@@ -0,0 +1,33 @@
|
||||
#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
|
||||
Reference in New Issue
Block a user