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