Filter Kick emojis, words & Set Character Limit

will remove all emojis and limit the messages to 75 characters ( you can change filters below)

目前為 2023-06-17 提交的版本,檢視 最新版本

// ==UserScript==
// @name         Filter Kick emojis, words & Set Character Limit
// @namespace    no
// @version      0.1
// @description  will remove all emojis and limit the messages to 75 characters ( you can change filters below)
// @author       restrictedword (discord)
// @match        https://kick.com/xqc
// @icon         https://www.google.com/s2/favicons?sz=64&domain=kick.com
// @grant        none
// @license MIT
// ==/UserScript==
(function() {
    'use strict';
    console.log('Chat Optimization script loaded.');
    const settings = {
        characterLimit: 75, // Change the character limit here
        whitelistedEmojis: ['emojiExample', 'emojiOther'], // emoji{name} case sensitive (e.g. emojiAngry)
        blockedWords: ['word1', 'Word1', 'Word 1'] // case sensitive
    };

    function removeElements(e){document.querySelectorAll(e).forEach((e=>{e.remove()}))}function handleChatEntries(){document.querySelectorAll(".mt-0\\.5").forEach((e=>{const t=e.querySelectorAll('[data-emote-name*="emoji"]'),o=e.querySelector(".chat-entry-content"),n=settings.whitelistedEmojis.some((e=>t.length>0&&t[0].getAttribute("data-emote-name").includes(e))),r=settings.blockedWords.some((e=>o&&o.textContent.includes(e)));(t.length>0&&!n||o&&o.textContent.length>settings.characterLimit||r)&&e.remove()}))}function setupObserver(){const e=new MutationObserver((e=>{for(const t of e)"childList"===t.type&&handleChatEntries()})),t=document.querySelector(".chat-container");t?(e.observe(t,{childList:!0,subtree:!0}),console.log("Observer set up.")):console.log("Chat container not found.")}console.log("Waiting for DOM content to load..."),window.onload=()=>{console.log("DOM content loaded."),handleChatEntries(),setupObserver()};
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址