How to create an individual user balance
The Variable balance (balance
) is initially activated for each new bot created using @MenuBuilderBot constructor. In order for balance to "appear" for every user in the bot, you just need to add the data (the amount in the currency of your project) to this variable and use the Macro of this variable to display the contents in the message.
• Go in your bot:
☞ Balance.
• Modes of balance management:
☞ Balance > Get - See the user's balance.
☞ Balance > Change - Increase or decrease the user's balance.
☞ Balance > Set - Assign a value to the balance by wiping off the previous value.
• After selecting the mode, you need to specify the user to whom you are changing the balance: The user can be specified by UserID, UserCode or by forwarding (Forward) to the bot one of his messages from the personal chat or a group.
• At the step of entering UserCode, from below you can enable the option "with comment", then the next step will request a comment.
• Enter the amount in the currency of your project - the user's balance will be changed depending on the selected mode.
• To show the user the value of his balance in the message, use the Variable macro:%balance%
☞ Balance > Notify User - Toggles user notification about balance change.
The user's balance can be set to a negative value. Only the mode can be used to do this:
☞ Balance > Set
Other options of balance change will not work in this case.
Read more about bot balance in the Balance Guide.
Read about how to assign an editor to any variable on the page dedicated to Variables editor.