Closed kevin-guerrero808 closed 3 months ago
Hi @kevin-guerrero808 you can get the labels id with client.getAllLabels()
And pass the id for function that way:
I will fix the docs
{
"chatIds": [
"5521[number_replace]@c.us"
],
"options": [
{
"labelId": "20",
"type": "add"
},
{
"labelId": "17",
"type": "remove"
}
]
}
Hello @icleitoncosta! I found that I can use client.addOrRemoveLabels with two array arguments, [<chatNumber>]
and [{labelId: <id>, type: <add|remove>]
and it works, althouth I set ts-ignore becuase the typescript definition expect two strings as arguments.
// @ts-ignore
client.addOrRemoveLabels([`${message.from}`],[{labelId:'12', type:'add'}]);
I hope that you update the typescript definition and documentation parameters
Thanks!
Description
The function addOrRemoveLabels of Whatsapp is no working that is to say it don't add labels to chats in whatsapp and don't say anything in the response.
Other important thing is that the documentation say it receives two params chatIds and options as strings but the example display that it need to arrays
Documentation from wwppconnect.io:
addOrRemoveLabels
addOrRemoveLabels(chatIds, options): Promise<void>
Add or delete label of chatId
Parameters
chatIds: string ChatIds
options: string options to remove or add
Returns Promise
Example
Environment
My code example
The response generated is empty
Expected result
The function must say the correct params and types and the result is to see the labels applied to the chats