Publish 'HoldGIFSend'

This commit is contained in:
amsyarasyiq 2023-06-13 23:04:57 +08:00
parent 41bad09587
commit c26905ff30
5 changed files with 45 additions and 3 deletions

3
.gitignore vendored
View file

@ -5,5 +5,4 @@ pnpm-lock.yaml
yarn.lock
package-lock.json
Themer
FunnyBackground
YouTabRemover
RealThemer

29
make.mjs Normal file
View file

@ -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"
);

View file

@ -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",

View file

@ -0,0 +1,7 @@
{
"name": "HoldGIFSend",
"description": "Hold GIF links to chat input before sending them.",
"vendetta": {
"icon": "gif"
}
}

View file

@ -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));