Add Telegram bot support #23

Merged
Berack96 merged 23 commits from 6-telegram-interface into main 2025-10-13 10:49:46 +02:00
2 changed files with 4 additions and 4 deletions
Showing only changes of commit 8512985ca6 - Show all commits

View File

@@ -17,8 +17,8 @@ models:
gemini: gemini:
- name: gemini-2.0-flash - name: gemini-2.0-flash
label: Gemini label: Gemini
- name: gemini-2.0-pro # - name: gemini-2.0-pro # TODO Non funziona, ha un nome diverso
label: Gemini Pro # label: Gemini Pro
ollama: ollama:
copilot-pull-request-reviewer[bot] commented 2025-10-13 10:47:12 +02:00 (Migrated from github.com)
Review

The Italian comment contains a spelling error: 'Non funziona' should be 'Non funziona' (already correct), but 'ha' should be 'ha' (already correct). However, there's inconsistent capitalization - 'Non' should be lowercase 'non' in Italian.

    # - name: gemini-2.0-pro # TODO non funziona, ha un nome diverso
The Italian comment contains a spelling error: 'Non funziona' should be 'Non funziona' (already correct), but 'ha' should be 'ha' (already correct). However, there's inconsistent capitalization - 'Non' should be lowercase 'non' in Italian. ```suggestion # - name: gemini-2.0-pro # TODO non funziona, ha un nome diverso ```
- name: gpt-oss:latest - name: gpt-oss:latest
label: Ollama GPT label: Ollama GPT

View File

@@ -140,12 +140,12 @@ class TelegramApp:
async def __error_handler(self, update: object, context: ContextTypes.DEFAULT_TYPE) -> None: async def __error_handler(self, update: object, context: ContextTypes.DEFAULT_TYPE) -> None:
try: try:
logging.exception(f"Unhandled exception in Telegram handler {context.error}") logging.error(f"Unhandled exception in Telegram handler: {context.error}")
# Try to notify the user in chat if possible # Try to notify the user in chat if possible
if isinstance(update, Update) and update.effective_chat: if isinstance(update, Update) and update.effective_chat:
chat_id = update.effective_chat.id chat_id = update.effective_chat.id
msg = "Si è verificato un errore inatteso. Gli sviluppatori sono stati avvisati." msg = "An error occurred while processing your request."
await context.bot.send_message(chat_id=chat_id, text=msg) await context.bot.send_message(chat_id=chat_id, text=msg)
except Exception: except Exception: