Action: Jump to action¶
This action allows you to execute any other action within the button or command where it was created, regardless of its position. Additionally, you can schedule the execution to occur immediately or at a specific time in the future.
What can you do with this action?¶
- Execute other actions: Run other actions within the same button or command where this action was created, even if they are separated by a separator.
- Schedule execution: Set actions to run at a specific time in the future, ranging from seconds to days or years, or on a specific date.
How to configure the action?¶
1. Create the action¶
- Go to your bot and click
🛠 Edit
to enter editor mode. - Select the button or command where you want to add the action, or create a new one.
- Click
Actions 🌟
→🎯 New action
→🔀 Jump to action
. - Click
Configure 🛠
to set up this action.
2. Configure the options¶
➡️ Set action
¶
- Specify the action to jump to using its Action ID (that action will be executed).
- You can choose to continue with the subsequent actions of the action you jumped to or stop execution after the jump.
You can use expressions to dynamically select which action to jump to.
➡️ Schedule execution
(optional)¶
Define if the action should be executed later:
- By countdown (days, hours, minutes, or seconds).
-
On a specific date:
-
You can use literal dates and times. For example:
31-12-2024 23-59-59
-
You can use functions. For example, to execute one day later:
{time_add(date_now(), 1, "days")}
-
3. Activate the action¶
Click ✅ Activate
to enable this action.
What does this action return through its ID?¶
Cancel scheduled execution¶
You can cancel a scheduled execution by obtaining the cancel_id
returned by this action:
#ActionID.cancel_id#
And then passing it to the Cancel scheduled action.
Replace
ActionID
with the ID of this action (Jump to action
).
Practical example: Creating a reminder¶
We will create a /reminder
command that schedules a reminder to send you a message after a specified time.
Example command usage:
/reminder "Call mom" 10
- Parameter 1: The message you will receive when the countdown ends. It is a text, so it is enclosed in quotes.
- Parameter 2: The countdown in minutes until you receive the message. It is a number, so it does not require quotes.
What are parameters and how to retrieve them?
To learn about parameters and how to retrieve them, see the Receive parameters action.
After 10 minutes, you will receive the message:
Call mom
1. Create the command¶
- Enter editor mode by clicking
🛠 Edit
in your bot. - Create a new command by clicking
✳️ New button | command
and name it/reminder
. - Click
Actions 🌟
to open the command’s action menu.
2. Configure the actions¶
a) Action 1: Receive parameters¶
- Click
🎯 New action
→🖥 Receive parameters
. - This action does not require configuration, simply activate it by clicking
✅ Activate
. - Copy the ID of this action; you will need it later.
b) Action 2: Jump to action¶
- Click
🎯 New action
→🔀 Jump to action
. - Do nothing here for now (it will be configured later).
c) Action 3: Send message (Confirm scheduling to user)¶
- Click
🎯 New action
→✉️ Send message
. -
Click
Configure 🛠
→💬 Set message 💬
and enter the message to inform the user that their reminder was scheduled:✅ Your reminder has been scheduled and you will receive it in {#ActionIDRecParam.param2#} minutes.
Replace
ActionIDRecParam
with the Action ID ofReceive parameters
(action 1). -
Return to the actions menu and activate the action by clicking
✅ Activate
.
d) Add a Separator¶
Click New separator 📍
to add a separator and create a new action block. Learn more about separators.
e) Action 4: Send message (Send reminder)¶
- Click
🎯 New action
→✉️ Send message
. -
Click
Configure 🛠
→💬 Set message 💬
and enter:Reminder! {#ActionIDRecParam.param1#}
Replace
ActionIDRecParam
with the Action ID ofReceive parameters
(action 1). -
Return to the actions menu and activate the action by clicking
✅ Activate
. - Copy the ID of this action; you will need it in the next step.
f) Configure the Jump to action¶
- Go back to
Jump to action
(action 2) and clickConfigure 🛠
. - Click
🆔 Set action 🆔
and paste the Action ID of theSend message
action that will send the reminder (action 4). -
Click
🕒 Schedule execution 🕒
→📅 Set date 📅
and enter:{time_add(date_now(), #ActionIDRecParam.param2#, "minutes")}
-
Return to the actions menu and activate the action by clicking
✅ Activate
.
Final result¶
-
The user sends the command:
/reminder "The movie is about to start" 60
-
The bot responds:
✅ Your reminder has been scheduled and you will receive it in 60 minutes.
-
After 60 minutes, the bot sends the message:
Reminder! The movie is about to start
This is how the actions look¶
Important notes¶
-
When you schedule the jump to another action (to execute later):
The bot will continue executing actions that follow
Jump to action
. -
When you do NOT schedule the jump to another action (executed immediately):
The bot jumps directly to the selected action and does not execute actions that follow
Jump to action
.