Add admin balance command

This commit is contained in:
Snazzah 2020-08-11 22:24:01 -05:00
parent 43e03ddd4f
commit 73a2a7955d
No known key found for this signature in database
GPG key ID: 5E71D54F3D86282E

View file

@ -0,0 +1,29 @@
const Command = require('../../structures/Command');
module.exports = class AdminBalance extends Command {
get name() { return 'adminbalance'; }
get _options() { return {
aliases: ['abal', 'adminbal'],
permissions: ['admin']
}; }
async exec(message) {
const response = await this.client.lbry.walletBalance();
if (response.status !== 200) {
console.error('SDK error in adminbalance', response, await response.text());
return message.channel.createMessage(`LBRY-SDK returned ${response.status}, check console.`);
}
const wallet = await response.json();
return message.channel.createMessage({ embed: {
description: `**Available:** ${wallet.result.available} LBC\n\n` +
`Reserved in Supports: ${wallet.result.reserved_subtotals.supports} LBC\n` +
`Total: ${wallet.result.total} LBC`
} });
}
get metadata() { return {
category: 'Admin',
description: 'Shows the master wallet balance.'
}; }
};