From eff2025533a5931f9fb93d74f1aca0e342082bac Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Thu, 30 Mar 2017 21:05:26 +0000 Subject: [PATCH] Bug Fixes --- commands/games/typinggame.js | 18 ++++-------------- commands/moderation/unban.js | 4 ++-- commands/search/google.js | 2 +- commands/userinfo/userinfo.js | 18 ++++-------------- 4 files changed, 11 insertions(+), 31 deletions(-) diff --git a/commands/games/typinggame.js b/commands/games/typinggame.js index 0b22cafb..7ae1919b 100644 --- a/commands/games/typinggame.js +++ b/commands/games/typinggame.js @@ -33,32 +33,22 @@ module.exports = class TypingGameCommand extends commando.Command { let randomSentence = ['The quick brown fox jumps over the lazy dog.', 'Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo.', 'How razorback-jumping frogs can level six piqued gymnasts!', 'Amazingly few discotheques provide jukeboxes.']; randomSentence = randomSentence[Math.floor(Math.random() * randomSentence.length)]; let time; - switch (level) { - case "easy": - time = 25000; - break; - case "medium": - time = 20000; - break; - case "hard": - time = 15000; - break; - case "extreme": - time = 10000; - break; - } let levelWord; switch (level) { case "easy": + time = 25000; levelWord = "twenty-five"; break; case "medium": + time = 20000; levelWord = "twenty"; break; case "hard": + time = 15000; levelWord = "fifteen"; break; case "extreme": + time = 10000; levelWord = "ten"; break; } diff --git a/commands/moderation/unban.js b/commands/moderation/unban.js index ad419ba8..508a9b3f 100644 --- a/commands/moderation/unban.js +++ b/commands/moderation/unban.js @@ -16,7 +16,7 @@ module.exports = class UnbanCommand extends commando.Command { args: [{ key: 'memberID', prompt: 'What member do you want to unban? Please enter the ID of the user.', - type: 'integer', + type: 'string', validate: userID => { if (userID.length === 18) { return true; @@ -55,7 +55,7 @@ module.exports = class UnbanCommand extends commando.Command { let okHandMsg = await message.say(":ok_hand:"); const embed = new Discord.RichEmbed() .setAuthor(`${message.author.username}#${message.author.discriminator}`, message.author.avatarURL) - .setColor(0xFF0000) + .setColor(0x00AE86) .setFooter('XiaoBot Moderation', this.client.user.avatarURL) .setTimestamp() .setDescription(`**Member:** ${unbanUser.username}#${unbanUser.discriminator} (${unbanUser.id})\n**Action:** Ban\n**Reason:** ${reason}`); diff --git a/commands/search/google.js b/commands/search/google.js index 844e8e48..514f2b4e 100644 --- a/commands/search/google.js +++ b/commands/search/google.js @@ -34,7 +34,7 @@ module.exports = class DefineCommand extends commando.Command { .get(`https://www.google.com/search?q=${thingToSearch}`); const $ = cheerio.load(response.text); let href = $('.r').first().find('a').first().attr('href'); - if (!href) return Promise.reject(new Error('NO RESULTS')); + if (!href) return message.say(':x: Error! No Results Found!'); href = querystring.parse(href.replace('/url?', '')); return searchMsg.edit(href.q); } diff --git a/commands/userinfo/userinfo.js b/commands/userinfo/userinfo.js index 2cdee54f..72c2ba7d 100644 --- a/commands/userinfo/userinfo.js +++ b/commands/userinfo/userinfo.js @@ -32,32 +32,22 @@ module.exports = class UserInfoCommand extends commando.Command { console.log(`[Command] ${message.content}`); let user = args.user; let stat; - switch (user.presence.status) { - case "online": - stat = "<:vpOnline:212789758110334977> Online"; - break; - case "idle": - stat = "<:vpAway:212789859071426561> Idle"; - break; - case "dnd": - stat = "<:vpDnD:230093576355184640> Do Not Disturb"; - break; - case "offline": - stat = "<:vpOffline:212790005943369728> Offline"; - break; - } let color; switch (user.presence.status) { case "online": + stat = "<:vpOnline:212789758110334977> Online"; color = 0x00AE86; break; case "idle": + stat = "<:vpAway:212789859071426561> Idle"; color = 0xFFFF00; break; case "dnd": + stat = "<:vpDnD:230093576355184640> Do Not Disturb"; color = 0xFF0000; break; case "offline": + stat = "<:vpOffline:212790005943369728> Offline"; color = 0x808080; break; }