mirror of
https://github.com/nx-bat/synapse.git
synced 2026-09-23 09:59:05 -04:00
18 lines
474 B
TypeScript
18 lines
474 B
TypeScript
import { Event, CommandClient } from 'athena-prime';
|
|
import tasks from '../../tasks';
|
|
|
|
class ReadyEvent extends Event<CommandClient> {
|
|
event: string = 'ready' as const;
|
|
|
|
async handle(context: CommandClient<any, any>) {
|
|
await context.deployCommands();
|
|
|
|
tasks.forEach(async task => {
|
|
if (task.init) await task.handler(context);
|
|
setInterval(async () => await task.handler(context), task.interval);
|
|
});
|
|
}
|
|
}
|
|
|
|
export default new ReadyEvent('ready');
|