uwuifyer

Adds a button to convert your typed text into uwu style across all Discord locations.

Από την 18/08/2026. Δείτε την τελευταία έκδοση.

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

You will need to install an extension such as Tampermonkey or Violentmonkey 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         uwuifyer
// @namespace    http://tampermonkey.net
// @version      1.5
// @description  Adds a button to convert your typed text into uwu style across all Discord locations.
// @author       You
// @license      MIT
// @match        *://*.://discord.com*
// @match        *://://discord.com*
// @grant        none
// @run-at       document-end
// ==/UserScript==

(function() {
    'use strict';

    // Function to convert regular text to uwu style
    function uwuify(text) {
        return text
            .replace(/[lr]/g, 'w')
            .replace(/[LR]/g, 'W')
            .replace(/n([aeiou])/g, 'ny$1')
            .replace(/N([aeiou])/g, 'Ny$1')
            .replace(/N([AEIOU])/g, 'NY$1')
            .replace(/ove/g, 'uv');
    }

    // Function to inject the button under the active chatbox
    function injectButton() {
        // Find Discord's text container where we can append our button safely
        const targetContainers = document.querySelectorAll('[class*="channelTextArea_"], [class*="inner_"]');
        
        targetContainers.forEach(container => {
            // Prevent duplicating buttons
            if (container.querySelector('.uwuify-btn')) return;

            // Create a custom button styling match for dark/light theme compatibility
            const btn = document.createElement('button');
            btn.className = 'uwuify-btn';
            btn.innerText = '✨ UwUify Text ✨';
            btn.style.cssText = `
                background: #5865F2;
                color: white;
                border: none;
                padding: 4px 10px;
                margin: 4px;
                border-radius: 4px;
                font-family: sans-serif;
                font-size: 11px;
                font-weight: bold;
                cursor: pointer;
                z-index: 9999;
                display: inline-block;
                transition: background 0.2s;
            `;

            btn.onmouseover = () => btn.style.background = '#4752C4';
            btn.onmouseout = () => btn.style.background = '#5865F2';

            // Button click logic
            btn.addEventListener('click', function(e) {
                e.preventDefault();
                e.stopPropagation();

                // Look for the text field inside this container block
                const editor = container.querySelector('[contenteditable="true"]');
                if (editor) {
                    const originalText = editor.innerText || "";
                    const uwuText = uwuify(originalText);

                    if (originalText !== uwuText) {
                        // Locate the core React system handler
                        const reactKey = Object.keys(editor).find(key => key.startsWith('__reactFiber$') || key.startsWith('__reactInternalInstance$'));
                        if (reactKey) {
                            let node = editor[reactKey];
                            while (node) {
                                if (node.memoizedProps && node.memoizedProps.editor) {
                                    // Change the inner data engine safely
                                    const slateEditor = node.memoizedProps.editor;
                                    slateEditor.selectAll();
                                    slateEditor.insertText(uwuText);
                                    break;
                                }
                                node = node.return;
                            }
                        }
                    }
                }
            });

            // Put the button right underneath or inside the message area structure
            container.appendChild(btn);
        });
    }

    // Run the injector continuously to handle swapping between server channels
    const observer = new MutationObserver(injectButton);
    observer.observe(document.body, { childList: true, subtree: true });
    
    // Initial run on load
    setTimeout(injectButton, 2000);
})();