2023-12-18 14:04:26 +01:00
|
|
|
import { Client, GatewayIntentBits, Collection, ContextMenuCommandBuilder, ApplicationCommandType } from 'discord.js';
|
2022-10-21 17:22:01 +00:00
|
|
|
import * as dotenv from 'dotenv';
|
2023-12-18 14:04:26 +01:00
|
|
|
import { deployCommands } from './deploy-commands';
|
|
|
|
|
import { bindCommands } from './bind-commands';
|
|
|
|
|
import { bindToEvents } from './utils/bind-events';
|
|
|
|
|
import { loadMessages } from './model/messages';
|
2023-12-02 17:23:16 +01:00
|
|
|
|
2022-10-21 17:22:01 +00:00
|
|
|
dotenv.config();
|
|
|
|
|
|
2023-12-02 17:23:16 +01:00
|
|
|
declare module "discord.js" {
|
|
|
|
|
export interface Client {
|
|
|
|
|
commands: Collection<any, any>;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-12-18 14:04:26 +01:00
|
|
|
export const client = new Client({ intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages, GatewayIntentBits.MessageContent, GatewayIntentBits.GuildMembers] });
|
2022-10-21 17:22:01 +00:00
|
|
|
|
2023-12-18 14:04:26 +01:00
|
|
|
const init = async () => {
|
|
|
|
|
await deployCommands();
|
|
|
|
|
await bindCommands();
|
2022-10-21 17:22:01 +00:00
|
|
|
|
2023-12-18 14:04:26 +01:00
|
|
|
client.login(process.env.token);
|
2022-10-21 17:22:01 +00:00
|
|
|
|
2023-12-18 14:04:26 +01:00
|
|
|
bindToEvents();
|
|
|
|
|
loadMessages();
|
|
|
|
|
}
|
2023-11-30 21:17:29 +01:00
|
|
|
|
2023-12-18 14:04:26 +01:00
|
|
|
init();
|