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:
@@ -14,7 +14,7 @@ export class MessageStore {
|
||||
return this.map;
|
||||
}
|
||||
|
||||
static async put(m: Message | StoredMessage) {
|
||||
static async put(m: Message | StoredMessage): Promise<StoredMessage> {
|
||||
const msg: StoredMessage = isStoredMessage(m) ? m : {
|
||||
chatId: m.chat.id,
|
||||
id: m.message_id,
|
||||
@@ -26,6 +26,7 @@ export class MessageStore {
|
||||
|
||||
this.map.set(this.key(msg.chatId, msg.id), msg);
|
||||
await messageDao.insert(messageDao.mapStoredTo([msg]));
|
||||
return msg;
|
||||
}
|
||||
|
||||
static async get(chatId: number, messageId: number): Promise<StoredMessage | null> {
|
||||
|
||||
Reference in New Issue
Block a user