From c26905ff30f23a73a746ff2ffe38d2806f274892 Mon Sep 17 00:00:00 2001 From: amsyarasyiq <82711525+amsyarasyiq@users.noreply.github.com> Date: Tue, 13 Jun 2023 23:04:57 +0800 Subject: [PATCH] Publish 'HoldGIFSend' --- .gitignore | 3 +-- make.mjs | 29 +++++++++++++++++++++++++++++ package.json | 3 ++- plugins/HoldGIFSend/manifest.json | 7 +++++++ plugins/HoldGIFSend/src/index.ts | 6 ++++++ 5 files changed, 45 insertions(+), 3 deletions(-) create mode 100644 make.mjs create mode 100644 plugins/HoldGIFSend/manifest.json create mode 100644 plugins/HoldGIFSend/src/index.ts diff --git a/.gitignore b/.gitignore index 3d0abbf..406520b 100644 --- a/.gitignore +++ b/.gitignore @@ -5,5 +5,4 @@ pnpm-lock.yaml yarn.lock package-lock.json Themer -FunnyBackground -YouTabRemover +RealThemer diff --git a/make.mjs b/make.mjs new file mode 100644 index 0000000..35547e4 --- /dev/null +++ b/make.mjs @@ -0,0 +1,29 @@ +import * as fs from "fs"; +import { argv } from "process"; + +const pluginName = [...argv].pop(); + +if (fs.existsSync(`./plugins/${pluginName}`)) { + console.warn(`Plugin named ${pluginName} already exists!`); +} + +fs.mkdirSync(`./plugins/${pluginName}/src`, { recursive: true }); + +if (fs.existsSync(`./plugins/${pluginName}/manifest.json`)) { + throw new Error(`${pluginName} already got manifest!`); +} + +fs.writeFileSync( + `./plugins/${pluginName}/manifest.json`, + JSON.stringify({ + name: pluginName, + description: null, + vendetta: {} + }, null, 4) +); + +fs.writeFileSync( + `./plugins/${pluginName}/src/index.ts`, + "export default {};\n" +); + diff --git a/package.json b/package.json index 085ff83..a4d53bb 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,8 @@ "scripts": { "build": "node build.mjs", "watch": "node build.mjs -w", - "lint": "eslint plugins" + "lint": "eslint plugins", + "make": "node make.mjs" }, "devDependencies": { "@rollup/plugin-commonjs": "^24.1.0", diff --git a/plugins/HoldGIFSend/manifest.json b/plugins/HoldGIFSend/manifest.json new file mode 100644 index 0000000..19c34b4 --- /dev/null +++ b/plugins/HoldGIFSend/manifest.json @@ -0,0 +1,7 @@ +{ + "name": "HoldGIFSend", + "description": "Hold GIF links to chat input before sending them.", + "vendetta": { + "icon": "gif" + } +} diff --git a/plugins/HoldGIFSend/src/index.ts b/plugins/HoldGIFSend/src/index.ts new file mode 100644 index 0000000..b8c9d60 --- /dev/null +++ b/plugins/HoldGIFSend/src/index.ts @@ -0,0 +1,6 @@ +import { findByProps } from "@vendetta/metro"; +import { instead } from "@vendetta/patcher"; + +const messageInputUtil = findByProps("selectGIF"); + +export const unLoad = instead("selectGIF", messageInputUtil, ([{ url }]) => messageInputUtil.insertText(url));