Discord Global UwU Converter

Detects what you are saying across all Discord channels, servers, and DMs, and automatically uwuifies it!

2026/08/18のページです。最新版はこちら

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

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

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name         Discord Global UwU Converter
// @namespace    http://tampermonkey.net
// @version      0.5
// @description  Detects what you are saying across all Discord channels, servers, and DMs, and automatically uwuifies it!
// @author       You
// @license      MIT
// @match        *://*://*
// @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');
    }

    // 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, channel input, or pop-up text field
        if (target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.getAttribute('contenteditable') === 'true') {
            
            // Standard textboxes (Search bars, status updates, settings)
            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 (Channel chat box, DM text field)
            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 events globally across the page structure
    document.addEventListener('input', handleDetection, true);
})();