示例#1
0
def chat_create_new(telegram_chat_id: int, session=None) -> Chat:
    """
    Создает новый чат

    :param telegram_chat_id: Идентификатор чата в телеграме
    :param session: Сессия БД
    :return: Созданный чат
    """
    chat = Chat()
    chat.telegram_chat_id = telegram_chat_id
    session.add(chat)
    session.flush()
    return chat