diff --git a/commands/Fun/8ball.js b/commands/Fun/8ball.js index a7cd9b37..ae8bbcce 100644 --- a/commands/Fun/8ball.js +++ b/commands/Fun/8ball.js @@ -19,7 +19,7 @@ class Eightball extends Command { async run(message, args) { if (!args[0] || !message.content.endsWith("?")) return message.error("fun/8ball:ERR_QUESTION"); - const answerN = this.client.functions.randomNum(1, 20); + const answerN = this.client.functions.randomNum(1, 19); const answer = message.translate(`fun/8ball:RESPONSE_${answerN + 1}`); message.channel.send(answer); diff --git a/commands/Fun/findwords.js b/commands/Fun/findwords.js index 0e18a788..3a760932 100644 --- a/commands/Fun/findwords.js +++ b/commands/Fun/findwords.js @@ -26,6 +26,7 @@ class FindWords extends Command { let lang = null; if (message.guild.data.language === "uk-UA") return lang = "ru-RU"; else lang = message.guild.data.language; + const wordList = require(`../../assets/json/words/${lang}.json`); // Init some utils variables @@ -105,7 +106,7 @@ class FindWords extends Command { id: user.id, guildID: message.guild.id }); - userdata.money = userdata.money + 150; + userdata.money = userdata.money + (150 * (participants.length * 0.5)); userdata.save(); }; }; @@ -116,15 +117,14 @@ class FindWords extends Command { async function getWinner(array) { return new Promise(function (resolve) { const counts = {}; - let compare = 0; - let mostFrequent; + let compare = 0, + mostFrequent; + for (let i = 0, len = array.length; i < len; i++) { const winner = array[i]; - if (!counts[winner]) { - counts[winner] = 1; - } else { - counts[winner] = counts[winner] + 1; - }; + if (!counts[winner]) counts[winner] = 1; + else counts[winner] = counts[winner] + 1; + if (counts[winner] > compare) { compare = counts[winner]; mostFrequent = array[i]; diff --git a/commands/Fun/number.js b/commands/Fun/number.js index 3e3b7d03..db5a9bd2 100644 --- a/commands/Fun/number.js +++ b/commands/Fun/number.js @@ -22,8 +22,8 @@ class Number extends Command { async run(message, args, data) { if (currentGames[message.guild.id]) return message.error("fun/number:GAME_RUNNING"); - const participants = []; - const number = Math.floor(Math.random() * 3000); + const participants = [], + number = Math.floor(Math.random() * 3000); await message.sendT("fun/number:GAME_START"); @@ -51,16 +51,20 @@ class Number extends Command { participantCount: participants.length, participants: participants.map(p => `<@${p}>`).join(", ") }); - message.sendT("fun/number:WON", { - winner: msg.author.toString() - }); - const userdata = await this.client.findOrCreateMember({ - id: msg.author.id, - guildID: message.guild.id - }); - userdata.money = userdata.money + 100; - userdata.save(); - collector.stop(msg.author.username); + + if (participants.length > 1 && data.guild.disabledCategories && !data.guild.disabledCategories.includes("Economy")) { + message.sendT("fun/number:WON", { + winner: msg.author.username + }); + + const userdata = await this.client.findOrCreateMember({ + id: msg.author.id, + guildID: message.guild.id + }); + userdata.money = userdata.money + (100 * (participants.length * 0.5)); + userdata.save(); + collector.stop(msg.author.username); + }; }; if (parseInt(msg.content) < number) message.error("fun/number:BIG", { user: msg.author.toString(),