7 lines
359 B
Python
7 lines
359 B
Python
def get_telegram_id_by_chat_id(flask_app, chat_id: int) -> str:
|
|
from app.models.users import Users # импорт здесь, чтобы избежать циклических зависимостей
|
|
|
|
with flask_app.app_context():
|
|
user = Users.query.filter_by(chat_id=chat_id).first()
|
|
return user.telegram_id if user else "unknown"
|