def _fix_peer_id(peer_id):
    """
    Fixes the peer ID for chats and channels, in case the users
    mix marking the ID with the :tl:`Peer` constructors.
    """
    peer_id = abs(peer_id)
    if str(peer_id).startswith('100'):
        peer_id = str(peer_id)[3:]
    return int(peer_id)
