Download plugins/gp.js from Ikygantengbangetanjay/testingba: direct link, hf CLI and curl.
- Browser
- Download file 927 Bytes
-
https://huggingface.co/spaces/Ikygantengbangetanjay/testingba/resolve/main/plugins/gp.js
- Command line
-
hf download hf://spaces/Ikygantengbangetanjay/testingba/plugins/gp.js
-
curl -L -o gp.js https://huggingface.co/spaces/Ikygantengbangetanjay/testingba/resolve/main/plugins/gp.js
927 Bytes
| const fs = require("fs"); | |
| const path = require("path"); | |
| let handler = async (m, { usedPrefix, command, text }) => { | |
| const listPlugins = fs | |
| .readdirSync(path.join(__dirname)) | |
| .map((v) => v.replace(/\.js/, "")); | |
| if (!text) | |
| throw `*• Example:* ${usedPrefix + command} *[name file]* | |
| *[ LIST FILE PLUGINS ]* | |
| ${listPlugins.map((v, i) => `> • *${i + 1}* ${v}`).join("\n")} | |
| `; | |
| const filename = path.join( | |
| __dirname, | |
| `./${text}${!/\.js$/i.test(text) ? ".js" : ""}`, | |
| ); | |
| if (!fs.existsSync(filename)) | |
| throw `*• Example:* ${usedPrefix + command} *[name file]* | |
| *[ LIST FILE PLUGINS ]* | |
| ${listPlugins.map((v, i) => `> • *${i + 1}* ${v}`).join("\n")} | |
| `; | |
| m.reply(fs.readFileSync(filename, "utf8")); | |
| }; | |
| handler.help = ["getplugin"].map((v) => v + " *[filename]*"); | |
| handler.tags = ["owner"]; | |
| handler.command = /^(getplugin|get ?plugin|gp)$/i; | |
| handler.rowner = true; | |
| module.exports = handler; | |