hide underaged users (chat avenue)

removes messages in chat-avenue.com's gay chat that are most likely coming from minors (and wierdos).

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         hide underaged users (chat avenue)
// @namespace    http://tampermonkey.net/
// @version      1.3
// @description  removes messages in chat-avenue.com's gay chat that are most likely coming from minors (and wierdos).
// @author       Dev'd
// @match        gaychat.chat-avenue.com/*
// @license      MIT
// @icon         https://www.google.com/s2/favicons?sz=64&domain=chat-avenue.com
// @grant        none
// ==/UserScript==

// large ty to https://github.com/KinkyDeveloper for ChatAf's code which helped me create this project

const filter = /[^0-9a-z]?1[^0-9a-z]?[0-7]|1[0-7]|i[^0-9a-z]?[0-7]|i[0-7]|\|[0-7]/gims

//var str = "ELLO IM LIKE | 3 PLS BAN ME" // testing regex
//console.log(filter.test(str)); // true

function handleChat() {
    var messages = document.getElementsByClassName('chat_message');

    message_loop:
    for (let message of messages) {
        if (message.getAttribute('handled')) {
            continue;
        }
        message.setAttribute('handled', true); //to stop unessesary checking
        var images = message.getElementsByClassName('chat_image');
        var message_box = message.parentElement.parentElement;
        var content = message.innerHTML.toLowerCase()

        if (images.length == 0){ //means not a image
            if (filter.test(content) == true) {
                message_box.remove()
                console.log("Blocked term found. Deleteing one message. \n" + content)
            }
        }
    }
}

setInterval(handleChat, 450);