Closed bauti-defi closed 2 years ago
Thanks for the comprehensive breakdown.
One last thing I would need from you is to log the id being sent to sendSeen
and the value of the command itself
So, in your wrapper class change it to this:
async sendSeen(): Promise<boolean> {
const res = await this.client.sendSeen(this.previousMessage.from);
console.log("SendSeen result: ", res, " ID: ", this.previousMessage.from);
return res
}
sendSeen will return false
if either the ID is missing [if (!id) return false;
] or the chat related to the ID is undefined
@Bautista-Baiocchi-lora please provide the logs with the updates i suggested
Thanks for the comprehensive breakdown.
One last thing I would need from you is to log the id being sent to
sendSeen
and the value of the command itselfSo, in your wrapper class change it to this:
async sendSeen(): Promise<boolean> { const res = await this.client.sendSeen(this.previousMessage.from); console.log("SendSeen result: ", res, " ID: ", this.previousMessage.from); return res }
sendSeen will return
false
if either the ID is missing [if (!id) return false;
] or the chat related to the ID is undefined
Hello, sorry for not getting back to you sooner. I no longer have the code to reproduce this issue, its been heavily refactored. But I do recall doing exactly what you suggested before creating this formal bug report. The print out was correct. That is to say, it printed out the expected this.previousMessage.from
. That is when I concluded that It must be a library bug.
Ok if it's not reproducible I will close this for now then.
Thanks
Are you using the latest version of the library?
Current Behavior
Calling
client.sendSeen(chatId)
sometimes works and sometimes doesn't. There is no error thrown or stacktrace to follow.Expected Behavior
Calling
client.sendSeen(chatId)
should mark a chat as read. If there were any unread messages, those should marked as read. Calling the method on a chat with 5 unread messages should set it to 0 unread messages (make the badge disappear)Steps To Reproduce
client.sendSeen()
has no affect in the following code snippet. This is executed instart
function passed tocreate.then(start)
client.sendSeen()
works as expected in the following code snippet. This is executed instart
function passed tocreate.then(start)
Here is the
bot.process
function.And this is the
client.sendSeen()
function inside my WhatsApp client wrapper class I use.Mode
My own code
create() code
DEBUG INFO
Environment
Screenshots
No response
Anything else?
No response