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

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

command(client).then(() => console.log('[>] Command module loaded'));
event(client).then(() => console.log('[>] Event module loaded'));
apiServer(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);
    });
}