JaBa/base/newClient.js
2024-12-06 23:58:15 +03:00

17 lines
522 B
JavaScript

import { Client } from "discord.js";
import { config } from "../config.js";
import { init as initCommands } from "../handlers/command-handler/index.js";
import { init as initEvents } from "../handlers/event-handler/index.js";
export class ExtendedClient extends Client {
/**
* @param {import("discord.js").ClientOptions} options
*/
constructor(options) {
super(options);
}
async init() {
this.login(config.token).then(async () => await Promise.all([initCommands(), initEvents()]).catch(console.error));
}
}