Download Goat-Bot-V2/scripts/cmds/all.js from sweet2004/mitaaaa: direct link, hf CLI and curl.
- Browser
- Download file 1.09 kB
-
https://huggingface.co/spaces/sweet2004/mitaaaa/resolve/main/Goat-Bot-V2/scripts/cmds/all.js
- Command line
-
hf download hf://spaces/sweet2004/mitaaaa/Goat-Bot-V2/scripts/cmds/all.js
-
curl -L -o all.js https://huggingface.co/spaces/sweet2004/mitaaaa/resolve/main/Goat-Bot-V2/scripts/cmds/all.js
1.09 kB
| module.exports = { | |
| config: { | |
| name: "all", | |
| version: "1.1", | |
| author: "NTKhang", | |
| countDown: 5, | |
| role: 1, | |
| shortDescription: { | |
| vi: "Tag tất cả thành viên", | |
| en: "Tag all members" | |
| }, | |
| longDescription: { | |
| vi: "Tag tất cả thành viên trong nhóm chat của bạn", | |
| en: "Tag all members in your group chat" | |
| }, | |
| category: "box chat", | |
| guide: { | |
| vi: "{pn} [nội dung | để trống]", | |
| en: "{pn} [content | empty]" | |
| } | |
| }, | |
| onStart: async function ({ message, event, args, api }) { | |
| const { participantIDs } = await api.getThreadInfo(event.threadID); | |
| const lengthAllUser = participantIDs.length; | |
| const mentions = []; | |
| let body = args.join(" ") || "@all"; | |
| let bodyLength = body.length; | |
| let i = 0; | |
| for (const uid of participantIDs) { | |
| let fromIndex = 0; | |
| if (bodyLength < lengthAllUser) { | |
| body += body[bodyLength - 1]; | |
| bodyLength++; | |
| } | |
| if (body.slice(0, i).lastIndexOf(body[i]) != -1) | |
| fromIndex = i; | |
| mentions.push({ | |
| tag: body[i], | |
| id: uid, fromIndex | |
| }); | |
| i++; | |
| } | |
| message.reply({ body, mentions }); | |
| } | |
| }; |