Difference between revisions of "Bot Playground/Commands/getBalance"
From SmartBots Developers Docs
Line 29: | Line 29: | ||
== Error messages == | == Error messages == | ||
− | For a comprehensive balance management script check the Examples section. | + | For a comprehensive balance management script check the [[Bot_Playground/Examples/Working_with_bot_money_balance|code in Examples section]]. |
{{NavMenu}} | {{NavMenu}} | ||
__NOTOC__ | __NOTOC__ |
Revision as of 11:43, 1 November 2016
Retrieves the current bot's L$ balance.
Bot.getBalance(function(result) {
console.log("I have L$" + result.balance);
});
or using a Promise:
Bot.getBalance()
.then(function(result) {
console.log("I have L$" + result.balance);
});
Reference
This command accepts the following parameters:
Variable | Required | Description
| |
---|---|---|---|
getBalance: | |||
Output: | |||
Function returns a Promise with the following data: | |||
success | bool | true if command completed successfully | |
error | string | error string if command has failed |
Error messages
For a comprehensive balance management script check the code in Examples section.