Download Goat-Bot-V2/scripts/cmds/restart.js from sweet2004/mitaaaa: direct link, hf CLI and curl.
- Browser
- Download file 1.13 kB
-
https://huggingface.co/spaces/sweet2004/mitaaaa/resolve/main/Goat-Bot-V2/scripts/cmds/restart.js
- Command line
-
hf download hf://spaces/sweet2004/mitaaaa/Goat-Bot-V2/scripts/cmds/restart.js
-
curl -L -o restart.js https://huggingface.co/spaces/sweet2004/mitaaaa/resolve/main/Goat-Bot-V2/scripts/cmds/restart.js
1.13 kB
| const fs = require("fs-extra"); | |
| module.exports = { | |
| config: { | |
| name: "restart", | |
| version: "1.0", | |
| author: "NTKhang", | |
| countDown: 5, | |
| role: 2, | |
| shortDescription: { | |
| vi: "Khởi động lại bot", | |
| en: "Restart bot" | |
| }, | |
| longDescription: { | |
| vi: "Khởi động lại bot", | |
| en: "Restart bot" | |
| }, | |
| category: "Owner", | |
| guide: { | |
| vi: " {pn}: Khởi động lại bot", | |
| en: " {pn}: Restart bot" | |
| } | |
| }, | |
| langs: { | |
| vi: { | |
| restartting: "🔄 | Đang khởi động lại bot..." | |
| }, | |
| en: { | |
| restartting: "🔄 | Restarting bot..." | |
| } | |
| }, | |
| onLoad: function ({ api }) { | |
| const pathFile = `${__dirname}/tmp/restart.txt`; | |
| if (fs.existsSync(pathFile)) { | |
| const [tid, time] = fs.readFileSync(pathFile, "utf-8").split(" "); | |
| api.sendMessage(`✅ | Bot restarted\n⏰ | Time: ${(Date.now() - time) / 1000}s`, tid); | |
| fs.unlinkSync(pathFile); | |
| } | |
| }, | |
| onStart: async function ({ message, event, getLang }) { | |
| const pathFile = `${__dirname}/tmp/restart.txt`; | |
| fs.writeFileSync(pathFile, `${event.threadID} ${Date.now()}`); | |
| await message.reply(getLang("restartting")); | |
| process.exit(2); | |
| } | |
| }; |