Spot/bot.ts

28 lines
827 B
TypeScript
Raw Permalink Normal View History

2023-12-18 14:04:26 +01:00
import { Client, GatewayIntentBits, Collection, ContextMenuCommandBuilder, ApplicationCommandType } from 'discord.js';
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
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] });
2023-12-18 14:04:26 +01:00
const init = async () => {
await deployCommands();
await bindCommands();
2023-12-18 14:04:26 +01:00
client.login(process.env.token);
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();