mirror of
https://github.com/LBRYFoundation/curate.git
synced 2025-08-23 17:37:25 +00:00
Add deposit command
This commit is contained in:
parent
bd683fde2f
commit
fb536a7529
1 changed files with 25 additions and 0 deletions
25
src/commands/admin/deposit.js
Normal file
25
src/commands/admin/deposit.js
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
const Command = require('../../structures/Command');
|
||||||
|
|
||||||
|
module.exports = class Deposit extends Command {
|
||||||
|
get name() { return 'deposit'; }
|
||||||
|
|
||||||
|
get _options() { return {
|
||||||
|
aliases: ['dp'],
|
||||||
|
permissions: ['admin']
|
||||||
|
}; }
|
||||||
|
|
||||||
|
async exec(message) {
|
||||||
|
const response = await this.client.lbry.listAddresses();
|
||||||
|
if (response.status !== 200) {
|
||||||
|
console.error('SDK error in deposit', response, await response.text());
|
||||||
|
return message.channel.createMessage(`LBRY-SDK returned ${response.status}, check console.`);
|
||||||
|
}
|
||||||
|
const address = await response.json();
|
||||||
|
return message.channel.createMessage(`Address: ${address.result.items[0].address}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
get metadata() { return {
|
||||||
|
category: 'Admin',
|
||||||
|
description: 'Gets the address of the master wallet.'
|
||||||
|
}; }
|
||||||
|
};
|
Loading…
Add table
Reference in a new issue