Skip to content

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:

  1. External network (Blockchain):

    • Sends funds to an external wallet address.
    • Network fees apply.
    • Each cryptocurrency has a minimum transfer amount.
  2. Internal network (Telegram):

    • Sends instant payments with no minimum amount and no fees to other VisualMaker users.
    • Specify the recipient using their @username, link (t.me/user), or user ID.
    • You can send funds even if the recipient has not joined VisualMaker yet; the funds will be available in their wallet once they do.

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:

  1. Asks the user for the withdrawal amount and the TRX address.
  2. Sends the payment.
  3. Confirms the payment to the user and logs the transaction in a channel.

1. Create the Withdraw button

  1. Enter your bot's editor by clicking 🛠 Edit.
  2. Create a new button by clicking ✳️ New button | command and name it Withdraw.
  3. Click Actions 🌟 to configure the button's actions.

2. Configure the actions

a) Action 1: Send message
  1. Click 🎯 New action✉️ Send message.
  2. 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
        
  3. Return to the actions menu and activate this action by clicking ✅ Activate.

b) Action 2: Wait for answer
  1. Click 🎯 New action⏳ Wait for answer.
  2. 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.

  3. Return to the actions menu and activate this action by clicking ✅ Activate.

c) Action 3: Condition
  1. Click 🎯 New action🧭 Condition.
  2. For now, do nothing here (we will configure it later).
d) Action 4: Send message
  1. Click 🎯 New action✉️ Send message.
  2. Click Configure 🛠💬 Set message 💬 and enter:

    Please enter your TRX address.
    
  3. Return to the actions menu and activate this action by clicking ✅ Activate.

e) Action 5: Wait for answer
  1. Click 🎯 New action⏳ Wait for answer.
  2. Click Configure 🛠 and make the following adjustments:

    • Click 🔍 Validation 🔍🔍 Set regular expression 🔎 and enter a regex pattern to validate the TRX 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.

  3. Return to the actions menu and activate this action by clicking ✅ Activate.

f) Action 6: Send payment
  1. Click 🎯 New action📤 Send payment.
  2. For now, do nothing here (we will configure it later).
g) Action 7: Change variable
  1. Copy the action ID of Wait for answer (Action 2).
  2. Click 🎯 New action🗃 Change variable.
  3. 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 the Wait for answer action you copied earlier.

  4. Return to the actions menu and activate this action by clicking ✅ Activate.

h) Action 8: Send message
  1. Click 🎯 New action✉️ Send message.
  2. Click Configure 🛠💬 Set message 💬 and enter:

    ✅ Your withdrawal is on its way.
    
  3. Return to the actions menu and activate this action by clicking ✅ Activate.

i) Action 9: Run button
  1. Click 🎯 New action↪️ Run button.
  2. Click Configure 🛠🔘 Set button 🔘 and enter:

    /start
    
  3. 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
  1. Click on 🎯 New action✉️ Send message.
  2. Click on Configure 🛠💬 Set message 💬 and enter:

    ❌ Enter an amount between 0.025 and {balance}.
    
  3. Return to the actions menu and activate this action by clicking ✅ Activate.

l) Action 11: Run button
  1. Click on 🎯 New action↪️ Run button.
  2. Click on Configure 🛠🔘 Set button 🔘 and enter:

    /start
    
  3. 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
  1. Click on 🎯 New action🖥 Receive Parameters.
  2. This action does not require configuration, simply activate it by clicking ✅ Activate.
  3. Copy the Action ID of this action, you will need it shortly.
ñ) Action 13: Send message (to user)
  1. Click on 🎯 New action✉️ Send message.
  2. 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 the Receive parameters action you just copied.

    Note 2: Remember that parameter 1 contains the amount sent, and parameter 7 contains the transaction TXID.

  3. Return to the actions menu and activate this action by clicking ✅ Activate.

o) Action 14: Send message (to channel)
  1. Add this bot as an administrator of the channel you want to use to log transactions.
  2. Return to the bot, click on 🎯 New action✉️ Send message.
  3. 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 the Receive 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.

  4. Return to the actions menu and activate this action by clicking ✅ Activate.

p) Configure the Condition action
  1. Copy the action ID of the action Wait for answer action 2.
  2. Return to the action of Condition (action 3) and click on Configure 🛠:

    • 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 the Wait 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:
      • Click on 🆔 Execute action by ID 🆔.
      • In ➡️ After action: ensure continue is selected.
      • Enter the action ID of Send message (action 10).
  3. Return to the actions menu and activate this action by clicking ✅ Activate.

q) Configure the Send payment action
  1. Locate the action Send Payment (action 6) and click on Configure 🛠:

    • 🧾 Set currency 🧾: Select TRX.
    • 💰 Set amount 💰: Set the amount to send:

      {#ActionIDWaitAnswer1.text#}
      

      Replace ActionIDWaitAnswer1 with the Action ID of the first action of Wait for answer added (action 2).

    • 👤 Set recipient 👤: Set the address to send to:

      {#ActionIDWaitAnswer2.text#}
      

      Replace ActionIDWaitAnswer2 with the Action ID of the second action Wait 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 action Receive parameters (action 12).

  2. Return to the actions menu and activate this action by clicking ✅ Activate.

Final result
  1. The user clicks Withdraw.
  2. The bot requests an amount and address, validates the data, and verifies sufficient balance.
  3. If everything is correct:
    • Processes the payment and displays the TXID to the user.
    • Logs the transaction in a channel.
  4. If balance is insufficient, it displays an error message.

This is how the actions look

VisualMaker crypto withdraw example