Create initial bot framework (#7)
#1 Reviewed-on: https://gitea.vylpes.xyz/External/card-drop/pulls/7 Co-authored-by: Ethan Lane <ethan@vylpes.com> Co-committed-by: Ethan Lane <ethan@vylpes.com>
This commit is contained in:
parent
cb548898ce
commit
c706737369
35 changed files with 5876 additions and 0 deletions
36
src/bot.ts
Normal file
36
src/bot.ts
Normal file
|
@ -0,0 +1,36 @@
|
|||
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();
|
||||
|
||||
client.start();
|
Loading…
Add table
Add a link
Reference in a new issue