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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user