Action: Run button¶
This action allows you to execute any button or command of the bot automatically, without needing to press it manually. You can use it to automate processes, pass custom parameters, and even schedule its execution for the future.
What can you do with this action?¶
- Automate commands or buttons: Execute any bot button or command automatically, even if it is hidden.
- Pass parameters: Send information to the executed button or command, such as numbers, texts, dates, or dynamic data.
- Schedule execution: Define when it will be executed, immediately, after a certain time, or on a specific date.
How to configure the action?¶
1. Create the action¶
- Go to your bot and press
🛠 Edit
to enter editor mode. - Select the button or command where you want to add this action, or create a new one.
- Click on
Actions 🌟
→🎯 New action
→↪️ Run button
. - Click
Configure 🛠
to set up the action.
2. Configure the options¶
➡️ Set button
¶
Specify the button or command to execute. If it is a command, it must start with /
or !
(e.g., /start
).
➡️ Parameters
(optional)¶
Specify the data to be sent to the button or command. Separate values with spaces. Example:
12345 "Hello VM" "10-11-2023" #jG8K3.text# "{username}"
Data types
- For text, dates, and expressions, use quotation marks
" "
. - For numbers, booleans, and action IDs, do not use quotation marks.
➡️ Schedule execution
(optional)¶
Define whether execution should occur 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¶
Press ✅ Activate
to enable this action and make it functional.
What does this action return through its ID?¶
Cancel scheduled execution¶
You can cancel a scheduled execution by retrieving the cancel_id
returned by this action:
#ActionID.cancel_id#
Then, send it to the Cancel scheduled action.
Replace
ActionID
with the ID of this action (Run button
).
Practical example: Creating a reminder via a questionnaire¶
In this example, the bot will ask the user two questions:
- What message do you want to schedule?
- In how many minutes do you want to receive the reminder?
Then, the bot will automatically send this data to the /reminder
command we created in the practical example of Jump to action, which will schedule the reminder for the user.
1. Create the Reminder
button¶
- Open the bot editor by clicking
🛠 Edit
. - Create a new button by clicking
✳️ New button | command
and name itReminder
. - Click
Actions 🌟
to configure the button's actions.
2. Configure the actions¶
a) Action 1: Send message (ask for the message)¶
- Click
🎯 New action
→✉️ Send message
. -
Click
Configure 🛠
→💬 Set message 💬
and enter:What message do you want to schedule? Send /cancel to cancel.
-
Return to the actions menu and activate this action by clicking
✅ Activate
.
b) Action 2: Wait for answer¶
- Click
🎯 New action
→⏳ Wait for answer
. -
Click
Configure 🛠
:- Validation: Select
text
only. -
Error message:
Please enter a valid message.
-
Cancellation texts:
/cancel
-
Show message on cancel:
The operation has been canceled.
- Validation: Select
-
Return to the actions menu and activate this action by clicking
✅ Activate
.
c) Action 3: Send message (ask for time)¶
- Click
🎯 New action
→✉️ Send message
. -
Click
Configure 🛠
→💬 Set message 💬
and enter:In how many minutes do you want to receive the reminder? Send /cancel to cancel.
-
Return to the actions menu and activate this action by clicking
✅ Activate
.
d) Action 4: Wait for answer¶
- Click
🎯 New action
→⏳ Wait for answer
. -
Click
Configure 🛠
:- Validation: Select
number
only. -
Error message:
Please enter a valid number.
-
Cancellation texts:
/cancel
-
Show message on cancel:
The operation has been canceled.
- Validation: Select
-
Return to the actions menu and activate this action by clicking
✅ Activate
.
e) Action 5: Run button¶
- Click
🎯 New action
→↪️ Run button
. -
Click
Configure 🛠
:-
Set button:
/reminder
-
Parameters:
#ActionWaitRespMessage.text# #ActionWaitRespTime.text#
Note 1: Replace
ActionWaitRespMessage
with the Action ID ofWait for answer
that waits for the message (action 2).Note 2: Replace
ActionWaitRespTime
with the Action ID ofWait for answer
that waits for the time (action 4).
-
-
Return to the actions menu and activate this action by clicking
✅ Activate
.
Final result¶
- The user presses the
Reminder
button. - The bot conducts the questionnaire:
- Bot: What message do you want to schedule?
- User: Call mom.
- Bot: In how many minutes do you want to receive the reminder?
- User: 15
-
The bot executes the
/reminder
command with the parameters:- Parameter 1: Call mom.
- Parameter 2: 15
-
The
/reminder
command processes the data and responds:✅ Your reminder has been scheduled and you will receive it in 15 minutes.
-
After 15 minutes, the bot sends:
🔔 Reminder! Call mom.
This is how the actions look¶
Important note¶
The /reminder
command must be configured beforehand, as shown in the previous action's practical example.