LC Game Post Only

Display only the 1st post of a game thread. This completely removes all replies (and more) from the thread.

// ==UserScript==
// @name        LC Game Post Only
// @namespace   1330126-edexal
// @match       http*://lewdcorner.com/threads/*
// @grant       none
// @icon        https://external-content.duckduckgo.com/ip3/lewdcorner.com.ico
// @license     Unlicense
// @version     1.0
// @author      Edexal
// @description Display only the 1st post of a game thread. This completely removes all replies (and more) from the thread.
// ==/UserScript==
(async function(){
  function deleteEls(el){
    if (el instanceof NodeList){
      el.forEach((curVal,curIndex)=>{
        curVal.remove();
      });
    } else if (el instanceof Element) {
      el.remove();
    }else{
      console.error(`Unable to delete ${el}! Element is of type: ${typeof el}.`);
    }

  }

   async function removeFooter(){
    let footer = document.querySelector("#footer");
    await deleteEls(footer);
  }

  async function removeNotices(){
    let notices = document.querySelectorAll(".notices");
    await deleteEls(notices);
  }

  async function removeBreadcrumbs(){
    let breadcrumb = document.querySelector(".p-breadcrumbs--container");
    await deleteEls(breadcrumb);
  }

  async function removeAccount(){
    let accountNav = document.querySelector(".p-navgroup-link--user");
    await deleteEls(accountNav);
  }

  async function showFirstPostOnly() {
    //Original Post Ref
    let op = document.querySelector("article:first-of-type .message-cell--main");
    //Holds all posts and replies in the game thread Ref
    let postsDiv = document.querySelector(".p-body-main");
    postsDiv.replaceWith(op);
  }

  /*Checks if thread is a GAME type*/
  if(!!document.querySelector("[data-field=OS]")){
    await showFirstPostOnly();//
    /*-----------------------(Optional) Delete '//' for each option to activate----------------*/
    //await removeAccount();
    //await removeBreadcrumbs();
    //await removeNotices();
    await removeFooter();
  }

})().catch((err)=> console.error(err));