https://discord.gg/botpress logo
custom events bug
# 🤝help
e
hello! We are starting with BotPress but encountering a weird error with a simple flow (via Chat API). Any help is appreciated! When receiving a custom event, if flow is in CAPTURE node, custom trigger will be ignored, and captured variable will have this value:
Copy code
Unknown message of type \"chat:custom\" on channel \"unknown\": {\"userId\":\"user_01JWG6BPRHAXJJKT0BC13MXQYM\",\"conversationId\":\"conv_01JWG6RZMN1YXGSS2Y6HFRT4NJ\",\"payload\":{\"event_type\":\"followup\"}}"
It not only does not go to trigger flow, it goes to the next block of the capture https://cdn.discordapp.com/attachments/1377937510893752360/1377938030425538590/image.png?ex=683ac84b&is=683976cb&hm=f980d4e259f550a08b76fb24bbfc5c65ed88b2b5901b5e3b69cdfd1fb0cddd33&
When the custom event is received during CAPTURE I get the error
What am I doing wrong? The Trigger wont work if flow is currently on listen block?
l
https://botpress.com/docs/api-reference/chat-api/introduction I think Chat API needs to have a createUser operation, followed by createConversation operation, followed by which you can send a payload in the following format: { "type": "text", "text": "hello bot" } What you are trying to do should be achieved by Botpress Webhook https://botpress.com/docs/integrations/integration-guides/webhook
i would say add the webhook integration and set the events trigger to webhook, post which send the payload to the webhook endpoint
e
We already do all that, a messages work perfectly. The problem is specifically when receveing a custom event (via API) while on a capture step
It does not goto event trigger and instead dump the json on the capture variable
l
Try webhook, as you are sending a custom payload to the chat API, it may not accept it
e
Thank you so much, it worked! Did not even know that was a thing