Refactor module imports to ensure project root is included in sys.path for both run_helper and voice_bot. Enhance database user insertion with backward compatibility for emoji column. Update user info handling to check username and full name more robustly. Improve emoji handling with fallback options for environments lacking the emoji package.

This commit is contained in:
2025-08-26 18:56:47 +03:00
parent 70d6ad9a6e
commit 8bb098764d
5 changed files with 53 additions and 13 deletions

View File

@@ -1,3 +1,12 @@
import os
import sys
# Ensure project root is on sys.path for module resolution when running voice bot directly
CURRENT_DIR = os.path.dirname(os.path.abspath(__file__))
PROJECT_ROOT = os.path.dirname(CURRENT_DIR)
if PROJECT_ROOT not in sys.path:
sys.path.insert(0, PROJECT_ROOT)
from aiogram import Bot, Dispatcher
from aiogram.client.default import DefaultBotProperties
from aiogram.fsm.storage.memory import MemoryStorage