Accessing what the user just wrote
To access the text that the user wrote into a node (On Receive), you can user: {{event.payload.text}}
we're not kids anymore.

ellievsbear
Game of Thrones Daily
Not today Justin
The Bowery Presents
Show & Tell

★
No title available
taylor price
cherry valley forever

No title available

Love Begins

shark vs the universe
Sweet Seals For You, Always

if i look back, i am lost
NASA
d e v o n

No title available
art blog(derogatory)
Jules of Nature

seen from United Kingdom

seen from United States

seen from Russia

seen from United States
seen from Bangladesh
seen from China

seen from Brazil
seen from Brazil

seen from Brazil
seen from Brazil

seen from Brazil

seen from Türkiye

seen from Brazil

seen from United States

seen from United States

seen from United States
seen from United States
seen from United States

seen from United States
seen from United States
@botpress
Accessing what the user just wrote
To access the text that the user wrote into a node (On Receive), you can user: {{event.payload.text}}
Starting chat bot with a greeting message
When testing the botpress chat bots, the bots wait for user input before entering the start/entry node, meaning that the user has the first turn. In Botpress parlance, the behaviour of making the bot take the first turn is called "proactive trigger".
The JavaScript code for triggering the start node automatically is available in the documentation under section "Send Message When the Webchat is Loaded"
---
Detect if a question matches Q&A or not
Botpress has a built-in natural language understanding module that supports intent detection. It also includes a Q&A module, allowing you to match possible questions with predefined answers.
But how to detect if the user's utterance should be handled by the Q&A module or by the normal flow?
Two code snippets:
In the transition of the node that waits for user input, check if the recognized intent starts with "__qna__": event.nlu.intent.name.startsWith('__qna__')
You can access by suggested answer by creating a custom action that sets a memory value, e.g.: temp.qna_answer = event.suggestions[0].payloads[0].text
Get JSON result of API call
Botpress provides a built-in skill to call an API but the official documentation doesn't say how to use the response the API provides.
TL;DR: {{temp.response.body.res}}
--------------------