2024-12-07 01:58:15 +05:00
|
|
|
import { Client } from "discord.js";
|
2024-12-05 21:13:43 +05:00
|
|
|
import { config } from "../config.js";
|
2024-12-07 01:58:15 +05:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
2024-12-07 01:58:15 +05:00
|
|
|
async init() {
|
2024-12-07 16:53:11 +05:00
|
|
|
return 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
|
|
|
}
|