Describe the bug
I'm trying to respond to specific people (an array called TARGET_PEOPLE) in a group with my bot. Basically, I have their PNs in 123456...@s.whatsapp.net format, but since WhatsApp only returns each user's LID, I need to get each user's PN using their LID so that I can compare each PN to my array. In order not to always depend on the 'lid-mapping.update' event, I created a lidMapper method for my database, which basically:
- Gets a user's PN using their LID after a
messages.upsert event, so that my bot doesn't query the WhatsApp servers;
- In case the database is empty, after the
lid-mapping.update event fires, it saves the user's LID and PN in the database for future queries.
The problem is, lid-mapping.update never fires and I can't figure out how I can manually force the WP servers to fire this event either. I tried asking the Discord bot (since the docs aren't even complete/barely understandable), and it suggested using the onWhatsApp method, but it never returns the LID of a user, so I don't know what to do.
To Reproduce
Steps to reproduce the behavior:
- Create a new connection
- Listen for the
lid-mapping.update event
- Inside the callback of this function, iterate through
update.mapping and save each LID with the PN
Expected behavior
I am expecting this event to fire and thus save all LID -> PN mappings to my database, but it never happens.
Environment (please complete the following information):
- Is this on a server?
- No, I am running the code locally
- What do your
connectOptions look like?
- N/A
- Do you have multiple clients on the same IP?
- N/A
- Are you using a proxy?
- No
Additional context
Baileys version: "@whiskeysockets/baileys": "^7.0.0-rc.9"
Describe the bug
I'm trying to respond to specific people (an array called TARGET_PEOPLE) in a group with my bot. Basically, I have their PNs in 123456...@s.whatsapp.net format, but since WhatsApp only returns each user's LID, I need to get each user's PN using their LID so that I can compare each PN to my array. In order not to always depend on the 'lid-mapping.update' event, I created a
lidMappermethod for my database, which basically:messages.upsertevent, so that my bot doesn't query the WhatsApp servers;lid-mapping.updateevent fires, it saves the user's LID and PN in the database for future queries.The problem is,
lid-mapping.updatenever fires and I can't figure out how I can manually force the WP servers to fire this event either. I tried asking the Discord bot (since the docs aren't even complete/barely understandable), and it suggested using the onWhatsApp method, but it never returns the LID of a user, so I don't know what to do.To Reproduce
Steps to reproduce the behavior:
lid-mapping.updateeventupdate.mappingand save each LID with the PNExpected behavior
I am expecting this event to fire and thus save all LID -> PN mappings to my database, but it never happens.
Environment (please complete the following information):
connectOptionslook like?Additional context
Baileys version: "@whiskeysockets/baileys": "^7.0.0-rc.9"