Setup
- Basic configuration
- Manual configuration
- Playground
You will need:
- In Botpress Studio, select Explore Hub in the upper-right corner.
- Search for the Messenger integration, then select Install Integration.
- In the Configuration menu, select Authorize Messenger.
- Follow the instructions to connect Botpress to your Messenger account.
Options
The Messenger integration’s Configuration menu offers a few additional options:Get user profile
When this option is enabled (default), the integration will update the Botpress user’s name and picture URL with data from Messenger.This option is only available with manual configuration.
Download media
When enabled, this option automatically downloads media files using the Files API. When disabled, media files are displayed using their Messenger media URL.Downloaded media expiry
Expiry time (in hours) for downloaded media files. An expiry time of 0 means the files will never expire. Defaults to 24 hours.Replying to comments in DM
You can configure your bot to reply to user comments in a direct message (DM).Step 1: Check where the conversation started
First, add a router Node that checks whether the conversation originated from a user’s comment.1
In Botpress Studio, enter your Main Workflow.
2
Add a new Node to the Workflow.
3
Rename the Node to 
Router, then move it between the Start Node and any other existing Nodes:
4
Add two Expression Cards to the
Router Node.5
Open the second Expression Card’s inspector. Next to the Condition field, toggle to disable generative AI.
6
Configure this Card for conversations started normally:
- In the Label field, paste in:
Conversation started - In the Condition field, paste in:
{{event.channel == 'channel'}}
7
Open the first Expression Card’s inspector. Next to the Condition field, toggle to disable generative AI.
8
Configure this Card for conversations started from a comment reply:
- In the Label field, paste in:
Conversation started from comment - In the Condition field, paste in:
{{event.channel == 'commentReplies'}}
9
Attach the Start Node to the 
Router Node. Then, attach the Conversation started Expression Card to your regular conversation logic:
Step 2: Reply to the user’s comment
Next, add logic to reply to the user’s comment. This lets them know that the bot will continue the conversation in a DM.1
Add a new Node to your Workflow and rename it to
Reply_to_comment.2
Add a Text Card to the new Node.
3
Open the Text Card’s inspector.In the Message to send field, enter the message you want to reply to the user’s comment. For example:
Check your DMs!.4
Attach the 
Conversation started from comment Expression Card to the Reply_to_comment Node:
Step 3: Start a DM conversation from the comment
Finally, add logic to start a DM conversation whenever a user leaves a comment.1
Add a new Node to your Workflow and rename it to
DM_reply.2
Add the Start DM Conversation from Comment Card to the new Node.
3
Open the Start DM Conversation from Comment Card’s inspector.
- In the Comment ID field, paste in:
{{event.payload.commentId}} - In the Message field, enter the first message you want to send the user in a DM. For example:
Hey! Received your comment.
If you want to send the user’s original comment back to them, you can add
{{event.payload.text}} to the Message field.4
Attach the 
Reply_to_comment Node to the DM_reply Node. Then, attach the DM_reply Node to the End Node:
When a user comments on a post, your bot will now:
- Reply to their comment, letting them know to check their DMs
- Continue the conversation in a DM
Cards
Here’s a reference for all Cards available with the integration:Get or Create a Conversation
Get or Create a User
Start DM Conversation from Comment
This Card has no output.



