Discord ENTER

Simulates pressing Enter in Discord's text input with a shiny button.

Αυτός ο κώδικας δεν πρέπει να εγκατασταθεί άμεσα. Είναι μια βιβλιοθήκη για άλλους κώδικες που περιλαμβάνεται μέσω της οδηγίας meta // @require https://update.greasyfork.org/scripts/554707/1689056/Discord%20ENTER.js

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

You will need to install an extension such as Tampermonkey 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         Discord ENTER
// @namespace    https://example.com/discord-enter
// @version      2.4
// @description  Adds a badass button to Discord that simulates pressing Enter in the chat input.
// @author       Justn
// @match        https://discord.com/*
// @grant        none
// @locale       en
// @license      MIT
// @icon         https://discord.com/assets/favicon.ico
// ==/UserScript==

(() => {
  const btn = Object.assign(document.createElement('button'), {
    textContent: 'E',
    id: 'nuke-enter',
    onclick: () => {
      const box = document.querySelector('[data-slate-editor="true"]') ||
                  document.querySelector('div[role="textbox"]') ||
                  document.querySelector('textarea');
      if (!box) return console.log('no box');

      box.focus();
      ['keydown', 'keypress', 'keyup'].forEach(type => {
        box.dispatchEvent(new KeyboardEvent(type, {
          key: 'Enter',
          code: 'Enter',
          keyCode: 13,
          which: 13,
          bubbles: true,
          cancelable: true
        }));
      });
      console.log('NUKED');
    },
    style: `
      position:fixed; bottom:25px; right:20px; z-index:999999;
      padding:8px 10px; background:#5865F2; color:white;
      border:none; border-radius:4px; font-weight:bold; cursor:pointer;
      font-size:14px; line-height:14px;
    `
  });
  document.body.appendChild(btn);
  console.log('E NUKE armed');
})();