vylbot-app/src/vylbot.ts
Vylpes 39c06fbc8e
Update bot to discord.js v13 (#125)
* Update bot to discord.js v13

* Remove debug code
2022-04-14 18:01:16 +01:00

33 lines
No EOL
723 B
TypeScript

import { CoreClient } from "./client/client";
import * as dotenv from "dotenv";
import registry from "./registry";
import { Intents } from "discord.js";
dotenv.config();
const requiredConfigs: string[] = [
"BOT_TOKEN",
"BOT_VER",
"BOT_AUTHOR",
"BOT_DATE",
"BOT_OWNERID",
];
requiredConfigs.forEach(config => {
if (!process.env[config]) {
throw `${config} is required in .env`;
}
});
const devmode = process.argv.find(x => x.toLowerCase() == "--dev") != null;
const client = new CoreClient([
Intents.FLAGS.GUILDS,
Intents.FLAGS.GUILD_MESSAGES,
Intents.FLAGS.GUILD_MEMBERS,
], devmode);
registry.RegisterCommands(client);
registry.RegisterEvents(client);
client.start();