Kick Auto Reject Raid

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

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

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

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

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.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==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);
})();