Skip to content

Instantly share code, notes, and snippets.

@Far-Se
Last active January 31, 2022 07:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Far-Se/59b498e57c7c2a816555970feda653f1 to your computer and use it in GitHub Desktop.
Save Far-Se/59b498e57c7c2a816555970feda653f1 to your computer and use it in GitHub Desktop.
Discord edit shortcuts
// ==UserScript==
// @name Discord Shortcuts
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://discord.com/*
// @icon https://icons.duckduckgo.com/ip2/discord.com.ico
// @grant none
// ==/UserScript==
document.onkeyup=function (ex) {
var e = ex || window.event;
const keys = {87: "Edit", 82: "Reply", 81: "Delete" } // Alt + (w, r, shift + q )
if(e.altKey){
if(keys[e.keyCode])
{
e.preventDefault();
let el = document.querySelector('[id^="chat-messages"]:hover').querySelector(`[aria-label="${keys[e.keyCode]}"]`);
el.click();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment