Kick Auto Reject Raid

Automatically reject incoming raids on Kick.com レイドを自動的に拒否します

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

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

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         Kick Auto Reject Raid
// @namespace    kick-auto-reject
// @version      1.0
// @description  Automatically reject incoming raids on Kick.com レイドを自動的に拒否します
// @match        https://kick.com/*
// @grant        none
// @license      MIT
// ==/UserScript==

(function () {
    'use strict';

    function rejectRaid() {
        // ボタン候補を広めに探索(UI変更対策)
        const buttons = Array.from(document.querySelectorAll('button'));

        for (const btn of buttons) {
            const text = btn.innerText?.toLowerCase();

            if (!text) continue;

            // 「reject」「decline」などを検知
            if (
                text.includes('拒否') ||
                text.includes('decline') ||
                text.includes('reject')
            ) {
                console.log('[Kick Auto Reject] Raid rejected');
                btn.click();
                return;
            }
        }
    }

    // モーダル出現を検知するための監視
    const observer = new MutationObserver(() => {
        rejectRaid();
    });

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

    // 念のため定期チェック
    setInterval(rejectRaid, 2000);
})();