UNPKG

bdjs

Version:

A potent package for creating Discord bots.

23 lines (22 loc) 773 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const Event_1 = require("../structures/Event"); const Data_1 = require("../structures/Data"); exports.default = new Event_1.BaseEvent({ name: 'onInterval', description: 'Executed when an interval is emitted.', async listener(bot, env) { const commands = Array.from(bot.commands.values()).filter(cmd => cmd.type === 'interval'); const data = new Data_1.Data({ bot, commandType: 'interval', env, functions: bot.functions, reader: bot.reader }); for (const command of commands) { data.command = command; await data.reader.compile(command.code, data); } } });