ozokfan

turns a specific user that does not like ozok into a huge ozok fan by replacing their username and profile picture

Na nainštalovanie skriptu si budete musieť nainštalovať rozšírenie, ako napríklad Tampermonkey, Greasemonkey alebo Violentmonkey.

Na inštaláciu tohto skriptu je potrebné nainštalovať rozšírenie, ako napríklad Tampermonkey.

Na nainštalovanie skriptu si budete musieť nainštalovať rozšírenie, ako napríklad Tampermonkey, % alebo Violentmonkey.

Na nainštalovanie skriptu si budete musieť nainštalovať rozšírenie, ako napríklad Tampermonkey alebo Userscripts.

Na inštaláciu tohto skriptu je potrebné nainštalovať rozšírenie, ako napríklad Tampermonkey.

Na inštaláciu tohto skriptu je potrebné nainštalovať rozšírenie správcu používateľských skriptov.

(Už mám správcu používateľských skriptov, nechajte ma ho nainštalovať!)

Na inštaláciu tohto štýlu je potrebné nainštalovať rozšírenie, ako napríklad Stylus.

Na inštaláciu tohto štýlu je potrebné nainštalovať rozšírenie, ako napríklad Stylus.

Na inštaláciu tohto štýlu je potrebné nainštalovať rozšírenie, ako napríklad Stylus.

Na inštaláciu tohto štýlu je potrebné nainštalovať rozšírenie správcu používateľských štýlov.

Na inštaláciu tohto štýlu je potrebné nainštalovať rozšírenie správcu používateľských štýlov.

Na inštaláciu tohto štýlu je potrebné nainštalovať rozšírenie správcu používateľských štýlov.

(Už mám správcu používateľských štýlov, nechajte ma ho nainštalovať!)

// ==UserScript==
// @name         ozokfan
// @namespace    http://tampermonkey.net/
// @version      1
// @description  turns a specific user that does not like ozok into a huge ozok fan by replacing their username and profile picture
// @license      MIT
// @author       You
// @match        *://discord.com/*
// @run-at       document-start
// @grant        GM_addStyle
// @grant        GM_addElement
// @grant        GM_deleteValue
// @grant        GM_getValue
// @grant        GM_listValues
// @grant        GM_setValue
// @grant        GM_getResourceText
// @grant        GM_getResourceURL
// @grant        GM_registerMenuCommand
// @grant        GM_unregisterMenuCommand
// @grant        GM_notification
// @grant        GM_openInTab
// @grant        GM_setClipboard
// @grant        GM_xmlhttpRequest
// @grant        GM_download
// @grant        GM_log
// @grant        GM_info
// @grant        unsafeWindow
// ==/UserScript==

(function () {
    'use strict';
    const delay = ms => new Promise(resolve => setTimeout(resolve, ms));
    const LOOP_INTERVAL_MS = 5;
    const src = "https://cdn.discordapp.com/avatars/1404082971224576132/592f7a18ca9a0bf993233006a20cc708.webp"
    const juser = "Anti-Ozok"

    async function doWork() {
        let elements = document.querySelectorAll('[src^="' + src + '"]');
        if (!(elements)) {
            return
        }
        elements.forEach((e, i) => {
            e.src = e.src.replace(src, "https://cdn.discordapp.com/avatars/1502128701821812836/10cffb0282b0190bdc54667da6dc4c06.webp")
            if (e.className.includes("clickable")) {
                e.setAttribute("name", "jason")
            }
            if (e.className == "avatar__44b0c") {
                e.setAttribute("name", "jason2")
            }
        });
        elements = document.getElementsByName("jason")
        if (!(elements)) {
            return
        }
        elements.forEach((e, i) => {
            let elm = e.parentElement.children[1]
            if (elm) {
                elm = elm.firstElementChild
                let ozokfan = document.createElement("span");
                ozokfan.className = "username_c19a55 clickable_c19a55"
                ozokfan.setAttribute('aria-expanded', 'false');
                ozokfan.dataset.text = "I ❤️ Ozok"
                ozokfan.role = elm.role
                ozokfan.tabIndex = 0
                ozokfan.innerHTML = 'I <span class="emoji_e5de78">❤️</span> Ozok'
                elm.replaceWith(ozokfan);
            }
        });
        elements = document.getElementsByName("jason2")
        if (!elements) {return}
        elements.forEach((e, i) => {
            if(e.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.getAttribute('aria-label')) {
                if(e.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.getAttribute('aria-label').includes(juser)) {
                e.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.firstElementChild.children[1].firstElementChild.firstElementChild.firstElementChild.innerHTML = "I ❤️ Ozok"}
            }
            else if(e.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.className == "inner_c0bea0") {
                e.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.firstElementChild.children[2].firstElementChild.firstElementChild.firstElementChild.firstElementChild.innerHTML = "I ❤️ Ozok"
                e.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.firstElementChild.children[2].firstElementChild.children[1].children[2].firstElementChild.children[1].innerHTML = "I ❤️ Ozok"
            }
        });
    }
    (async function loop() {
        while (true) {
            try {
                await doWork();
            } catch (e) {
                console.log(e)
            }
            await delay(LOOP_INTERVAL_MS);
        }
    })();
})();