import { Client, Events, GatewayIntentBits, REST } from "discord.js"; import registerEvents from "./handlers/events.ts"; import registerInteractions from "./handlers/interactions.ts"; import config from "./config.ts"; import { startTicketWatcher } from "./tasks/ticketWatcher.ts"; import logger from "./utils/logging.ts"; const client = new Client({ intents: [ GatewayIntentBits.GuildMessages, GatewayIntentBits.Guilds, GatewayIntentBits.MessageContent, ], }); client.on(Events.ClientReady, async (client) => { logger.info(`logged in as ${client.user?.tag}!`); await Promise.all([registerEvents(client), registerInteractions(client)]); logger.info("events and interactions registered!"); console.log(); startTicketWatcher(client); }); export default client; export const rest = new REST({ version: "9" }).setToken(config.discord.token);