diff --git a/code/__defines/webhooks.dm b/code/__defines/webhooks.dm index 13fcfa90e4..07b3bd73aa 100644 --- a/code/__defines/webhooks.dm +++ b/code/__defines/webhooks.dm @@ -8,3 +8,4 @@ #define WEBHOOK_ELEVATOR_FALL "webhook_elevator_fall" #define WEBHOOK_AHELP_SENT "webhook_ahelp_sent" #define WEBHOOK_FAX_SENT "webhook_fax_sent" +#define WEBHOOK_ROLEREQUEST "webhook_rolerequest" // YW EDIT: Adds rolerequest webhook diff --git a/code/modules/paperwork/faxmachine.dm b/code/modules/paperwork/faxmachine.dm index 762dbdbb77..7e6b1830d9 100644 --- a/code/modules/paperwork/faxmachine.dm +++ b/code/modules/paperwork/faxmachine.dm @@ -495,13 +495,12 @@ Extracted to its own procedure for easier logic handling with paper bundles. /** * Call the chat webhook to transmit a notification of a job request */ -/obj/machinery/photocopier/faxmachine/proc/message_chat_rolerequest(var/font_colour="#006100", var/role_to_ping, var/reason, var/jobname) - if(config.chat_webhook_url) - spawn(0) - var/query_string = "type=rolerequest" - query_string += "&key=[url_encode(config.chat_webhook_key)]" - query_string += "&ping=[url_encode(role_to_ping)]" - query_string += "&color=[url_encode(font_colour)]" - query_string += "&reason=[url_encode(reason)]" - query_string += "&job=[url_encode(jobname)]" - world.Export("[config.chat_webhook_url]?[query_string]") +/obj/machinery/photocopier/faxmachine/proc/message_chat_rolerequest(message_color, ping_name, reason, role) // YW EDIT: Adds rolerequest webhook + world << "It went through?" + SSwebhooks.send( + WEBHOOK_ROLEREQUEST, + list( + "name" = "[using_map.dock_name] Automated Job Board Update Department: [ping_name]", + "body" = "A request has been sent from [using_map.station_name] for a [role]\n The stated reason for the request is: [reason]" + ) + ) diff --git a/code/modules/webhooks/webhook_rolerequest_yw.dm b/code/modules/webhooks/webhook_rolerequest_yw.dm new file mode 100644 index 0000000000..2164539fb0 --- /dev/null +++ b/code/modules/webhooks/webhook_rolerequest_yw.dm @@ -0,0 +1,10 @@ +/decl/webhook/rolerequest + id = WEBHOOK_ROLEREQUEST + +/decl/webhook/rolerequest/get_message(var/list/data) + .= ..() + .["embeds"] = list(list( + "title" = "[data["name"]]", + "description" = data["body"], + "color" = COLOR_WEBHOOK_DEFAULT + )) diff --git a/vorestation.dme b/vorestation.dme index a7e27e620f..fdb07b6b42 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -4272,6 +4272,7 @@ #include "code\modules\webhooks\webhook_ahelp2discord.dm" #include "code\modules\webhooks\webhook_custom_event.dm" #include "code\modules\webhooks\webhook_fax2discord.dm" +#include "code\modules\webhooks\webhook_rolerequest_yw.dm" #include "code\modules\webhooks\webhook_roundend.dm" #include "code\modules\webhooks\webhook_roundprep.dm" #include "code\modules\webhooks\webhook_roundstart.dm"