2021-12-24 14:55:28 +00:00
|
|
|
import { CoreClient } from "./client/client";
|
2021-11-28 14:24:53 +00:00
|
|
|
import * as dotenv from "dotenv";
|
2022-03-29 18:19:54 +01:00
|
|
|
import registry from "./registry";
|
2021-11-28 14:24:53 +00:00
|
|
|
|
|
|
|
dotenv.config();
|
|
|
|
|
2022-03-29 18:19:54 +01:00
|
|
|
const requiredConfigs: string[] = [
|
|
|
|
"BOT_TOKEN",
|
|
|
|
"BOT_VER",
|
|
|
|
"BOT_AUTHOR",
|
|
|
|
"BOT_DATE",
|
|
|
|
"BOT_OWNERID",
|
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
|
|
|
|
2022-03-29 18:19:54 +01:00
|
|
|
const devmode = process.argv.find(x => x.toLowerCase() == "--dev") != null;
|
2021-12-24 14:55:28 +00:00
|
|
|
|
2022-03-29 18:19:54 +01:00
|
|
|
const client = new CoreClient(devmode);
|
|
|
|
|
|
|
|
registry.RegisterCommands(client);
|
|
|
|
registry.RegisterEvents(client);
|
2021-12-24 14:55:28 +00:00
|
|
|
|
2021-11-28 14:24:53 +00:00
|
|
|
client.start();
|