JaBa/base/newClient.js
2024-12-07 14:53:11 +03:00

19 lines
537 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() {
return this.login(config.token)
.then(async () => await Promise.all([initCommands(), initEvents()]))
.catch(console.error);
}
}