uwuifyer

Instantly swaps letters as you press them into uwu style on Discord!

Versión del día 18/08/2026. Echa un vistazo a la versión más reciente.

Tendrás que instalar una extensión para tu navegador como Tampermonkey, Greasemonkey o Violentmonkey si quieres utilizar este script.

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

Tendrás que instalar una extensión como Tampermonkey o Violentmonkey para instalar este script.

Necesitarás instalar una extensión como Tampermonkey o Userscripts para instalar este script.

Tendrás que instalar una extensión como Tampermonkey antes de poder instalar este script.

Necesitarás instalar una extensión para administrar scripts de usuario si quieres instalar este script.

(Ya tengo un administrador de scripts de usuario, déjame instalarlo)

Tendrás que instalar una extensión como Stylus antes de poder instalar este script.

Tendrás que instalar una extensión como Stylus antes de poder instalar este script.

Tendrás que instalar una extensión como Stylus antes de poder instalar este script.

Para poder instalar esto tendrás que instalar primero una extensión de estilos de usuario.

Para poder instalar esto tendrás que instalar primero una extensión de estilos de usuario.

Para poder instalar esto tendrás que instalar primero una extensión de estilos de usuario.

(Ya tengo un administrador de estilos de usuario, déjame instalarlo)

// ==UserScript==
// @name         uwuifyer
// @namespace    http://tampermonkey.net
// @version      1.2
// @description  Instantly swaps letters as you press them into uwu style on Discord!
// @author       You
// @license      MIT
// @match        https://*://
// @match        https://*://*
// @match        https://*://
// @match        https://discord.com*
// @grant        none
// @run-at       document-end
// ==/UserScript==

(function() {
    'use strict';

    // Quick single-character layout mapping
    function getUwUKey(key) {
        if (key === 'l' || key === 'r') return 'w';
        if (key === 'L' || key === 'R') return 'W';
        return null;
    }

    // Intercept keyboard hits immediately
    document.addEventListener('keydown', function(event) {
        const target = event.target;
        if (!target) return;

        // Only look at typing inputs
        if (target.getAttribute('contenteditable') === 'true' || target.tagName === 'INPUT' || target.tagName === 'TEXTAREA') {
            
            // Check if the pressed key needs to be uwuified
            const replacementKey = getUwUKey(event.key);
            
            if (replacementKey) {
                // Stop the real 'l' or 'r' from ever reaching Discord's input engine
                event.preventDefault();
                event.stopImmediatePropagation();

                // 1. Handle Discord's main Rich Text Chatbox
                if (target.getAttribute('contenteditable') === 'true') {
                    const reactKey = Object.keys(target).find(k => k.startsWith('__reactFiber$') || k.startsWith('__reactInternalInstance$'));
                    if (!reactKey) return;

                    try {
                        let node = target[reactKey];
                        while (node) {
                            if (node.memoizedProps && node.memoizedProps.editor) {
                                // Direct injection into Discord's internal text stream
                                node.memoizedProps.editor.insertText(replacementKey);
                                break;
                            }
                            node = node.return;
                        }
                    } catch (e) {
                        console.error("Keystroke override failed:", e);
                    }
                } 
                // 2. Handle standard plain inputs (Search bars, settings)
                else if (target.value !== undefined) {
                    const start = target.selectionStart;
                    const end = target.selectionEnd;
                    const val = target.value;
                    
                    // Insert 'w' or 'W' right where the cursor is flashing
                    target.value = val.slice(0, start) + replacementKey + val.slice(end);
                    target.setSelectionRange(start + 1, start + 1);
                    
                    // Tell the website something was typed
                    target.dispatchEvent(new Event('input', { bubbles: true }));
                }
            }
        }
    }, true); // Crucial: 'true' catches the finger press before Discord handles it
})();