refactor(bot): centralize runtime state; support albums + safer vision handling
- make MessageStore.put() return StoredMessage and allow collectReplyChainText() to work with StoredMessage - move muted users + answers loading into Environment (add Answers model + GEMINI_IMAGE_MODEL) - extract message handling into processNewMessage() and add media-group (album) caching/downloading by unique_file_id - for Ollama: check model capabilities before sending images; use replyToMessage helper consistently - add /geminiGenImage command stub for Gemini image generation
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import {ChatCommand} from "../base/chat-command";
|
||||
import {Message} from "typescript-telegram-bot-api";
|
||||
import {logError, randomValue, oldReplyToMessage} from "../util/utils";
|
||||
import {testAnswers} from "../db/database";
|
||||
import {logError, oldReplyToMessage, randomValue} from "../util/utils";
|
||||
import {Environment} from "../common/environment";
|
||||
|
||||
export class Test extends ChatCommand {
|
||||
regexp = /^(test|тест|еуые|ntcn|инноке(нтий|ш|нтич))/i;
|
||||
@@ -9,6 +9,6 @@ export class Test extends ChatCommand {
|
||||
description = "System functionality check";
|
||||
|
||||
async execute(msg: Message) {
|
||||
await oldReplyToMessage(msg, randomValue(testAnswers) || "а").catch(logError);
|
||||
await oldReplyToMessage(msg, randomValue(Environment.ANSWERS.test) || "а").catch(logError);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user