summaryrefslogtreecommitdiff
path: root/packages/gateway/src/index.ts
blob: 1e1184aecb82c331080688106768cf9d41d9b24e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import { GatewayIntentBits, Client } from "discord.js";
import dotenv from "dotenv";
import { handleCommands } from "./commands";
import { handleListeners } from "./listeners";

dotenv.config({ path: "../../.dev.vars" });
console.log("Discord Token loaded:", process.env.DISCORD_TOKEN ? "Yes" : "No");
console.log("Token length:", process.env.DISCORD_TOKEN?.length || 0);

const client = new Client({
  intents: [
    GatewayIntentBits.Guilds,
    GatewayIntentBits.GuildMembers,
    GatewayIntentBits.GuildMessages,
    GatewayIntentBits.MessageContent,
  ],
});

handleCommands(client);
handleListeners(client);
client.login(process.env.DISCORD_TOKEN);