mirror of
https://github.com/LBRYFoundation/curate.git
synced 2025-08-23 09:27:24 +00:00
Add admin balance command
This commit is contained in:
parent
43e03ddd4f
commit
73a2a7955d
1 changed files with 29 additions and 0 deletions
29
src/commands/admin/adminbalance.js
Normal file
29
src/commands/admin/adminbalance.js
Normal 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.'
|
||||
}; }
|
||||
};
|
Loading…
Add table
Reference in a new issue