Skip to content

Instantly share code, notes, and snippets.

@MicahZoltu

MicahZoltu/discord.js

Last active Nov 3, 2020
Embed
What would you like to do?
Reaction Hotkey for various chat clients.
window.addEventListener('keydown', event => {
if (!event.shiftKey || !event.ctrlKey || event.key != '|') return
const container = document.querySelector('[data-list-id=chat-messages] > div:nth-last-of-type(2)')
container.dispatchEvent(new MouseEvent('mousemove', { bubbles: true }));
container.querySelector('div[aria-label="Add Reaction"]').click()
})
window.addEventListener('keydown', event => { if (event.shiftKey && event.ctrlKey && event.key == '|') { document.querySelector('.messages-box > .wrapper > ul > li:last-of-type > .message-actions > .message-actions__buttons > .message-actions__button').click(); document.querySelector('.emoji-picker > .emoji-top > .rc-input > .rc-input__label > .rc-input__wrapper > input.rc-input__element').focus(); document.querySelector('.emoji-picker > .emoji-top > .rc-input > .rc-input__label > .rc-input__wrapper > input.rc-input__element').value = '' } })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment