diff options
| author | Alee <alee14498@gmail.com> | 2018-06-23 18:18:56 -0400 |
|---|---|---|
| committer | Alee <alee14498@gmail.com> | 2018-06-23 18:18:56 -0400 |
| commit | 677fd30db28bd21a72ede46e847c48505c4a9ff8 (patch) | |
| tree | f8819a6d735f369ff06c59dec711743804db046a /commands/balance.js | |
| parent | ca44ee2b1c54f71757179814ef2f548e7057af5b (diff) | |
| download | AleeBot-677fd30db28bd21a72ede46e847c48505c4a9ff8.tar.gz AleeBot-677fd30db28bd21a72ede46e847c48505c4a9ff8.tar.bz2 AleeBot-677fd30db28bd21a72ede46e847c48505c4a9ff8.zip | |
Added back the economy feature (it's broken for now)
Diffstat (limited to 'commands/balance.js')
| -rw-r--r-- | commands/balance.js | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/commands/balance.js b/commands/balance.js new file mode 100644 index 0000000..fe3b9f8 --- /dev/null +++ b/commands/balance.js @@ -0,0 +1,48 @@ +/**************************************** + * + * Balance: Command for AleeBot + * Copyright (C) 2018 AleeCorp + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * 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'); + + let user = message.mentions.users.first() || message.author; + + let balance = await db.fetch(`userBalance_${user.id}`); + + if (balance === null) 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}) + }; + + 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 |
