aboutsummaryrefslogtreecommitdiff
path: root/bot/src/init.js
blob: 45b9a418dd7fc1e468c51020cbcbca30842a7b3f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import { syncDB } from './utils/sync.js';
import { apiServer } from './api/server.js';
import { event } from './handlers/event.js';
import { command } from './handlers/command.js';
//import { deployCommands } from './util/deploy.js';

export async function init(client) {
    try {
        if (process.env.NODE_ENV === 'development') {
            await syncDB();
        }
        //deployCommands().then(() => console.log('[>] Deployed commands'));
        await apiServer(client);
        await event(client).then(() => console.log('[>] Event module loaded'));
        await command(client).then(() => console.log('[>] Command module loaded'));
    } catch (e) {
        console.error(e);
    }
}