def match_id(dis_id):
    """Match a discord id depending on mention or raw ID"""

    # ID is user mention or role mention
    if any(x in dis_id for x in ["<@!", "<@&"]):
        if len(dis_id) == 22:
            return int(dis_id[3:-1])
    # Simple mention
    elif "<@" in dis_id:
        if len(dis_id) == 21:
            return int(dis_id[2:-1])
    # No mention, just ID
    elif dis_id.isdigit():
        if len(dis_id) == 18:
            return int(dis_id)
    else:
        return False