diff --git a/modular_chomp/code/modules/paperwork/faxmachine.dm b/modular_chomp/code/modules/paperwork/faxmachine.dm new file mode 100644 index 0000000000..26582de487 --- /dev/null +++ b/modular_chomp/code/modules/paperwork/faxmachine.dm @@ -0,0 +1,40 @@ +/proc/get_role_request_channel() + var/channel_tag = "rolerequest" + var/datum/tgs_api/v5/api = TGS_READ_GLOBAL(tgs) + if(istype(api) && channel_tag) + for(var/datum/tgs_chat_channel/channel in api.chat_channels) + if(channel.custom_tag == channel_tag) + return list(channel) + return 0 + +/proc/role_request_discord_message(var/message) + if(!message) + return + var/datum/tgs_chat_channel/channel = get_role_request_channel() + if(channel) + world.TgsChatBroadcast(message,channel) + +/proc/get_fax_channel() + var/channel_tag = "fax" + var/datum/tgs_api/v5/api = TGS_READ_GLOBAL(tgs) + if(istype(api) && channel_tag) + for(var/datum/tgs_chat_channel/channel in api.chat_channels) + if(channel.custom_tag == channel_tag) + return list(channel) + return 0 + +/proc/fax_discord_message(var/message) + if(!message) + return + var/datum/tgs_chat_channel/channel = get_fax_channel() + if(channel) + world.TgsChatBroadcast(message,channel) + + + +/obj/machinery/photocopier/faxmachine/message_chat_admins(var/mob/sender, var/faxname, var/obj/item/sent, var/faxid, font_colour="#006100") + fax_discord_message("A fax; '[faxname]' was sent.\nSender: [sender.name]\nFax name:\n[sent.name]\nFax ID: **[faxid]**") + + +/obj/machinery/photocopier/faxmachine/message_chat_rolerequest(var/font_colour="#006100", var/role_to_ping, var/reason, var/jobname) + role_request_discord_message("An automated request for crew has been made.\nJob: [jobname]\nReason: [reason]\n\n@[role_to_ping]") \ No newline at end of file diff --git a/vorestation.dme b/vorestation.dme index 0db0b3ba67..d258b85685 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -4888,6 +4888,7 @@ #include "modular_chomp\code\modules\mob\new_player\sprite_accessories_wing.dm" #include "modular_chomp\code\modules\organs\organ_icon.dm" #include "modular_chomp\code\modules\overmap\dynamic_sector.dm" +#include "modular_chomp\code\modules\paperwork\faxmachine.dm" #include "modular_chomp\code\modules\paperwork\filingcabinet.dm" #include "modular_chomp\code\modules\paperwork\pen.dm" #include "modular_chomp\code\modules\planet\sif.dm"