aboutsummaryrefslogtreecommitdiff
path: root/commands
diff options
context:
space:
mode:
authorAlee <alee14498@gmail.com>2018-05-27 18:14:42 -0400
committerAlee <alee14498@gmail.com>2018-05-27 18:14:42 -0400
commit39e713d2da5091aa1e0867a5911462d91c16c4cf (patch)
treed3aa28f1c48267a3d17ad92ecae8d03a8d2f76d8 /commands
parent7d1cb659df49b9b447a161f67b1c059fb2dcd6b0 (diff)
downloadAleeBot-39e713d2da5091aa1e0867a5911462d91c16c4cf.tar.gz
AleeBot-39e713d2da5091aa1e0867a5911462d91c16c4cf.tar.bz2
AleeBot-39e713d2da5091aa1e0867a5911462d91c16c4cf.zip
Removed economy features
Diffstat (limited to 'commands')
-rw-r--r--commands/buy.js119
-rw-r--r--commands/changelog.js2
-rw-r--r--commands/money.js44
-rw-r--r--commands/setmoney.js60
-rw-r--r--commands/slots.js95
5 files changed, 1 insertions, 319 deletions
diff --git a/commands/buy.js b/commands/buy.js
deleted file mode 100644
index b9b9269..0000000
--- a/commands/buy.js
+++ /dev/null
@@ -1,119 +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 economy = require('discord-eco')
- const Discord = require('discord.js');
- const fs = require('fs')
- 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.`)
- }
-
-
- economy.fetchBalance(message.author.id + message.guild.id).then((i) => {
- if (i.money <= itemPrice) {
-
- return message.channel.send(`You don't have enough money for this item.`);
- }
-
- economy.updateBalance(message.author.id + message.guild.id, parseInt(`-${itemPrice}`)).then((i) => {
-
- message.channel.send('You bought ' + itemName + '!');
-
-
- if (itemName === 'Programmer Role') {
- message.guild.members.get(message.author.id).addRole(message.guild.roles.find("name", "Programmers"));
- }
-
- })
-
- })
-
- };
-
- exports.conf = {
- aliases: [],
- guildOnly: false,
- };
- exports.help = {
- name: 'buy',
- description: 'Buy things.',
- usage: 'buy [item]',
- category: '- Economy Commands',
- };
- \ No newline at end of file
diff --git a/commands/changelog.js b/commands/changelog.js
index cca1475..3eeeeb2 100644
--- a/commands/changelog.js
+++ b/commands/changelog.js
@@ -22,7 +22,7 @@ module.exports.run = async (client, message) => {
const embed = new Discord.RichEmbed()
.setAuthor('AleeBot ' + require('../storage/settings.json').abVersion + ' Changelog', 'https://cdn.discordapp.com/avatars/282547024547545109/6c147a444ae328c38145ef1f74169e38.png?size=2048')
.setDescription('What\'s new in AleeBot '+ require('../storage/settings.json').abVersion +'?')
- .addField('1. Minor changes in ban and kick!', 'We now have embeds in ban and kick...')
+ .addField('1. Economy features has been removed!', 'Unfortunately, this feature has been removed due to technical problems.')
.setColor('#1fd619');
message.channel.send({embed});
diff --git a/commands/money.js b/commands/money.js
deleted file mode 100644
index f9963b2..0000000
--- a/commands/money.js
+++ /dev/null
@@ -1,44 +0,0 @@
-/****************************************
- *
- * Money: 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 { RichEmbed } = require('discord.js');
- const economy = require('discord-eco')
- economy.fetchBalance(message.author.id + message.guild.id).then((i) => {
- const embed = new RichEmbed()
- .setDescription(`**${message.guild.name} Bank**`)
- .addField('Account Holder: ', message.author.username, true)
- .addField('Account Balance: ', i.money, true)
- .setColor('#1fd619')
-
- message.channel.send({embed})
- })
- };
-
- exports.conf = {
- aliases: ['bal', 'balance'],
- guildOnly: false,
- };
- exports.help = {
- name: 'money',
- description: 'Displays your balance.',
- usage: 'money',
- category: '- Economy Commands',
- };
- \ No newline at end of file
diff --git a/commands/setmoney.js b/commands/setmoney.js
deleted file mode 100644
index f4bb4aa..0000000
--- a/commands/setmoney.js
+++ /dev/null
@@ -1,60 +0,0 @@
-/****************************************
- *
- * SetMoney: 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 { RichEmbed } = require('discord.js');
- const economy = require('discord-eco')
- if (!message.member.permissions.has('ADMINISTRATOR')) return message.reply("It looks like that you don't have the permissions to set your money.")
- // if (!['242775871059001344',].includes(message.author.id))
-
- if (!args[0]) {
- message.reply('You need a amount.');
- return;
- }
-
- if(isNaN(args[0])) {
- message.reply("Please make sure it's a number.");
- return;
- }
-
- let defineduser = '';
- if (!args[1]) {
- defineduser = message.author.id;
- } else {
- let firstMentioned = message.mentions.users.first();
- defineduser = firstMentioned.id;
-
- }
-
- economy.updateBalance(defineduser + message.guild.id, parseInt(args[0])).then((i) => {
- message.reply(`User defined has ${args[0]} dollars added or removed to their account.`)
- });
- };
-
- exports.conf = {
- aliases: [],
- guildOnly: false,
- };
- exports.help = {
- name: 'setmoney',
- description: 'Sets money.',
- usage: 'setmoney [amount] [user]',
- category: '- Economy Commands',
- };
- \ No newline at end of file
diff --git a/commands/slots.js b/commands/slots.js
deleted file mode 100644
index 9072c84..0000000
--- a/commands/slots.js
+++ /dev/null
@@ -1,95 +0,0 @@
-/****************************************
- *
- * Slots: Command for AleeBot
- * Copyright (C) 2018 AleeCorp & jtsshieh + PokeWorld
- *
- * 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 economy = require('discord-eco')
- const slotNumbers = [
- 1,
- 2,
- 3,
- 4,
- 5,
- 6,
- 7,
- 8,
- 9,
- ];
-
- economy.fetchBalance(message.author.id + message.guild.id).then((i) => {
- if (i.money <= 10) {
-
- return message.channel.send(`You don't have enough money (10) to play this game.`);
- }
-
- const number1 = slotNumbers[Math.floor(Math.random() * slotNumbers.length)];
- const number2 = slotNumbers[Math.floor(Math.random() * slotNumbers.length)];
- const number3 = slotNumbers[Math.floor(Math.random() * slotNumbers.length)];
-
-
- if (number2 == number1 + 1 && number3 == number2 + 1) {
- economy.updateBalance(message.author.id + message.guild.id, parseInt(1000)).then((i) => {
- economy.fetchBalance(message.author.id + message.guild.id).then((i) => {
- message.channel.send('You won 1000 money!\nCurrent Balance: ' + i.money + ' \n> ' + emojify(number1, number2, number3));
- });
- });
- }
- else if (number2 == number3 - 1 && number1 == number2 - 1) {
- economy.updateBalance(message.author.id + message.guild.id, parseInt(1050)).then((i) => {
- economy.fetchBalance(message.author.id + message.guild.id).then((i) => {
- message.channel.send('You won 1050 money!\nCurrent Balance: ' + i.money + ' \n> ' + emojify(number1, number2, number3));
- });
- });
- }
- else {
- economy.updateBalance(message.author.id + message.guild.id, parseInt(-10)).then((i) => {
- economy.fetchBalance(message.author.id + message.guild.id).then((i) => {
- message.channel.send('You lost 10 money...\nCurrent Balance: ' + i.money + ' \n> ' + emojify(number1, number2, number3));
- });
- });
- }
- });
-
- function emojify(number1, number2, number3) {
- return emote(number1) + ' ' + emote(number2) + ' ' + emote(number3);
- }
-
- function emote(number) {
- if (number == 1) return ':one:';
- if (number == 2) return ':two:';
- if (number == 3) return ':three:';
- if (number == 4) return ':four:';
- if (number == 5) return ':five:';
- if (number == 6) return ':six:';
- if (number == 7) return ':seven:';
- if (number == 8) return ':eight:';
- if (number == 9) return ':nine:';
- }
-}
- exports.conf = {
- aliases: [],
- guildOnly: false,
- };
-
- exports.help = {
- name: 'slots',
- description: 'Develop a gambling addiction by playing Slots!',
- usage: 'slots',
- category: '- Games',
- };