* environment variable to enable/disable processing links in messages (for downloading videos)

* bot will not automatically download video from youtube or load it from cache. It will fetch video info first, then suggest to download or get video from cache (with retry options)
* some rewriting in sending/editing/replying to messages
This commit is contained in:
2026-03-03 00:01:44 +03:00
parent 3f34a48d41
commit 1f96e3553e
18 changed files with 429 additions and 112 deletions
+7 -1
View File
@@ -27,6 +27,8 @@ export class Environment {
static MAX_PHOTO_SIZE: number;
static PROCESS_LINKS: boolean;
static DEFAULT_AI_PROVIDER: AiProvider;
static SYSTEM_PROMPT?: string;
@@ -49,7 +51,9 @@ export class Environment {
static OPENAI_MODEL: string;
static OPENAI_IMAGE_MODEL: string;
static waitText = "⏳ Дайте-ка подумать...";
static errorText = "⚠️ Произошла ошибка.";
static waitText = "⏳ Секунду...";
static waitThinkText = "⏳ Дайте-ка подумать...";
static analyzingPictureText = "🔍 Внимательно изучаю изображение...";
static analyzingPicturesText = "🔍 Внимательно изучаю изображения...";
static genImageText = "👨‍🎨 Генерирую изображение...";
@@ -73,6 +77,8 @@ export class Environment {
Environment.MAX_PHOTO_SIZE = Number(process.env.MAX_PHOTO_SIZE || "1280");
Environment.PROCESS_LINKS = ifTrue(process.env.PROCESS_LINKS);
const aiProvider = process.env.DEFAULT_AI_PROVIDER || "OLLAMA";
if (Object.values(AiProvider).includes(aiProvider as AiProvider)) {
Environment.DEFAULT_AI_PROVIDER = aiProvider as AiProvider;