Last active
September 27, 2023 16:30
-
-
Save 3ximus/159c2fc7dc20c871cac2806f1ec8e9e3 to your computer and use it in GitHub Desktop.
Revisions
-
3ximus renamed this gist
Sep 27, 2023 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
3ximus created this gist
Sep 27, 2023 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,38 @@ var originalOpen = originalOpen ? originalOpen : XMLHttpRequest.prototype.open; XMLHttpRequest.prototype.open = function (method, url) { this._url = url; return originalOpen.apply(this, arguments); }; const MESSAGE = [ { type: "rich_text", elements: [ { type: "rich_text_section", elements: [ { type: "text", text: "@Croissantizer", style: { strike: true } }, { type: "text", text: " DENIED!! Better luck next time !!" }, ], }, ], }, ]; var originalSend = originalSend ? originalSend : XMLHttpRequest.prototype.send; XMLHttpRequest.prototype.send = function (data) { try { if (this._url.includes("api/chat.postMessage")) { blocks = JSON.parse(arguments[0].get("blocks")); if ( blocks[0].elements[0].elements[0].type === "user" && blocks[0].elements[0].elements[0].user_id === "U03EB0G8UM8" ) { arguments[0].set("blocks", JSON.stringify(MESSAGE)); } } } catch (e) { console.log("FAIL"); } originalSend.apply(this, arguments); };