mirror of
https://github.com/LBRYFoundation/curate.git
synced 2025-08-23 17:37:25 +00:00
Add balance command
This commit is contained in:
parent
ffdecca30d
commit
ffcca38218
1 changed files with 28 additions and 0 deletions
28
src/commands/curator/balance.js
Normal file
28
src/commands/curator/balance.js
Normal file
|
@ -0,0 +1,28 @@
|
|||
const Command = require('../../structures/Command');
|
||||
const Util = require('../../util');
|
||||
|
||||
module.exports = class Balance extends Command {
|
||||
get name() { return 'balance'; }
|
||||
|
||||
get _options() { return {
|
||||
aliases: ['bal'],
|
||||
permissions: ['curatorOrAdmin']
|
||||
}; }
|
||||
|
||||
async exec(message) {
|
||||
const account = await Util.LBRY.findOrCreateAccount(this.client, message.author.id);
|
||||
const response = await this.client.lbry.accountBalance(account.accountID);
|
||||
const wallet = await response.json();
|
||||
if (await this.handleResponse(message, response, wallet)) return;
|
||||
return message.channel.createMessage({ embed: {
|
||||
description: `You have **${wallet.result.available}** LBC available.\n\n` +
|
||||
`Reserved in Supports: ${wallet.result.reserved_subtotals.supports} LBC\n` +
|
||||
`Total: ${wallet.result.total} LBC`
|
||||
} });
|
||||
}
|
||||
|
||||
get metadata() { return {
|
||||
category: 'Curator',
|
||||
description: 'Shows the user\'s account balance.'
|
||||
}; }
|
||||
};
|
Loading…
Add table
Reference in a new issue