diff --git a/src/Socket/chats.ts b/src/Socket/chats.ts index 2932c42..10e11a3 100644 --- a/src/Socket/chats.ts +++ b/src/Socket/chats.ts @@ -168,15 +168,19 @@ export const makeChatsSocket = (config: SocketConfig) => { const onWhatsApp = async(...jids: string[]) => { const query = { tag: 'contact', attrs: {} } - const list = jids.map((jid) => ({ - tag: 'user', - attrs: {}, - content: [{ - tag: 'contact', + const list = jids.map((jid) => ( + const content = (!jid.startsWith('+')) ? `+${jid}` : jid; + + return { + tag: 'user', attrs: {}, - content: jid, - }], - })) + content: [{ + tag: 'contact', + attrs: {}, + content, + }], + } + )) const results = await interactiveQuery(list, query) return results.map(user => {