From 0024187d2d9c7abbe9deebb6d490155311f48f80 Mon Sep 17 00:00:00 2001 From: amy Date: Sun, 22 Dec 2024 20:33:21 +0330 Subject: [PATCH] am amy!!!! --- plugins/remixer/index.ts | 22 ++++++++++++++++++++++ plugins/remixer/plugin.json | 5 +++++ 2 files changed, 27 insertions(+) create mode 100644 plugins/remixer/index.ts create mode 100644 plugins/remixer/plugin.json diff --git a/plugins/remixer/index.ts b/plugins/remixer/index.ts new file mode 100644 index 0000000..ef3a0ef --- /dev/null +++ b/plugins/remixer/index.ts @@ -0,0 +1,22 @@ +const { + http: {intercept} +} = shelter + + + + +const unintercept = intercept("post", /\/channels\/\d+\/messages/, async (req, send) => { + if (req.body.attachments) { + for (let i = 0; i < req.body.attachments.length; i++) { + req.body.attachments[i] = { + ...req.body.attachments[i], + is_remix: true + }; + } + } + return send(req) +}) + +export function onUnload() { + unintercept() +} \ No newline at end of file diff --git a/plugins/remixer/plugin.json b/plugins/remixer/plugin.json new file mode 100644 index 0000000..48591b5 --- /dev/null +++ b/plugins/remixer/plugin.json @@ -0,0 +1,5 @@ +{ + "name": "remixer", + "author": "amy", + "description": "set all your attachments as remix" +} \ No newline at end of file