WhatsApp: Reply buttons must have unique titles
# 🤝help
s
I have a WhatsApp integration that is working, and the flow goes nicely until we hit a step that asks for a multiple choice input, at which point WhatsApp API responds with this:
Copy code
[whatsapp] Failed to generate messages for sending to Whatsapp. Reason: Error: Reply buttons must have unique titles
    at new ActionButtons (/var/task/customer_code.js:232:49938)
    at generateOutgoingMessages (/var/task/customer_code.js:232:61289)
    at Xz.next (<anonymous>)
    at sendMany (/var/task/customer_code.js:232:62872)
    at choice (/var/task/customer_code.js:232:64826)
    at Ue (/var/task/customer_code.js:206:76994)
    at /var/task/customer_code.js:206:75396
    at /var/task/index.js:20:13708
    at AsyncLocalStorage.run (node:async_hooks:338:14)
    at handleHTTPEvent (/var/task/index.js:20:13687)
I checked the obvious, and the buttons do have unique titles. I tried switching from a multiple choice input type to single choice, because I think we used multiple choice by mistake. However, the Studio UI still indicates multiple choice in the workflow. Clicking on the card shows the type to extract set to "Single Choice". Any ideas?
I've ruled out the single vs multiple choice. The message that was single choice that was working previously is now failing. I would love to be able to see the call that Botpress is making to the WhatsApp webhook. Is that possible?
Figured it out. Looking at the code in the WhatsApp integration, we can see that there is a hardcoded limit [1] that will truncate the label if it is longer than 20 characters. If you happen to have two buttons that go longer than 20 characters but share the same first 20, say:
Copy code
Will complete testing in 2024
Will complete testing in 2025
Gets truncated to:
Copy code
Will complete testi
Will complete testi
And when this gets sent to WhatsApp, it throws an error because the two labels are now the same, which is not allowed. Some documentation on this limitation would be useful on the WhatsApp integration page, or a counter/warning in the UI where you enter labels when the WhatsApp integration is activated. [1] https://github.com/botpress/botpress/blob/a5b98964c81cedec99cc0522ec4d848a63ca3378/integrations/whatsapp/src/message-types/choice.ts#L13
2 Views