Download scripts/events/onEvent.js from sweet2004/bot: direct link, hf CLI and curl.
- Browser
- Download file 748 Bytes
-
https://huggingface.co/spaces/sweet2004/bot/resolve/main/scripts/events/onEvent.js
- Command line
-
hf download hf://spaces/sweet2004/bot/scripts/events/onEvent.js
-
curl -L -o onEvent.js https://huggingface.co/spaces/sweet2004/bot/resolve/main/scripts/events/onEvent.js
748 Bytes
| const allOnEvent = global.GoatBot.onEvent; | |
| module.exports = { | |
| config: { | |
| name: "onEvent", | |
| version: "1.1", | |
| author: "NTKhang", | |
| description: "Loop to all event in global.GoatBot.onEvent and run when have new event", | |
| category: "events" | |
| }, | |
| onStart: async ({ api, args, message, event, threadsData, usersData, dashBoardData, threadModel, userModel, dashBoardModel, role, commandName }) => { | |
| for (const item of allOnEvent) { | |
| if (typeof item === "string") | |
| continue; // Skip if item is string, because it is the command name and is executed at ../../bot/handler/handlerEvents.js | |
| item.onStart({ api, args, message, event, threadsData, usersData, threadModel, dashBoardData, userModel, dashBoardModel, role, commandName }); | |
| } | |
| } | |
| }; |