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}}
Monterey Bay Aquarium
🪼

Kiana Khansmith

Love Begins

ellievsbear
ojovivo
cherry valley forever
RMH
Sade Olutola
Aqua Utopia|海の底で記憶を紡ぐ
TVSTRANGERTHINGS

❣ Chile in a Photography ❣

izzy's playlists!
Fai_Ryy

Jar Jar Binks Fan Club


@theartofmadeline

Game of Thrones Daily

PR's Tumblrdome

seen from United States

seen from United Kingdom

seen from Singapore

seen from Malaysia
seen from United States

seen from Malaysia

seen from Australia
seen from Malaysia
seen from Singapore
seen from Italy

seen from Bangladesh
seen from United States

seen from Armenia
seen from Armenia
seen from Armenia
seen from Armenia
seen from Armenia

seen from Australia

seen from Bangladesh

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}}

Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
Free to watch • No registration required • HD streaming
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}}
--------------------