def get_last_message_id() -> int:
    last_id = Message.objects.aggregate(Max('id'))['id__max']
    if (last_id is None):
        last_id = (- 1)
    return last_id
def get_last_message_id() -> int:
    last_id = Message.objects.aggregate(Max('id'))['id__max']
    if (last_id is None):
        last_id = (- 1)
    return last_id