mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
feat: add reaction update to the store
This commit is contained in:
@@ -6,7 +6,7 @@ import { DEFAULT_CONNECTION_CONFIG } from '../Defaults'
|
||||
import type makeLegacySocket from '../LegacySocket'
|
||||
import type makeMDSocket from '../Socket'
|
||||
import type { BaileysEventEmitter, Chat, ConnectionState, Contact, GroupMetadata, PresenceData, WAMessage, WAMessageCursor, WAMessageKey } from '../Types'
|
||||
import { toNumber, updateMessageWithReceipt } from '../Utils'
|
||||
import { toNumber, updateMessageWithReaction, updateMessageWithReceipt } from '../Utils'
|
||||
import { jidNormalizedUser } from '../WABinary'
|
||||
import makeOrderedDictionary from './make-ordered-dictionary'
|
||||
|
||||
@@ -230,6 +230,16 @@ export default (
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
ev.on('messages.reaction', (reactions) => {
|
||||
for(const { key, reaction } of reactions) {
|
||||
const obj = messages[key.remoteJid!]
|
||||
const msg = obj?.get(key.id!)
|
||||
if(msg) {
|
||||
updateMessageWithReaction(msg, reaction)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const toJSON = () => ({
|
||||
@@ -379,4 +389,4 @@ export default (
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user