refactor!: rewrite bot core; add AI (Ollama, Gemini), DB, new commands

This commit is contained in:
2026-01-12 15:32:50 +03:00
parent 9d74ad9861
commit df9471a7e4
137 changed files with 11341 additions and 2025 deletions
+19
View File
@@ -0,0 +1,19 @@
import {ChatCommand} from "../base/chat-command";
import {logError, randomValue, oldSendMessage} from "../util/utils";
import {betterAnswers} from "../db/database";
import {Message} from "typescript-telegram-bot-api";
export class WhatBetter extends ChatCommand {
regexp = /^\/(what|что)\s(better|лучше)\s([^]+)\s(or|или)\s([^]+)/i;
title = "/what better [a] or [b]";
description = "either a or b randomly (50% chance)";
async execute(msg: Message, match?: RegExpExecArray) {
const a = match[3];
const b = match[5].trimStart();
const text = `${randomValue(betterAnswers)} ${randomValue([a, b])}`;
await oldSendMessage(msg, text).catch(logError);
}
}