Closed JonazBR closed 2 years ago
?
He want to apply something like in WA Business. He wants to send message to the user automatically with the bot when they send their first message
We have a message that comes when you first exchange your PK's:
But you shouldn't rely on anything waweb based to do this, so make something to check this outside waweb ( like a db )
He want to apply something like in WA Business. He wants to send message to the user automatically with the bot when they send their first message
he can just fetchMessages, limit 2, and if he gets one then it's the 1st message
something like this:
const chat = await msg.getChat();
const messages = await chat.fetchMessages({limit: 2});
if (messages.length == 1) msg.reply("this was the 1st message in the chat!");
He want to apply something like in WA Business. He wants to send message to the user automatically with the bot when they send their first message
yes
He want to apply something like in WA Business. He wants to send message to the user automatically with the bot when they send their first message
he can just fetchMessages, limit 2, and if he gets one then it's the 1st message
something like this:
const chat = await msg.getChat(); const messages = await chat.fetchMessages({limit: 2}); if (messages.length == 1) msg.reply("this was the 1st message in the chat!");
@Jonas33235 try this.
shows when one is the first message from a user with the bot