Hello! Thanks for the hard work into making Whaticket - Ticket System Client for Whatsapp!
I got a issue... i hope its not only me, if it is then sorry.
But, when using the Whaticket Backend with Whatsapp-Web.js auto responder functions like:
else if (msg.body == '!ping') {
// Send a new message to the same chat
wbot.sendMessage(msg.from, 'pong');
The last message doesn't get update on the Frontend Client when the message was sent by the bot in that auto respond function above,
the last message only updates if the last message was sent by the team/support agent (typed message).
So if the bot send like 3 auto messages, the last message shown on the Frontend Client its the message before those 3 messages that the bot sent, and not really the last message.
That also happens with any android auto responder whatsapp, just install an auto responder app for whatsapp on the phone and set your bot to reply to your customer, when the bot replies the customer, the team/support agent won't see the message that the bot has sent.
Example:
John Doe send message: " Hi "
Bot (whatsapp-web.js library) reply message: " Hey, how you doing "
Bot (any android app auto responder for whatsapp) reply message: " Hey, how you doing "
Last message shown on the Frontend to the team/support agent = " Hi ". (while it should be " Hey, how you doing ")
My code:
wbot.on("message", async msg => {
// console.log(msg);
if (msg.from === "status@broadcast" || msg.type === "location") {
return;
}
else if (msg.body == '!ping') {
// Send a new message to the same chat
wbot.sendMessage(msg.from, 'pong');
}