Vylpes
400b4de304
Some checks failed
continuous-integration/drone/push Build is failing
- Prevent user from trying to time out a bot - Update time length input to ignore commas #98 Co-authored-by: Ethan Lane <ethan@vylpes.com> Reviewed-on: https://gitea.vylpes.xyz/RabbitLabs/vylbot-app/pulls/306
38 lines
805 B
TypeScript
38 lines
805 B
TypeScript
import { CoreClient } from "./client/client";
|
|
import * as dotenv from "dotenv";
|
|
import registry from "./registry";
|
|
import { IntentsBitField } from "discord.js";
|
|
|
|
dotenv.config();
|
|
|
|
const requiredConfigs: string[] = [
|
|
"BOT_TOKEN",
|
|
"BOT_VER",
|
|
"BOT_AUTHOR",
|
|
"BOT_OWNERID",
|
|
"BOT_CLIENTID",
|
|
"DB_HOST",
|
|
"DB_PORT",
|
|
"DB_AUTH_USER",
|
|
"DB_AUTH_PASS",
|
|
"DB_SYNC",
|
|
"DB_LOGGING",
|
|
];
|
|
|
|
requiredConfigs.forEach(config => {
|
|
if (!process.env[config]) {
|
|
throw `${config} is required in .env`;
|
|
}
|
|
});
|
|
|
|
const client = new CoreClient([
|
|
IntentsBitField.Flags.Guilds,
|
|
IntentsBitField.Flags.GuildMessages,
|
|
IntentsBitField.Flags.GuildMembers,
|
|
IntentsBitField.Flags.MessageContent,
|
|
]);
|
|
|
|
registry.RegisterCommands();
|
|
registry.RegisterEvents();
|
|
|
|
client.start();
|