Merge pull request #2056 from CHOMPStationBot/upstream-merge-10316

[MIRROR] [MIRROR] Ports Nebula's Discord Webhook Integration
This commit is contained in:
Nadyr
2021-05-27 21:36:38 -04:00
committed by GitHub
27 changed files with 532 additions and 14 deletions

View File

@@ -1632,6 +1632,19 @@ datum/admins/var/obj/item/weapon/paper/admin/faxreply // var to hold fax replies
for(var/client/C in GLOB.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>")