Add deposit command

This commit is contained in:
Snazzah 2020-08-12 01:33:24 -05:00
parent bd683fde2f
commit fb536a7529
No known key found for this signature in database
GPG key ID: 5E71D54F3D86282E

View 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.'
}; }
};