diff options
Diffstat (limited to 'commands/balance.js')
| -rw-r--r-- | commands/balance.js | 59 |
1 files changed, 29 insertions, 30 deletions
diff --git a/commands/balance.js b/commands/balance.js index ae575cc..7b340b2 100644 --- a/commands/balance.js +++ b/commands/balance.js @@ -1,5 +1,5 @@ -/**************************************** - * +/** ************************************** + * * Balance: Command for AleeBot * Copyright (C) 2017-2020 Alee Productions * @@ -15,37 +15,36 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. - * + * * *************************************/ module.exports.run = async (client, message) => { - const db = require('quick.db'); - const { RichEmbed } = require('discord.js'); + const db = require('quick.db'); + const {RichEmbed} = require('discord.js'); + + const user = message.mentions.users.first() || message.author; - let user = message.mentions.users.first() || message.author; + let balance = await db.fetch(`userBalance_${user.id}`); - let balance = await db.fetch(`userBalance_${user.id}`); + if (balance === null) { + db.set(`userBalance_${message.author.id}`, 0); + balance = 0; + } + const embed = new RichEmbed() + .setDescription(`**AleeCorp Bank**`) + .addField('Account Holder: ', user.username, true) + .addField('Account Balance: ', balance, true) + .setColor('#1fd619'); - if (balance === null) { - db.set(`userBalance_${message.author.id}`, 0); - balance = 0; - } - const embed = new RichEmbed() - .setDescription(`**AleeCorp Bank**`) - .addField('Account Holder: ', user.username, true) - .addField('Account Balance: ', balance, true) - .setColor('#1fd619') + message.channel.send({embed}); +}; - message.channel.send({embed}) - }; - - exports.conf = { - aliases: ['bal', 'money'], - guildOnly: false, - }; - exports.help = { - name: 'balance', - description: 'Checks the balance of AleeBot', - usage: 'balance [@someone (optional)]', - category: '- Economy Commands', - }; -
\ No newline at end of file +exports.conf = { + aliases: ['bal', 'money'], + guildOnly: false, +}; +exports.help = { + name: 'balance', + description: 'Checks the balance of AleeBot', + usage: 'balance [@someone (optional)]', + category: '- Economy Commands', +}; |
