cane is happy

replaces the SOY emote with widepeepoHappy for cane's messages only

// ==UserScript==
// @name         cane is happy
// @description  replaces the SOY emote with widepeepoHappy for cane's messages only
// @version      0.10100110100111101011001
// @match        https://www.destiny.gg/*
// @grant        none
// @namespace https://gf.qytechs.cn/users/1494673
// ==/UserScript==

(function () {
    'use strict';

    const targetEmote = 'SOY';
    const replacementEmote = 'widepeepoHappy';

    const observer = new MutationObserver(mutations => {
        mutations.forEach(mutation => {
            mutation.addedNodes.forEach(node => {
                if (!(node instanceof HTMLElement)) return;

                if (node.matches(`div.msg-chat[data-username="cane"]`)) {
                    const emotes = node.querySelectorAll(`.emote.${targetEmote}`);
                    emotes.forEach(emote => {
                        emote.classList.remove(targetEmote);
                        emote.classList.add(replacementEmote);
                        emote.textContent = replacementEmote;
                        emote.setAttribute('title', replacementEmote);
                    });
                }
            });
        });
    });

    observer.observe(document.body, {
        childList: true,
        subtree: true
    });
})();

QingJ © 2025

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