Farcrada / DiscordPlugins

This repo holds all the plugins I made for Discord.
GNU Affero General Public License v3.0
114 stars 64 forks source link

[MessageUtilities] Same keybind for multiple actions #137

Closed DmitryOlenin closed 1 year ago

DmitryOlenin commented 1 year ago

Is your request related to a problem? Please describe.

I need to EDIT and REPLY using DBLCLICK. I can write this in settings, but it wouldn't work.

I made dumb edit to fix this, but I think it must be fixed beautiful way... if (message.author.id != BDFDB.UserUtils.me.id && priorityAction == "Edit_Message") priorityAction = "Reply_to_Message"

onClick (event, message) {
...
                if (!firedEvents.includes(type)) {
...
                        if (this.checkIfBindingIsValid(binding, clickType) && (!enabledBindings[priorityAction] || binding.click > priorityBinding.click || binding.keycombo.length > priorityBinding.keycombo.length)) priorityAction = action;

                        if (message.author.id != BDFDB.UserUtils.me.id && priorityAction == "Edit_Message") priorityAction = "Reply_to_Message"
}
}

Describe the solution you'd like

Check applicable type of event BEFORE set priorityAction. It can be used for satisfaction of my request.

Describe alternatives you've considered

No response

Additional context

No response

Farcrada commented 1 year ago

Wrong repo, please see: https://github.com/mwittrien/BetterDiscordAddons/tree/master/Plugins/MessageUtilities