2023-08-19 16:56:22 +01:00
|
|
|
import * as dotenv from "dotenv";
|
|
|
|
import { CoreClient } from "./client/client";
|
|
|
|
import { IntentsBitField } from "discord.js";
|
|
|
|
import Registry from "./registry";
|
|
|
|
|
|
|
|
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.GuildMembers,
|
|
|
|
]);
|
|
|
|
|
|
|
|
Registry.RegisterCommands();
|
|
|
|
Registry.RegisterEvents();
|
2023-09-03 20:27:29 +01:00
|
|
|
Registry.RegisterButtonEvents();
|
2023-08-19 16:56:22 +01:00
|
|
|
|
|
|
|
client.start();
|