Don't delete our reaction on Discord unless we have 0 of that reaction coming from Matrix #85
1 changed files with 0 additions and 1 deletions
|
|
@ -384,7 +384,6 @@ module.exports = {
|
||||||
*/
|
*/
|
||||||
async onSomeReactionsRemoved(client, data) {
|
async onSomeReactionsRemoved(client, data) {
|
||||||
// Don't attempt to double-bridge our own deleted reactions, this would go badly if there are race conditions
|
// Don't attempt to double-bridge our own deleted reactions, this would go badly if there are race conditions
|
||||||
if ("emoji" in data && !data.emoji.name) console.error(":(", data)
|
|
||||||
if ("user_id" in data && data.user_id === botID && data.emoji.name) { // sure hope data.emoji.name exists here
|
if ("user_id" in data && data.user_id === botID && data.emoji.name) { // sure hope data.emoji.name exists here
|
||||||
const encodedEmoji = encodeURIComponent(data.emoji.id ? `${data.emoji.name}:${data.emoji.id}` : data.emoji.name)
|
const encodedEmoji = encodeURIComponent(data.emoji.id ? `${data.emoji.name}:${data.emoji.id}` : data.emoji.name)
|
||||||
const i = redact.ourDeletedReactions.findIndex(x => data.message_id === x.message_id && encodedEmoji === x.encoded_emoji)
|
const i = redact.ourDeletedReactions.findIndex(x => data.message_id === x.message_id && encodedEmoji === x.encoded_emoji)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue