mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
fix: onWhatsApp query for multiple jids (#85)
This commit is contained in:
@@ -167,22 +167,17 @@ export const makeChatsSocket = (config: SocketConfig) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const onWhatsApp = async(...jids: string[]) => {
|
const onWhatsApp = async(...jids: string[]) => {
|
||||||
const results = await interactiveQuery(
|
const query = { tag: 'contact', attrs: {} }
|
||||||
[
|
const list = jids.map((jid) => ({
|
||||||
{
|
tag: 'user',
|
||||||
tag: 'user',
|
attrs: {},
|
||||||
attrs: {},
|
content: [{
|
||||||
content: jids.map(
|
tag: 'contact',
|
||||||
jid => ({
|
attrs: {},
|
||||||
tag: 'contact',
|
content: jid,
|
||||||
attrs: {},
|
}],
|
||||||
content: `+${jid}`
|
}))
|
||||||
})
|
const results = await interactiveQuery(list, query)
|
||||||
)
|
|
||||||
}
|
|
||||||
],
|
|
||||||
{ tag: 'contact', attrs: {} }
|
|
||||||
)
|
|
||||||
|
|
||||||
return results.map(user => {
|
return results.map(user => {
|
||||||
const contact = getBinaryNodeChild(user, 'contact')
|
const contact = getBinaryNodeChild(user, 'contact')
|
||||||
|
|||||||
Reference in New Issue
Block a user