https://discord.gg/botpress logo
Detect human takeover from WhatsApp Business app?
# 🤝help
m
Hi everyone! I’m using Botpress with the native WhatsApp Business integration provided by Botpress. I need to detect when a human agent manually replies to the customer directly from the WhatsApp Business app, so I can automatically pause or stop the bot for that conversation. The problem is that Botpress does not seem to detect the manual intervention. I cannot find any event, variable, webhook, or message metadata that tells me the outgoing message was sent manually from WhatsApp Business instead of being sent by the Botpress bot. Has anyone implemented this successfully? Specifically, I would like to know: 1. Is there an event in Botpress that detects messages sent manually from the WhatsApp Business app? 2. Can the native WhatsApp integration distinguish between bot messages and human agent messages? 3. Is there any message metadata, webhook payload, or conversation field I can use? 4. What is the recommended way to pause the bot after a manual intervention and reactivate it later? To clarify, I am not using a third-party inbox or custom WhatsApp integration. I am using the native Botpress connection with the WhatsApp Business app. Any example, workaround, or documentation would be very helpful. Thanks!
p
Hi there! This is a very common challenge when using the native WhatsApp integration. Here is the technical breakdown of why this happens and how you can solve it.The Root CauseThe problem isn't actually with Botpress it’s a limitation of the Meta WhatsApp Cloud API. When you send a message manually from the WhatsApp Business App or WhatsApp Web, Meta does not trigger a webhook notification to your API endpoint. Because Botpress relies on these webhooks to "see" what is happening, it remains completely unaware that a manual message was ever sent.
Answers to your specific questions: 1.Is there an event in Botpress for manual messages? No. Since Meta doesn't send the data, Botpress cannot trigger an event. 2.Can the integration distinguish between bot and human messages? No, because it only sees messages that flow through the API. Manual app replies bypass the API entirely. 3.Is there any usable metadata or webhook payload? Not for the manual message itself. However, if the customer replies to your manual message, you can check the event.tags.message['whatsapp:replyTo'] tag. If the ID in that tag doesn't match any message the bot has sent, you can infer a human intervened.4.What is the recommended way to pause the bot? Since you can't detect the intervention automatically from the app, you have three main options: I will send the possible ways you can work around it in your DM
m
thanks Mathy!!!
l
DM me - we have a solution (paid) if you are interested that solves your problem
8 Views