Ports Nebula's Discord Webhook Integration (#8071)

* Ports Nebula's Discord Webhook Integration

* Forgot the example .json file.
This commit is contained in:
Neerti
2021-05-13 02:22:25 -04:00
committed by GitHub
parent b123a4750b
commit 4deffc7186
26 changed files with 518 additions and 5 deletions

View File

@@ -1626,6 +1626,19 @@ datum/admins/var/obj/item/weapon/paper/admin/faxreply // var to hold fax replies
for(var/client/C in admins)
if((R_ADMIN | R_MOD | R_EVENT) & C.holder.rights)
to_chat(C, "<span class='log_message'><span class='prefix'>FAX LOG:</span>[key_name_admin(src.owner)] has sent a fax message to [destination.department] (<a href='?_src_=holder;AdminFaxView=\ref[rcvdcopy]'>VIEW</a>)</span>")
var/plaintext_title = P.sender ? "replied to [key_name(P.sender)]'s fax" : "sent a fax message to [destination.department]"
var/fax_text = paper_html_to_plaintext(P.info)
log_game(plaintext_title)
log_game(fax_text)
SSwebhooks.send(
WEBHOOK_FAX_SENT,
list(
"name" = "[key_name(owner)] [plaintext_title].",
"body" = fax_text
)
)
else
to_chat(src.owner, "<span class='warning'>Message reply failed.</span>")