Is there any way to revert to specified node & flo...
# 🤝help
w
I've developed a complex flow and want to add a revert(goto) button after each message (similar to inlineFeedback). When the button is pressed, it should return to that node and resend the message. I've looked into the code of Message.tsx and managed to obtain the messageId, store, etc. However, I'm unsure how to jump to a specific node. Is there something like bp.dialog.jumpTo available, and if so, how do I obtain the flow and node values? Looking forward to any help you can provide. Thanks a bunch!
s
Yes, there is a way to jump to a specific node in Botpress. You can use the
bp.dialog.jumpTo
function to achieve this. To obtain the flow and node values, you can use the
bp.dialog.getFlow
and
bp.dialog.getNode
functions respectively. Here is an example of how you can use these functions:
Copy code
javascript
const flow = bp.dialog.getFlow('your-flow-id');
const node = bp.dialog.getNode('your-node-id');

bp.dialog.jumpTo(flow, node);
Make sure to replace
'your-flow-id'
and
'your-node-id'
with the actual IDs of the flow and node you want to jump to. Please note that the
bp.dialog.jumpTo
function is only available in the Botpress SDK and cannot be directly used in the code of Message.tsx. You will need to use it in a separate action or hook. Source:
w
but I can't get flow and node value in Message, how can I call it near each message
s
To call the flow and node values near each message in the Message.tsx file, you can use the Botpress SDK functions
bp.dialog.getFlow
and
bp.dialog.getNode
to obtain the flow and node values respectively. However, please note that the
bp.dialog.jumpTo
function, which allows you to jump to a specific node, can only be used in the Botpress SDK and not directly in the code of Message.tsx. It needs to be used in a separate action or hook.
w
this.props.store.dialog is not exist in message.tsx. error:Property 'dialog' does not exist on type 'StudioConnector'
If I can't use it in Message.tsx, where can I put the revert button and event?
s
You can place the revert button and its associated event in a separate action or hook within the Botpress SDK. The
bp.dialog.jumpTo
function, which you would use to revert to a specific node, cannot be directly used in the Message.tsx file but can be utilized within these separate elements of the Botpress SDK.
w
what is the mean by Botpress SDK?
s
The Botpress SDK refers to the Software Development Kit provided by Botpress. It is a set of tools, libraries, and documentation that developers can use to build and customize chatbots using the Botpress platform. The SDK allows developers to access and utilize various functions, methods, and features of Botpress to create more advanced and tailored chatbot experiences. It provides a way to interact with the underlying framework and extend its capabilities.
w
why I can't use in Message.tsx, in fact, I use it in the onclick event. and I don't have any other place(action/hook) to bind with each message prop
s
The reason you can't use the
bp.dialog.jumpTo
function in the
Message.tsx
file is because it can only be used in the Botpress SDK and not directly in the code of
Message.tsx
. It needs to be used in a separate action or hook within the Botpress SDK. If you don't have any other place to bind with each message prop, you can create a separate action or hook within the Botpress SDK to handle the onclick event and use the
bp.dialog.jumpTo
function there.
w
but I need to know the specified history message's flow & node name by
.
can I get flow & node value by messageId
?
how to run action maunally?
s
To run an action manually in Botpress, you can use the "Execute Code" action card. This card allows you to write custom code that will be executed when the action is triggered. You can use this code to perform any desired actions or logic. Here is an example of how to run an action manually using the "Execute Code" action card: 1. Add an "Execute Code" action card to your flow. 2. In the code section of the action card, write the code that you want to run manually. 3. Save and publish your bot. When this action card is triggered, the code you wrote will be executed, allowing you to run actions manually. You can use this approach to perform various tasks, such as calling APIs, manipulating data, or interacting with external systems. Please note that the specific code you write will depend on the actions you want to perform manually. You can refer to the Botpress documentation for more information on how to use the "Execute Code" action card and write custom code in Botpress.
w
@square-energy-41150
s
# Sending a Problem Report Here's how to send the Botpress Team a problem report: 1. In the Botpress Cloud Studio, locate the "Help" icon in the bottom left corner of the screen. 2. Click "Report a problem" and follow the steps on the screen. 3. Copy the Report ID to your clipboard and provide it to a member of the Botpress Team on Discord.
w
BotpressBot not working
BotpressBot not helping. Waiting for help
f
@wide-lifeguard-54383 Sorry, you need to send this to #1112845893931110402 channel
w
Thanks
6 Views