Commit Graph

31 Commits

Author SHA1 Message Date
melod1n 8bec34413f some code cleanup 2026-02-16 19:52:28 +03:00
melod1n 5b84376dc7 improve cache storage and cleanup (+ recursively) 2026-02-16 19:51:43 +03:00
melod1n 6ea9905c25 (feat): clearing up both photo and video after 1 day and on process' start 2026-02-12 18:22:37 +03:00
melod1n 2026c673f5 checking models capabilities 2026-02-12 14:22:43 +03:00
melod1n b9fa2538db add support for youtube music videos 2026-02-12 11:55:14 +03:00
melod1n 21ab362776 fix 2026-02-06 21:22:20 +03:00
melod1n 9ba3d81a21 feat(ai): add configurable default provider + refactor telegram handlers
- add AiProvider enum and DEFAULT_AI_PROVIDER env var (fallback: OLLAMA)
- route chat execution based on selected provider (Ollama/Gemini/Mistral/OpenAI)
- move inline query / callback / edited message / my_chat_member handlers into utils
- minor cleanup (command requirements placement, whitespace)
2026-02-04 12:55:04 +03:00
melod1n a736f786c2 feat(openai): add chat streaming and model commands
- add /openai (/chatgpt) chat command using OpenAI Responses API (streaming + incremental edits)
- add /openAIListModels, /openAIGetModel, /openAISetModel
- introduce base Command class and migrate non-chat commands to it
- wire OpenAI client + env vars (OPENAI_API_KEY, OPENAI_MODEL)
- bump deps (@google/genai, systeminformation, @types/node) and add openai
2026-02-03 13:39:01 +03:00
melod1n 810151263d feat: separate Ollama text/image/think models + add YouTube downloader
Support OLLAMA_IMAGE_MODEL and new OLLAMA_THINK_MODEL (both default to OLLAMA_MODEL)

Add /ollamathink command; validate thinking capability; disable image-analysis flow in think mode

Make /ollama-get-model show Text/Image/Think blocks only when models differ

Add /ytdl (/youtube) command + auto-detect YouTube URLs in messages

Cache downloaded videos to data/video and schedule daily cleanup

Move photo storage from data/temp to data/photo; improve env boolean parsing via ifTrue

Update deps (youtubei.js, puppeteer*) and TS config (allowJs, allowSyntheticDefaultImports)
2026-01-31 19:37:25 +03:00
melod1n 9e30086af2 fix(images): cache Telegram photos by unique_id and pass base64 to LLM commands
Stop reading image files inside gemini/mistral commands; use pre-encoded image data from message parts

Rework loadImagesIfExists / loadImagesFromFileIds to return cached file_unique_ids and download only missing sizes

Encode cached images to base64 when assembling the reply chain

Make getPhotoMaxSize synchronous (returns PhotoSize), and map to URL only when needed

Await MessageStore.put / UserStore.put and prefetch single-image downloads on message receipt
2026-01-29 20:58:08 +03:00
melod1n b74e0a0f3e 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
2026-01-29 20:01:30 +03:00
melod1n 5f4405c9ee fix checking of same user requirement 2026-01-29 18:14:07 +03:00
melod1n 73905780b9 some updates 2026-01-28 19:47:50 +03:00
melod1n 12d9591109 some improvements for prompt making 2026-01-28 17:59:53 +03:00
melod1n 2f8f253eb1 Revert "update system-info text"
This reverts commit 44919f478e.
2026-01-28 16:54:11 +03:00
melod1n 44919f478e update system-info text 2026-01-28 16:45:10 +03:00
melod1n 63c64dfa8e update error logging
cutting all kind of prefixes for prompt making
2026-01-28 16:40:29 +03:00
melod1n 19a5942fec update requirements checking 2026-01-22 15:34:50 +03:00
melod1n 1493ffbe01 rename mute/unmute to ignore/unignore and add CHAT_ADMIN requirement for them and ban/unban commands 2026-01-22 14:36:14 +03:00
melod1n e833c16878 improvements 2026-01-22 13:50:36 +03:00
melod1n dbf6a54713 revert fix 2026-01-22 12:28:10 +03:00
melod1n 193bb3d3ad support for thinking models, ux improvements 2026-01-21 20:10:10 +03:00
melod1n 32baaebb93 update regex matching - now bot responds only for base commands (like /ping) and with mention (like /ping@panfilovi4_bot) and ignores command if it mentions other bot;
Add ability to see, change and list gemini, mistral and ollama models
2026-01-20 08:31:05 +03:00
melod1n c31345a3eb add update bot's commands on every start and added only for creator mode 2026-01-18 17:39:30 +03:00
melod1n 20749860ad add transliteration command (en <-> ru) 2026-01-18 16:29:16 +03:00
melod1n 38b312ae41 mistral ai vision for single image 2026-01-16 15:54:10 +03:00
melod1n 8743258474 ability to cancel ollama generation 2026-01-15 20:03:47 +03:00
melod1n 123bda888f move max_photo_size to environment variable 2026-01-12 19:41:40 +03:00
melod1n 6eff5d17ea test support for images (ollama vision models) 2026-01-12 19:19:08 +03:00
melod1n 8fe6857345 updates 2026-01-12 16:44:21 +03:00
melod1n df9471a7e4 refactor!: rewrite bot core; add AI (Ollama, Gemini), DB, new commands 2026-01-12 15:32:50 +03:00