discord 自動點表情符號by ㄐㄐ人

會自己點表情符號 修正超級反應

// ==UserScript==
// @name         discord 自動點表情符號by ㄐㄐ人
// @namespace    http://tampermonkey.net/
// @version      1.0.4
// @description  會自己點表情符號 修正超級反應
// @author       ㄐㄐ人
// @match        *://*.discord.com/channels/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=discord.com
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    function autoClick() {
        // 尋找所有反應按鈕
        const reactions = document.querySelectorAll('[class*="reaction"]');

        for (const reaction of reactions) {
            // 檢查是否未被點擊且不是超級反應
            if (
                reaction.getAttribute('aria-pressed') === 'false' &&
                !reaction.getAttribute('aria-label')?.includes('超級反應')
            ) {
                reaction.click();
                console.log("已點擊反應");
                break;
            }
        }
    }

    setInterval(autoClick, 1000);
})();