Last active
January 31, 2022 07:42
-
-
Save Far-Se/59b498e57c7c2a816555970feda653f1 to your computer and use it in GitHub Desktop.
Discord edit shortcuts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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