JaBa/base/newClient.js

18 lines
522 B
JavaScript
Raw Normal View History

import { Client } from "discord.js";
2024-12-05 21:13:43 +05:00
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";
2024-12-05 21:13:43 +05:00
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));
2024-12-06 21:22:38 +05:00
}
2024-12-05 21:13:43 +05:00
}