ozokfan

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

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