mirror of
https://github.com/marcogll/talia_bot.git
synced 2026-01-13 21:35:19 +00:00
feat: Complete sprint tasks
- Add file upload security validation to prevent processing of potentially harmful files. - Update python-telegram-bot to a pinned version and upgrade other dependencies. - Implement Whisper transcription agent for voice message processing. - Restore Google Calendar functionality with provided credentials.
This commit is contained in:
10
bot/main.py
10
bot/main.py
@@ -42,7 +42,8 @@ from bot.modules.vikunja import vikunja_conv_handler, get_projects_list, get_tas
|
||||
from bot.modules.printer import send_file_to_printer, check_print_status
|
||||
from bot.db import setup_database
|
||||
from bot.modules.flow_engine import FlowEngine
|
||||
from bot.modules.llm_engine import transcribe_audio
|
||||
from bot.modules.transcription import transcribe_audio
|
||||
from bot.modules.file_validation import validate_document
|
||||
|
||||
from bot.scheduler import schedule_daily_summary
|
||||
|
||||
@@ -169,6 +170,13 @@ async def handle_document(update: Update, context: ContextTypes.DEFAULT_TYPE) ->
|
||||
"""Handles documents sent to the bot for printing."""
|
||||
document = update.message.document
|
||||
user_id = update.effective_user.id
|
||||
|
||||
# Validate the document before processing
|
||||
is_valid, message = validate_document(document)
|
||||
if not is_valid:
|
||||
await update.message.reply_text(message)
|
||||
return
|
||||
|
||||
file = await context.bot.get_file(document.file_id)
|
||||
|
||||
# Create a directory for temporary files if it doesn't exist
|
||||
|
||||
Reference in New Issue
Block a user