File size: 748 Bytes
80ce16c | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | 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 });
}
}
}; |