vylbot-app/src/vylbot.ts

30 lines
631 B
TypeScript
Raw Normal View History

import { CoreClient } from "./client/client";
2021-11-28 14:24:53 +00:00
import * as dotenv from "dotenv";
import Register from "./Register";
2021-11-28 14:24:53 +00:00
dotenv.config();
2021-12-02 11:44:56 +00:00
const requiredConfigs = [
"EMBED_COLOUR",
"EMBED_COLOUR_ERROR",
"ROLES_MODERATOR",
"ROLES_MUTED",
"CHANNELS_LOGS_MESSAGE",
"CHANNELS_LOGS_MEMBER",
"CHANNELS_LOGS_MOD",
2021-12-02 14:36:24 +00:00
"COMMANDS_ROLE_ROLES",
"COMMANDS_RULES_FILE"
2021-12-02 11:44:56 +00:00
];
2021-11-29 11:27:44 +00:00
2021-12-02 11:44:56 +00:00
requiredConfigs.forEach(config => {
if (!process.env[config]) {
throw `${config} is required in .env`;
}
});
2021-11-28 14:24:53 +00:00
const client = new CoreClient();
Register.RegisterCommands(client);
Register.RegisterEvents(client);
2021-11-28 14:24:53 +00:00
client.start();