Discord UwU Converter

Detects what you are saying on Discord and automatically uwuifies it!

As of 2026-08-18. See the latest version.

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

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

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

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

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

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

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.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         Discord UwU Converter
// @namespace    http://tampermonkey.net
// @version      0.4
// @description  Detects what you are saying on Discord and automatically uwuifies it!
// @author       You
// @license      MIT
// @match        https://*://*
// @match        https://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');
    }

    // Helper to find and update text nodes inside Discord's editor
    function processNode(node) {
        if (node.nodeType === Node.TEXT_NODE) {
            const original = node.textContent;
            const converted = uwuify(original);
            if (original !== converted) {
                node.textContent = converted;
            }
        } else {
            for (let child of node.childNodes) {
                processNode(child);
            }
        }
    }

    // Main detection logic
    function handleDetection(event) {
        const target = event.target;
        
        // Find if we are typing inside a chatbox or input field
        if (target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.getAttribute('contenteditable') === 'true') {
            
            // Standard textboxes
            if (target.value !== undefined) {
                const start = target.selectionStart;
                const end = target.selectionEnd;
                const original = target.value;
                const converted = uwuify(original);
                
                if (original !== converted) {
                    target.value = converted;
                    target.setSelectionRange(start, end);
                }
            } 
            // Discord's rich text editor elements
            else {
                if (target.dataset.isUwUing) return;
                target.dataset.isUwUing = 'true';

                // Save cursor state
                const selection = window.getSelection();
                let savedRange = null;
                if (selection.rangeCount > 0) {
                    savedRange = selection.getRangeAt(0).cloneRange();
                }

                // Convert text elements
                processNode(target);

                // Restore cursor state
                if (savedRange && selection) {
                    try {
                        selection.removeAllRanges();
                        selection.addRange(savedRange);
                    } catch (e) {
                        // Fallback if structure changes slightly
                    }
                }

                delete target.dataset.isUwUing;
            }
        }
    }

    // Capture input event right after you type a word or sentence
    document.addEventListener('input', handleDetection, true);
})();