fishing-api/src/talkomatic/bot/index.ts

28 lines
624 B
TypeScript
Raw Permalink Normal View History

2024-10-12 07:21:38 +02:00
import { loadConfig } from "../../util/config";
import { TalkomaticBot, type TalkomaticBotConfig } from "./TalkomaticBot";
const bots: TalkomaticBot[] = [];
const defaults = loadConfig("config/talkomatic_bots.yml", [
{
channel: {
2024-10-12 15:39:57 +02:00
name: "test/fishing"
2024-10-12 07:21:38 +02:00
}
}
] as TalkomaticBotConfig[]);
export function connectDefaultBots() {
defaults.forEach(conf => {
initBot(conf);
});
}
export function initBot(conf: TalkomaticBotConfig) {
const bot = new TalkomaticBot(conf);
bot.start();
bots.push(bot);
}
export { TalkomaticBot as Bot };
export default TalkomaticBot;