Update bot.py

This commit is contained in:
DerrtSML 2025-06-23 17:40:52 +03:00 committed by GitHub
parent 2f24befc93
commit 739bf44352
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

5
bot.py
View File

@ -72,6 +72,11 @@ def init_qbittorrent_client():
# --- Обработчики команд --- # --- Обработчики команд ---
async def start(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None: async def start(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None:
# ДОБАВЬТЕ ЭТУ ПРОВЕРКУ
if update.message is None:
logger.warning("Received an update without a message object in start handler.")
return
if not init_qbittorrent_client(): if not init_qbittorrent_client():
await update.message.reply_text( await update.message.reply_text(
"Не удалось подключиться к qBittorrent. Проверьте переменные окружения и доступность сервера." "Не удалось подключиться к qBittorrent. Проверьте переменные окружения и доступность сервера."