diff options
| author | Alee <Alee14498@gmail.com> | 2020-01-02 14:46:06 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-01-02 14:46:06 -0500 |
| commit | dcec0212db88a775967f975c9c1d32dec7f63ec8 (patch) | |
| tree | 4a6c2b6f8fc6b51971ef82b18cfdc66ea33f8e06 /commands/buy.js | |
| parent | c8b8ba0bc5774bda115c368e8ce30a74b72b7231 (diff) | |
| download | AleeBot-dcec0212db88a775967f975c9c1d32dec7f63ec8.tar.gz AleeBot-dcec0212db88a775967f975c9c1d32dec7f63ec8.tar.bz2 AleeBot-dcec0212db88a775967f975c9c1d32dec7f63ec8.zip | |
Beta (#20)
* 2.12.0 Beta
* 2020 changes and tweaked some stuff
* remove lock
* more copyright update
* Service status, updating readme files
* readme changes
* readme changes x2
* 2.12.0 release
Diffstat (limited to 'commands/buy.js')
| -rw-r--r-- | commands/buy.js | 118 |
1 files changed, 0 insertions, 118 deletions
diff --git a/commands/buy.js b/commands/buy.js deleted file mode 100644 index e5b8fee..0000000 --- a/commands/buy.js +++ /dev/null @@ -1,118 +0,0 @@ -/**************************************** - * - * Buy: 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, args) => { -/* -const Discord = require('discord.js'); -const fs = require('fs') -const db = require('quick.db'); -const items = JSON.parse(fs.readFileSync('./storage/items.json', 'utf8')); - - let categories = []; - - if (!args.join(" ")) { - - - for (var i in items) { - - - if (!categories.includes(items[i].type)) { - categories.push(items[i].type) - } - - } - - - const embed = new Discord.RichEmbed() - .setDescription(`Available Items`) - .setColor('#1fd619') - - for (var i = 0; i < categories.length; i++) { - - var tempDesc = ''; - - for (var c in items) { - if (categories[i] === items[c].type) { - - tempDesc += `${items[c].name} - ${items[c].price}$ - ${items[c].desc}\n`; - - } - - } - - embed.addField(categories[i], tempDesc); - - } - - - return message.channel.send({ - embed - }); - - - } - - let itemName = ''; - let itemPrice = 0; - let itemDesc = ''; - - for (var i in items) { - if (args.join(" ").trim().toUpperCase() === items[i].name.toUpperCase()) { - itemName = items[i].name; - itemPrice = items[i].price; - itemDesc = items[i].desc; - } - } - - - if (itemName === '') { - return message.channel.send(`Item ${args.join(" ").trim()} not found.`) - } - - let selfBalance = await db.fetch(`userBalance_${message.author.id}`); - - if (selfBalance === null) { - db.set(`userBalance_${message.author.id}`, 0); - selfBalance = 0 - } - - if (itemPrice > selfBalance) return message.reply('You don\'t have enough money for this item.') - - db.subtract(`userBalance_${message.author.id}`, itemPrice); - - if (itemName === 'Programmer Role') { - message.guild.members.get(message.author.id).addRole(message.guild.roles.find("name", "Programmers")); - } - - message.channel.send('You bought ' + itemName + '!'); - */ - message.reply('Command is broken for now'); -}; - -exports.conf = { - aliases: [], - guildOnly: false, -}; -exports.help = { - name: 'buy', - description: 'Buy things.', - usage: 'buy [item]', - category: '- Economy Commands', -}; -
\ No newline at end of file |
