Skip to content

Instantly share code, notes, and snippets.

@dvingerh
Last active March 17, 2017 18:47
Show Gist options
  • Save dvingerh/6f6853f5ec7613a008d2c8d752a4e1fa to your computer and use it in GitHub Desktop.
Save dvingerh/6f6853f5ec7613a008d2c8d752a4e1fa to your computer and use it in GitHub Desktop.
Discord Userscript: Adds functionality to edit messages by doubleclicking them. (Discord Double Click Edit)
// ==UserScript==
// @name Discord Double Click Edit
// @description Adds functionality to edit messages by doubleclicking them
// @namespace Violentmonkey Scripts
// @grant GM_addStyle
// @require http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js
// @match *://discordapp.com/*
//
// ==/UserScript==
$('body').on('dblclick', '.message', function() {
var dropdown = $(this).find('.btn-option');
dropdown.trigger( "click" );
$(".popout .btn-item").parent().css("opacity", 0);
$.each($(".popout .btn-item"), (index, value) => {
var option = $(value);
if(option.text() === "Edit") {
option.click();
}
});
});
//Credit https://github.com/Jiiks/BetterDiscordApp/blob/master/Plugins/dblClickEdit.plugin.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment