foreign-sapphire
foreign-sapphire3mo ago

Telegram and Voiceflow act differently

I have connected my voiceflow chatbot to Convocore and from there to Telegram bot. The problem is that the voiceflow prototype works fine, outputs correctly and pulls info correctly, but in TG the chatbot just kinda breaks, and outputs wrong things. In both of the attached images I chose "9" table and yet on TG it returned the wrong result and the voiceflow prototype did the correct thing. EVEN though I double checked that the published versions were the same(in the last version changed the button text) Anyone know why this happened?
No description
No description
2 Replies
Tico | Voiceflow Assistant
Hey! The behaviour you’re seeing is almost always caused by the Button / Choice traces not being handled in the Telegram integration code. • In the Voiceflow Prototype the Test Tool understands the choice trace that’s returned by a Button step, shows you the list, and—when you click a button—sends the exact request.type (a path-id) back to Voiceflow.
• In your Convocore→Telegram bridge it looks like the bot is only forwarding the user’s raw text ("9") as a normal text request. Because no real button was “pressed”, Voiceflow treats “9” like any other utterance, runs it through NLU, and ends up on the wrong path. How to fix 1. In the code that receives Voiceflow’s response, watch for traces with type: "choice". This payload contains an array buttons – each button has a name and a request.type (e.g. path-abc123). 2. Present those buttons to the Telegram user (or map them to 1,2,3…). 3. When the user selects a button / number send back the button’s request object, not a plain text message:
{
"request": { "type": "path-abc123", "payload": { "label": "Table 9" } }
}
{
"request": { "type": "path-abc123", "payload": { "label": "Table 9" } }
}
4. If you prefer letting users type numbers, convert the number they sent to the corresponding button’s request before calling the /interact endpoint. There’s a full example of this pattern in the Telegram sample project and in the “Handling Button / choice traces” section of the docs:
https://developer.voiceflow.com/reference/trace-types#type-choice Once your bridge sends the correct path-id instead of plain text, Telegram and the Prototype will behave identically and the “Table 9” branch will be hit every time. Hope that clears it up – let me know if you need a code snippet for mapping the numeric replies!
Steve B. | IntelleSync.ai
I think this a question for convocore/tixea... if your prototype is working fine then it's not a voiceflow issue.

Did you find this page helpful?