How to change a user's balance when someone following his referral link
A one-level referral system is initially available for each new bot created using @MenuBuilderBot constructor. In order for the user to "get" referral rewards, you just need to enable its accrual for any Variable and use the Macros to display the contents of this variable in the message. Also, using dedicated macros in the Message, the referral link itself and the number of referrals can be displayed.
• Go in your bot:
☞ Balance > Referral Bonus
• Specify the amount of remuneration (only the number that will be added to the current value of the variable).
• To show your user his referral link, just use the Macros in the message:%reflink%
• To show your user the number of his referrals, use the Macros in the message:%refcount%
By default, the amount of remuneration is 0 (zero), so no accrual occurs.
In this example, referral charges are assigned to the
balance
variable, however, by using the Editor, they can be configured for another variable. For this you need additional variables.
Variables.
To connect variables, go in your bot:☞ 🔐Admin | 🧩Extensions | 📂Variables
More about the Referral system.