MAJOR FIXES: ✅ Fixed UserBot container startup by making TELEGRAM_BOT_TOKEN optional ✅ Broke circular import chain between app modules ✅ Made Config.validate() conditional for UserBot-only mode ✅ Removed unused celery import from userbot_service.py INTEGRATION: ✅ UserBot menu now accessible from main bot /start command ✅ Added 🤖 UserBot button to main keyboard ✅ Integrated userbot_manager.py handlers: - userbot_menu: Main UserBot interface - userbot_settings: Configuration - userbot_collect_groups: Gather all user groups - userbot_collect_members: Parse group members ✅ UserBot handlers properly registered in ConversationHandler CONTAINERS: ✅ tg_autoposter_bot: Running and handling /start commands ✅ tg_autoposter_userbot: Running as standalone microservice ✅ All dependent services (Redis, PostgreSQL, Celery workers) operational STATUS: Bot is fully operational and ready for testing
28 lines
769 B
Python
28 lines
769 B
Python
"""
|
|
Точка входа для запуска приложения как модуля Python
|
|
"""
|
|
|
|
import asyncio
|
|
import logging
|
|
import sys
|
|
from app import main
|
|
|
|
if __name__ == "__main__":
|
|
logging.basicConfig(level=logging.INFO)
|
|
|
|
try:
|
|
# Используем nest_asyncio для избежания конфликтов event loop
|
|
try:
|
|
import nest_asyncio
|
|
nest_asyncio.apply()
|
|
except ImportError:
|
|
pass
|
|
|
|
asyncio.run(main())
|
|
except KeyboardInterrupt:
|
|
logging.info("Бот остановлен пользователем")
|
|
sys.exit(0)
|
|
except Exception as e:
|
|
logging.error(f"Критическая ошибка: {e}", exc_info=True)
|
|
sys.exit(1)
|