Files
discordeno/template/beginner/mod.ts
ITOH 5f25263bd4 chore(template): to main repo (#1988)
* chore: move template to main repo

* ci

* Update sync_repos.yml
2022-02-03 18:02:44 +00:00

26 lines
727 B
TypeScript

import { startBot } from "./deps.ts";
import log from "./src/utils/logger.ts";
import { fileLoader, importDirectory } from "./src/utils/loader.ts";
import { updateApplicationCommands } from "./src/utils/updateCommands.ts";
// setup db
import "./src/database/mod.ts";
import { Bot } from "./bot.ts";
log.info("Starting bot...");
// Forces deno to read all the files which will fill the commands/inhibitors cache etc.
await Promise.all(
[
"./src/commands",
"./src/events",
// "./src/tasks",
].map((path) => importDirectory(Deno.realPathSync(path))),
);
await fileLoader();
// UPDATES YOUR COMMANDS TO LATEST COMMANDS
await updateApplicationCommands();
// STARTS THE CONNECTION TO DISCORD
await startBot(Bot);