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)
This commit is contained in:
2026-02-04 12:55:04 +03:00
parent 3c7d56b213
commit 9ba3d81a21
6 changed files with 142 additions and 102 deletions
+2 -2
View File
@@ -18,11 +18,11 @@ export class GeminiChat extends ChatCommand {
command = "gemini";
argsMode = "required" as const;
requirements = Requirements.Build(Requirement.BOT_CREATOR);
title = "/gemini";
description = "Chat with AI (Gemini)";
requirements = Requirements.Build(Requirement.BOT_CREATOR);
async execute(msg: Message, match?: RegExpExecArray): Promise<void> {
console.log("match", match);
return this.executeGemini(msg, match?.[3]);
+2 -2
View File
@@ -17,11 +17,11 @@ export class MistralChat extends ChatCommand {
command = "mistral";
argsMode = "required" as const;
requirements = Requirements.Build(Requirement.BOT_CREATOR);
title = "/mistral";
description = "Chat with AI (Mistral)";
requirements = Requirements.Build(Requirement.BOT_CREATOR);
async execute(msg: Message, match?: RegExpExecArray): Promise<void> {
console.log("match", match);
return this.executeMistral(msg, match?.[3]);
-2
View File
@@ -133,8 +133,6 @@ export class OpenAIChat extends ChatCommand {
break;
}
}
}
} finally {
await editor.tick();