Action: Send payment¶
This action allows you to send cryptocurrency payments to an external address or to another VisualMaker user's wallet, with no fees for internal transactions. There are two main methods:
-
External network (Blockchain):
- Sends funds to an external wallet address.
- Network fees apply.
- Each cryptocurrency has a minimum transfer amount.
-
Internal network (Telegram):
Make sure you have enough balance in your VisualMaker wallet to cover the amount and any applicable fees.
How to set up 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.
- Go to
Actions 🌟
→🎯 New action
→📤 Send payment
. - Press
Configure 🛠
to set it up.
2. Configure the options¶
➡️ Set currency
¶
Select the cryptocurrency to send (e.g., BTC
, USDT
, TON
).
➡️ Set amount
¶
Enter the amount to send.
➡️ Set recipient
¶
- For external withdrawals: Provide the wallet address.
- For internal transfers: Specify the @username, link (
t.me/user
), or Telegram ID.
➡️ Set memo
(optional)¶
Add the memo required by certain cryptocurrencies (e.g., TON
).
➡️ Execute action
(optional)¶
Specify the action ID that will be executed upon payment confirmation. This must be of type Receive parameters to capture payment data and must be isolated using a separator. This action is only executed for external network (Blockchain) transactions, as internal payments (Telegram) are instant.
3. Activate the action¶
Press ✅ Activate
to enable this action and make it functional.
What does this action return through its ID?¶
The action does not return data directly but will send payment details to an action of type Receive parameters, allowing you to use the data in subsequent actions.
Parameters sent to the Receive parameters
action¶
Once a payment is confirmed via the blockchain, the configured action (of type Receive parameters) will be executed. Through this action, you can obtain details about the completed transaction.
- Sent amount:
#ActionIDRecParam.param1#
- Amount in USD:
#ActionIDRecParam.param2#
- Fee charged:
#ActionIDRecParam.param3#
- Currency used:
#ActionIDRecParam.param4#
- Network used:
#ActionIDRecParam.param5#
- User ID:
#ActionIDRecParam.param6#
- TXID (transaction hash):
#ActionIDRecParam.param7#
Replace
ActionIDRecParam
with the action ID of the Receive parameters action you created.
Practical example: sending TRX via external network (Blockchain)¶
In this example, we will create a button called Withdraw
that:
- Asks the user for the withdrawal amount and the
TRX
address. - Sends the payment.
- Confirms the payment to the user and logs the transaction in a channel.
1. Create the Withdraw
button¶
- Enter your bot's editor by clicking
🛠 Edit
. - Create a new button by clicking
✳️ New button | command
and name itWithdraw
. - Click
Actions 🌟
to configure the button's actions.
2. Configure the actions¶
a) Action 1: Send message¶
- Click
🎯 New action
→✉️ Send message
. -
Click
Configure 🛠
:-
Click
💬 Set message 💬
and enter:You have {balance} TRX. Please enter the amount you wish to withdraw.
-
Add a cancel keyboard:
- Click
💠 Deploy keyboard 💠
→🔘 Create new keyboard 🔘
→🔷 Lower
. - Add a button with the text:
Cancel
- Click
-
-
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 🛠
and make the following adjustments:- Validation: Select only the
number
option. This ensures that the user enters a valid number. -
Error message: Enter an error message in case of invalid input, for example:
Please enter only valid numbers. Try again.
-
Cancelation texts: Enter the text you set as the cancel button in the previous action, in this case:
Cancel
-
Show message on cancel: Enter the message that will be displayed if the user cancels, for example:
Operation canceled. If you need help, contact us.
-
Press button on cancel: Enter
/start
so that the main menu loads upon canceling.
- Validation: Select only the
-
Return to the actions menu and activate this action by clicking
✅ Activate
.
c) Action 3: Condition¶
- Click
🎯 New action
→🧭 Condition
. - For now, do nothing here (we will configure it later).
d) Action 4: Send message¶
- Click
🎯 New action
→✉️ Send message
. -
Click
Configure 🛠
→💬 Set message 💬
and enter:Please enter your TRX address.
-
Return to the actions menu and activate this action by clicking
✅ Activate
.
e) Action 5: Wait for answer¶
- Click
🎯 New action
→⏳ Wait for answer
. -
Click
Configure 🛠
and make the following adjustments:-
Click
🔍 Validation 🔍
→🔍 Set regular expression 🔎
and enter a regex pattern to validate theTRX
address, for example:^T[A-Za-z1-9]{33}$
-
Error message: Enter an error message for invalid input, for example:
Invalid TRX address. Please try again.
-
Cancelation texts: Enter
Cancel
-
Show message on cancel: Enter the message displayed if the user cancels, for example:
Operation canceled. If you need help, contact us.
-
Press button on cancel: Enter
/start
to load the main menu upon canceling.
-
-
Return to the actions menu and activate this action by clicking
✅ Activate
.
f) Action 6: Send payment¶
- Click
🎯 New action
→📤 Send payment
. - For now, do nothing here (we will configure it later).
g) Action 7: Change variable¶
- Copy the action ID of
Wait for answer
(Action 2). - Click
🎯 New action
→🗃 Change variable
. -
Click
Configure 🛠
:- Select variable: Enter
balance
- Modification type: Select
🔺 Increment 🔺
-
Value to save: Deduct the sent amount from the user's
balance
. Save the following:-{#ActionIDWaitAnswer.text#}
Replace
ActionIDWaitAnswer
with the action ID of theWait for answer
action you copied earlier.
- Select variable: Enter
-
Return to the actions menu and activate this action by clicking
✅ Activate
.
h) Action 8: Send message¶
- Click
🎯 New action
→✉️ Send message
. -
Click
Configure 🛠
→💬 Set message 💬
and enter:✅ Your withdrawal is on its way.
-
Return to the actions menu and activate this action by clicking
✅ Activate
.
i) Action 9: Run button¶
- Click
🎯 New action
→↪️ Run button
. -
Click
Configure 🛠
→🔘 Set button 🔘
and enter:/start
-
Return to the actions menu and activate this action by clicking
✅ Activate
.
j) Add a separator¶
Click on New separator 📍
to add a separator at the end and create a new block of actions. See what separators are.
k) Action 10: Send message¶
- Click on
🎯 New action
→✉️ Send message
. -
Click on
Configure 🛠
→💬 Set message 💬
and enter:❌ Enter an amount between 0.025 and {balance}.
-
Return to the actions menu and activate this action by clicking
✅ Activate
.
l) Action 11: Run button¶
- Click on
🎯 New action
→↪️ Run button
. -
Click on
Configure 🛠
→🔘 Set button 🔘
and enter:/start
-
Return to the actions menu and activate this action by clicking
✅ Activate
.
m) Add a separator¶
Click on New separator 📍
to add a separator at the end and create a new block of actions. See what separators are.
n) Action 12: Receive parameters¶
- Click on
🎯 New action
→🖥 Receive Parameters
. - This action does not require configuration, simply activate it by clicking
✅ Activate
. - Copy the Action ID of this action, you will need it shortly.
ñ) Action 13: Send message (to user)¶
- Click on
🎯 New action
→✉️ Send message
. -
Click on
Configure 🛠
→💬 Set message 💬
and enter:✅ Your withdrawal of {#ActionIDRecParam.param1#} TRX has been processed, the TXID is: {#ActionIDRecParam.param7#}
Note 1: Replace
ActionIDRecParam
with the Action ID of theReceive parameters
action you just copied.Note 2: Remember that parameter 1 contains the amount sent, and parameter 7 contains the transaction TXID.
-
Return to the actions menu and activate this action by clicking
✅ Activate
.
o) Action 14: Send message (to channel)¶
- Add this bot as an administrator of the channel you want to use to log transactions.
- Return to the bot, click on
🎯 New action
→✉️ Send message
. -
Click on
Configure 🛠
:-
Click
💬 Set message 💬
and enter:📤 New withdrawal 📤 User: {first_name} Amount: {#ActionIDRecParam.param1#} TRX TXID: {#ActionIDRecParam.param7#}
Replace
ActionIDRecParam
with the action ID of theReceive parameters
action you copied earlier. -
Click
👤 Send to someone else 👤
→📍 Set new recipient 📍
and enter the@username
or the user ID of the channel where you will log transactions.
-
-
Return to the actions menu and activate this action by clicking
✅ Activate
.
p) Configure the Condition action¶
- Copy the action ID of the action
Wait for answer
action 2. -
Return to the action of
Condition
(action 3) and click onConfigure 🛠
:-
New condition:
{balance > 0 and to_number(#ActionID.text#) >= 0.025 and to_number(#ActionID.text#) <= balance}
Note 1: Replace
ActionID
with the action ID of theWait for answer
action you just copied.Note 2: We used comparison operators, see them all here.
Note 3: We used the function to_number() to convert a number from text format to a numeric format, you can see this and all functions here.
Note 4: 0.025 is the minimum TRX sending through the external network (Blockchain).
-
If true: Select
continue
. - If false:
-
-
Return to the actions menu and activate this action by clicking
✅ Activate
.
q) Configure the Send payment action¶
-
Locate the action
Send Payment
(action 6) and click onConfigure 🛠
:🧾 Set currency 🧾:
SelectTRX
.-
💰 Set amount 💰:
Set the amount to send:{#ActionIDWaitAnswer1.text#}
Replace
ActionIDWaitAnswer1
with the Action ID of the first action ofWait for answer
added (action 2). -
👤 Set recipient 👤:
Set the address to send to:{#ActionIDWaitAnswer2.text#}
Replace
ActionIDWaitAnswer2
with the Action ID of the second actionWait for answer
added (action 5). -
🕹 Execute action 🕹:
Set the action to execute once the payment is processed:#ActionIDRecParam#
Replace
ActionIDRecParam
with the Action ID of the actionReceive parameters
(action 12).
-
Return to the actions menu and activate this action by clicking
✅ Activate
.
Final result¶
- The user clicks
Withdraw
. - The bot requests an amount and address, validates the data, and verifies sufficient
balance
. - If everything is correct:
- Processes the payment and displays the TXID to the user.
- Logs the transaction in a channel.
- If
balance
is insufficient, it displays an error message.