23 lines
576 B
TypeScript
23 lines
576 B
TypeScript
|
import { runBot } from "./bot/bot.ts";
|
||
|
import { init as initNormalMode } from "./bot/normal_mode/init.ts"
|
||
|
import { setupDB } from "./repo/exports.ts";
|
||
|
import { reloadConfig } from "./config.ts";
|
||
|
import { BotMode } from "./cfg/bot.ts";
|
||
|
|
||
|
const main = async () => {
|
||
|
const cfg = reloadConfig()
|
||
|
const { botCfg } = cfg
|
||
|
const { db } = await setupDB(cfg)
|
||
|
|
||
|
runBot(botCfg, (bot) => {
|
||
|
switch (botCfg.mode) {
|
||
|
case BotMode.setup:
|
||
|
initNormalMode(bot, db, cfg)
|
||
|
break;
|
||
|
case BotMode.normal:
|
||
|
break;
|
||
|
}
|
||
|
})
|
||
|
}
|
||
|
if (import.meta.main) { main() }
|