aboutsummaryrefslogtreecommitdiff
path: root/bot/src/bot.js
blob: af2aec2e9acc8ab371435f4ccc252adb97973f5c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import { Client, GatewayIntentBits } from 'discord.js'
import 'dotenv/config'
import { event } from './handler/event.js'
import { commands } from "./handler/commands.js";

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

commands(client);
event(client);

if (process.argv.indexOf('--beta') === -1) {
    client.login(process.env.abtoken).catch(function() {
        console.log('[X] Login failed. The token that you have put in is invalid.');
        process.exit(0);
    });
} else {
    client.login(process.env.abbtoken).catch(function() {
        console.log('[X] Login failed. The token that you have put in is invalid.');
        process.exit(0);
    });
}