diff --git a/commands/avataredit/3000years.js b/commands/avataredit/3000years.js index 4ab69c92..341591a7 100644 --- a/commands/avataredit/3000years.js +++ b/commands/avataredit/3000years.js @@ -37,7 +37,7 @@ module.exports = class YearsCommand extends Command { years.blit(avatar, 461, 127); years.getBuffer(Jimp.MIME_PNG, (err, buff) => { if (err) return message.say(':x: Error! Something went wrong!'); - return message.channel.send({file: {attachment: buff} }); + return message.channel.send({file: {attachment: buff}}); }); } }; diff --git a/commands/avataredit/beautiful.js b/commands/avataredit/beautiful.js index 781579df..e40ac752 100644 --- a/commands/avataredit/beautiful.js +++ b/commands/avataredit/beautiful.js @@ -39,7 +39,7 @@ module.exports = class BeautifulCommand extends Command { beautiful.blit(avatar, 451, 434); beautiful.getBuffer(Jimp.MIME_PNG, (err, buff) => { if (err) return message.say(':x: Error! Something went wrong!'); - return message.channel.send({file: {attachment: buff} }); + return message.channel.send({file: {attachment: buff}}); }); } }; diff --git a/commands/avataredit/bobross.js b/commands/avataredit/bobross.js index 1db8d2ad..7ef805e8 100644 --- a/commands/avataredit/bobross.js +++ b/commands/avataredit/bobross.js @@ -41,7 +41,7 @@ module.exports = class BobRossCommand extends Command { nothing.composite(bob, 0, 0); nothing.getBuffer(Jimp.MIME_PNG, (err, buff) => { if (err) return message.say(':x: Error! Something went wrong!'); - return message.channel.send({file: {attachment: buff} }); + return message.channel.send({file: {attachment: buff}}); }); } }; diff --git a/commands/avataredit/rip.js b/commands/avataredit/rip.js index 8326f74a..6d3892f5 100644 --- a/commands/avataredit/rip.js +++ b/commands/avataredit/rip.js @@ -38,7 +38,7 @@ module.exports = class RIPCommand extends Command { gravestone.blit(avatar, 60, 65); gravestone.getBuffer(Jimp.MIME_PNG, (err, buff) => { if (err) return message.say(':x: Error! Something went wrong!'); - return message.channel.send({file: {attachment: buff} }); + return message.channel.send({file: {attachment: buff}}); }); } }; diff --git a/commands/avataredit/steamcard.js b/commands/avataredit/steamcard.js index dccf89a3..9c3081ce 100644 --- a/commands/avataredit/steamcard.js +++ b/commands/avataredit/steamcard.js @@ -42,7 +42,7 @@ module.exports = class SteamCardCommand extends Command { nothing.print(font, 38, 20, userDisplayName); nothing.getBuffer(Jimp.MIME_PNG, (err, buff) => { if (err) return message.say(':x: Error! Something went wrong!'); - return message.channel.send({file: {attachment: buff} }); + return message.channel.send({file: {attachment: buff}}); }); } }; diff --git a/commands/games/lottery.js b/commands/games/lottery.js index 2b61cd20..a5225e9b 100644 --- a/commands/games/lottery.js +++ b/commands/games/lottery.js @@ -15,9 +15,9 @@ module.exports = class LotteryCommand extends Command { if (message.channel.type !== 'dm') { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; } - const lottery = ['Winner'][Math.floor(Math.random() * 100)]; + const lottery = Math.floor(Math.random() * 100) + 1; const userName = message.author.username; - if (lottery !== 'Winner') return message.say(`Nope, sorry ${userName}, you lost.`); + if (lottery < 100) return message.say(`Nope, sorry ${userName}, you lost.`); return message.say(`Wow ${userName}! You actually won! Great job!`); } }; diff --git a/commands/games/mathgame.js b/commands/games/mathgame.js index 9b0a8a05..71251aba 100644 --- a/commands/games/mathgame.js +++ b/commands/games/mathgame.js @@ -49,7 +49,7 @@ module.exports = class MathGameCommand extends Command { } const value1 = Math.floor(Math.random() * value) + 1; const value2 = Math.floor(Math.random() * value) + 1; - const expression = value1 + operation + value2; + const expression = `${value1} ${operation}${value2}`; const solved = math.eval(expression); const embed = new RichEmbed() .setTitle('You have **ten** seconds to answer:') @@ -65,8 +65,7 @@ module.exports = class MathGameCommand extends Command { return message.say(`Aw... Too bad, try again next time!\nThe correct answer is: ${solved}`); } return message.say(`Good Job! You won! ${solved} is the correct answer!`); - } - catch (err) { + } catch (err) { return message.say(`Aw... Too bad, try again next time!\nThe correct answer is: ${solved}`); } } diff --git a/commands/games/quiz.js b/commands/games/quiz.js index 89f1561c..c3d65723 100644 --- a/commands/games/quiz.js +++ b/commands/games/quiz.js @@ -40,12 +40,10 @@ module.exports = class QuizCommand extends Command { return message.say(`The correct answer is: ${answer}`); } return message.say(`Perfect! The correct answer is: ${answer}`); - } - catch (err) { + } catch (err) { return message.say(`Aw... Too bad, try again next time!\nThe Correct Answer was: ${answer}`); } - } - catch (err) { + } catch (err) { return message.say(':x: Error! Something went wrong!'); } } diff --git a/commands/games/rockpaperscissors.js b/commands/games/rockpaperscissors.js index 75da29b4..77272b74 100644 --- a/commands/games/rockpaperscissors.js +++ b/commands/games/rockpaperscissors.js @@ -36,13 +36,11 @@ module.exports = class RockPaperScissorsCommand extends Command { if (response === 'Rock') return message.say('Rock! Aw, it\'s a tie!'); if (response === 'Paper') return message.say('Paper! Yes! I win!'); if (response === 'Scissors') return message.say('Scissors! Aw... I lose...'); - } - else if (rps === 'paper') { + } else if (rps === 'paper') { if (response === 'Rock') return message.say('Rock! Aw... I lose...'); if (response === 'Paper') return message.say('Paper! Aw, it\'s a tie!'); if (response === 'Scissors') return message.say('Scissors! Yes! I win!'); - } - else if (rps === 'scissors') { + } else if (rps === 'scissors') { if (response === 'Rock') return message.say('Rock! Yes! I win!'); if (response === 'Paper') return message.say('Paper! Aw... I lose...'); if (response === 'Scissors') return message.say('Scissors! Aw, it\'s a tie!'); diff --git a/commands/games/slots.js b/commands/games/slots.js index 331e20b7..1c924a04 100644 --- a/commands/games/slots.js +++ b/commands/games/slots.js @@ -23,8 +23,6 @@ module.exports = class SlotsCommand extends Command { if (slotOne === slotTwo && slotOne === slotThree && slotOne === slotFour) { return message.say(`${slotOne}|${slotTwo}|${slotThree}|${slotFour}\nWow! You won! Great job... er... luck!`); } - else { - return message.say(`${slotOne}|${slotTwo}|${slotThree}|${slotFour}\nAww... You lost... Guess it's just bad luck, huh?`); - } + return message.say(`${slotOne}|${slotTwo}|${slotThree}|${slotFour}\nAww... You lost... Guess it's just bad luck, huh?`); } }; diff --git a/commands/games/typinggame.js b/commands/games/typinggame.js index 03e63f17..85513585 100644 --- a/commands/games/typinggame.js +++ b/commands/games/typinggame.js @@ -65,9 +65,8 @@ module.exports = class TypingGameCommand extends Command { return message.say('Nope, your sentence does not match the original. Try again next time!'); } return message.say(`Good Job! You won!`); - } - catch (err) { - return message.say('Aw... Too bad, try again next time!'); + } catch (err) { + return message.say('Aw... Too bad, try again next time!'); } } }; diff --git a/commands/moderation/ban.js b/commands/moderation/ban.js index 04034dbd..d6e1b25f 100644 --- a/commands/moderation/ban.js +++ b/commands/moderation/ban.js @@ -30,6 +30,7 @@ module.exports = class BanCommand extends Command { }] }); } + hasPermission(msg) { return msg.member.hasPermission('BAN_MEMBERS'); } @@ -42,9 +43,7 @@ module.exports = class BanCommand extends Command { } if (!message.guild.channels.exists('name', 'mod_logs')) return message.say(':x: Error! Could not find the mod_logs channel! Please create it!'); let member = message.guild.member(args.member); - if (!member) { - member = await message.guild.fetchMember(args.member); - } + if (!member) member = await message.guild.fetchMember(args.member); const reason = args.reason; if (!member.bannable) return message.say(':x: Error! This member cannot be banned! Perhaps they have a higher role than me?'); try { @@ -56,8 +55,7 @@ module.exports = class BanCommand extends Command { .setTimestamp() .setDescription(`**Member:** ${member.user.tag} (${member.id})\n**Action:** Ban\n**Reason:** ${reason}`); return message.guild.channels.find('name', 'mod_logs').send({embed}); - } - catch (err) { + } catch (err) { return message.say(':x: Error! Something went wrong!'); } } diff --git a/commands/moderation/kick.js b/commands/moderation/kick.js index 90be7b4f..f7253686 100644 --- a/commands/moderation/kick.js +++ b/commands/moderation/kick.js @@ -27,6 +27,7 @@ module.exports = class KickCommand extends Command { }] }); } + hasPermission(msg) { return msg.member.hasPermission('KICK_MEMBERS'); } @@ -39,9 +40,7 @@ module.exports = class KickCommand extends Command { } if (!message.guild.channels.exists('name', 'mod_logs')) return message.say(':x: Error! Could not find the mod_logs channel! Please create it!'); let member = message.guild.member(args.member); - if (!member) { - member = await message.guild.fetchMember(args.member); - } + if (!member) member = await message.guild.fetchMember(args.member); const reason = args.reason; if (!member.bannable) return message.say(':x: Error! This member cannot be kicked! Perhaps they have a higher role than me?'); try { @@ -53,8 +52,7 @@ module.exports = class KickCommand extends Command { .setTimestamp() .setDescription(`**Member:** ${member.user.tag} (${member.id})\n**Action:** Kick\n**Reason:** ${reason}`); return message.guild.channels.find('name', 'mod_logs').send({embed}); - } - catch (err) { + } catch (err) { return message.say(':x: Error! Something went wrong!'); } } diff --git a/commands/moderation/lockdown.js b/commands/moderation/lockdown.js index e392a574..90417d03 100644 --- a/commands/moderation/lockdown.js +++ b/commands/moderation/lockdown.js @@ -22,6 +22,7 @@ module.exports = class LockdownCommand extends Command { }] }); } + hasPermission(msg) { return msg.member.hasPermission('ADMINISTRATOR'); } @@ -38,8 +39,7 @@ module.exports = class LockdownCommand extends Command { SEND_MESSAGES: false }); return message.say('**Lockdown Started, users without Administrator can no longer post messages. Please use `;lockdown stop` to end the lockdown.**'); - } - catch (err) { + } catch (err) { return message.say(':x: Error! Something went wrong!'); } } @@ -49,8 +49,7 @@ module.exports = class LockdownCommand extends Command { SEND_MESSAGES: true }); return message.say('**Lockdown Ended, users without Administrator can now post messages.**'); - } - catch (err) { + } catch (err) { return message.say(':x: Error! Something went wrong!'); } } diff --git a/commands/moderation/prune.js b/commands/moderation/prune.js index 293f05f0..3a2cc892 100644 --- a/commands/moderation/prune.js +++ b/commands/moderation/prune.js @@ -34,6 +34,7 @@ module.exports = class PruneCommand extends Command { }] }); } + hasPermission(msg) { return msg.member.hasPermission('MANAGE_MESSAGES'); } @@ -51,8 +52,7 @@ module.exports = class PruneCommand extends Command { }); await message.channel.bulkDelete(messages, true); return null; - } - catch (err) { + } catch (err) { return message.say(':x: Error! Something went wrong! Perhaps there are not enough messages in the channel from earlier than two weeks?'); } } diff --git a/commands/moderation/unban.js b/commands/moderation/unban.js index 3471cfcf..42407780 100644 --- a/commands/moderation/unban.js +++ b/commands/moderation/unban.js @@ -36,6 +36,7 @@ module.exports = class UnbanCommand extends Command { }] }); } + hasPermission(msg) { return msg.member.hasPermission('BAN_MEMBERS'); } @@ -61,8 +62,7 @@ module.exports = class UnbanCommand extends Command { .setTimestamp() .setDescription(`**Member:** ${unbanUser.tag} (${unbanUser.id})\n**Action:** Unban\n**Reason:** ${reason}`); return message.guild.channels.find('name', 'mod_logs').send({embed}); - } - catch (err) { + } catch (err) { return message.say(':x: Error! Something went wrong!'); } } diff --git a/commands/moderation/warn.js b/commands/moderation/warn.js index 3fb351eb..33ece60f 100644 --- a/commands/moderation/warn.js +++ b/commands/moderation/warn.js @@ -27,6 +27,7 @@ module.exports = class WarnCommand extends Command { }] }); } + hasPermission(msg) { return msg.member.hasPermission('MANAGE_MESSAGES'); } @@ -37,9 +38,7 @@ module.exports = class WarnCommand extends Command { if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say(':x: Error! I don\'t have the Embed Links Permission!'); } let member = message.guild.member(args.member); - if (!member) { - member = await message.guild.fetchMember(args.member); - } + if (!member) member = await message.guild.fetchMember(args.member); const reason = args.reason; if (!message.guild.channels.exists('name', 'mod_logs')) return message.say(':x: Error! Could not find the mod_logs channel! Please create it!'); try { @@ -50,8 +49,7 @@ module.exports = class WarnCommand extends Command { .setTimestamp() .setDescription(`**Member:** ${member.user.tag} (${member.id})\n**Action:** Warn\n**Reason:** ${reason}`); return message.guild.channels.find('name', 'mod_logs').send({embed}); - } - catch (err) { + } catch (err) { return message.say(':x: Error! Something went wrong!'); } } diff --git a/commands/random/math.js b/commands/random/math.js index e0677a2e..6e401682 100644 --- a/commands/random/math.js +++ b/commands/random/math.js @@ -31,8 +31,7 @@ module.exports = class MathCommand extends Command { try { const solved = math.eval(expression); return message.say(solved).catch(() => message.say(':x: Error! Invalid statement!')); - } - catch (err) { + } catch (err) { return message.say(':x: Error! Invalid statement!'); } } diff --git a/commands/random/today.js b/commands/random/today.js index 476c039a..39acb846 100644 --- a/commands/random/today.js +++ b/commands/random/today.js @@ -34,8 +34,7 @@ module.exports = class TodayCommand extends Command { .setTimestamp() .setDescription(`${events[randomNumber].text} (${events[randomNumber].year})`); return message.embed(embed); - } - catch (err) { + } catch (err) { return message.say(':x: Error! Something went wrong!'); } } diff --git a/commands/response/name.js b/commands/response/name.js index 8017b6f0..e6143170 100644 --- a/commands/response/name.js +++ b/commands/response/name.js @@ -37,8 +37,7 @@ module.exports = class RandomNameCommand extends Command { let name = ['Bob', 'Daniel', 'Logan', 'Chris', 'Nathan', 'George', 'Mart', 'Charlie', 'Felix', 'Ralph', 'William', 'Max', 'Jerry', 'Marty', 'Joshua', 'Cody', 'Richard', 'Alex', 'Alexander', 'Jordan', 'Zachary', 'Bill', 'Alfred', 'Bruce', 'Caiden', 'Calvin', 'Eric', 'Robert', 'Mark', 'Miles', 'Nash', 'Ronald', 'Ivan', 'Edgar', 'Royal', 'Augustine', 'Dominic', 'Noel', 'Rocky', 'Grover', 'Paul', 'Jeremy', 'Stevie', 'Brock', 'Jc', 'Tony', 'Enoch', 'Zachery', 'Harvey', 'Gilbert', 'Chang', 'Emery', 'Carroll', 'Odell', 'Jean', 'Archie', 'Russ', 'Barry', 'Lowell', 'Jacob', 'Riku', 'Frederic', 'Levi', 'Faustino', 'Leland', 'Domenic', 'Irwin', 'Moises', 'Louie', 'Larry', 'Victor']; name = name[Math.floor(Math.random() * name.length)]; return message.say(`${name} ${lastName}`); - } - else if (gender === 'female') { + } else if (gender === 'female') { let name = ['Elizabeth', 'Chelsey', 'Rachel', 'Logan', 'Alex', 'Jordan', 'Mary', 'Shirley', 'Sandy', 'Linda', 'Audrey', 'Autumn', 'Gracie', 'Grace', 'Erin', 'Catherine', 'Stephanie', 'Lucy', 'Patty', 'Julie', 'Christina', 'Fiona', 'Riley', 'Ashley', 'Bree', 'Lucila', 'Wendi', 'Evangelina', 'Ricki', 'Merna', 'Tegan', 'Venus', 'Claris', 'Tana', 'Sakura', 'Edythe', 'Adena', 'Princess', 'Elnora', 'Star', 'Edyth', 'Beverly', 'Kelsie', 'Letha', 'Latisha', 'Lolita', 'Bernandine', 'Jessenia', 'Hannah', 'Leonore', 'Alene', 'Fannie', 'Bernardine', 'Leena', 'Tera', 'Yvette', 'Melisa', 'Alissa', 'Xiao', 'Richelle', 'Bridgett', 'Sumiko', 'Paulette', 'Charlott', 'Honey', 'Veola', 'Sherita', 'Amanda', 'Vannessa', 'April', 'Ruth']; name = name[Math.floor(Math.random() * name.length)]; return message.say(`${name} ${lastName}`); diff --git a/commands/search/botinfo.js b/commands/search/botinfo.js index 75d21ca2..3db02b0a 100644 --- a/commands/search/botinfo.js +++ b/commands/search/botinfo.js @@ -48,8 +48,7 @@ module.exports = class BotSearchCommand extends Command { .addField('**Invite:**', `[Here](${data.invite_url})`, true); return message.embed(embed); - } - catch (err) { + } catch (err) { return message.say(':x: Error! Bot not Found!'); } } diff --git a/commands/search/define.js b/commands/search/define.js index 8e7d3fec..d73b7110 100644 --- a/commands/search/define.js +++ b/commands/search/define.js @@ -39,8 +39,7 @@ module.exports = class DefineCommand extends Command { .setTitle(data.word) .setDescription(data.text); return message.embed(embed); - } - catch (err) { + } catch (err) { return message.say(':x: Error! Word not Found!'); } } diff --git a/commands/search/forecast.js b/commands/search/forecast.js index ce7ea69a..abd21695 100644 --- a/commands/search/forecast.js +++ b/commands/search/forecast.js @@ -52,8 +52,7 @@ module.exports = class ForecastCommand extends Command { .addField(`**${data[6].day} - ${data[6].date}:**`, `**High:** ${data[6].high}°F, **Low:** ${data[6].low}°F, **Condition:** ${data[6].text}`); return message.embed(embed); - } - catch (err) { + } catch (err) { return message.say(':x: Error! Make sure you typed the location correctly!'); } } diff --git a/commands/search/google.js b/commands/search/google.js index d24f4a76..8ffdb293 100644 --- a/commands/search/google.js +++ b/commands/search/google.js @@ -35,8 +35,7 @@ module.exports = class GoogleCommand extends Command { let href = $('.r').first().find('a').first().attr('href'); href = querystring.parse(href.replace('/url?', '')); return msg.edit(href.q); - } - catch (err) { + } catch (err) { return msg.edit(':x: Error! No Results Found!'); } } diff --git a/commands/search/imdb.js b/commands/search/imdb.js index d7ada0f8..cdc41dec 100644 --- a/commands/search/imdb.js +++ b/commands/search/imdb.js @@ -54,8 +54,7 @@ module.exports = class IMDBCommand extends Command { .addField('**Actors:**', data.Actors); return message.embed(embed); - } - catch (err) { + } catch (err) { return message.say(':x: Error! Movie not found!'); } } diff --git a/commands/search/map.js b/commands/search/map.js index b71860e6..156f4899 100644 --- a/commands/search/map.js +++ b/commands/search/map.js @@ -40,9 +40,8 @@ module.exports = class MapCommand extends Command { try { const response = await snekfetch .get(`https://maps.googleapis.com/maps/api/staticmap?center=${location}&zoom=${zoom}&size=500x500&key=${process.env.GOOGLE_KEY}`); - return message.channel.send({file: {attachment: response.body} }); - } - catch (err) { + return message.channel.send({file: {attachment: response.body}}); + } catch (err) { return message.say(':x: Error! Something went wrong! Make sure you entered the location correctly!'); } } diff --git a/commands/search/neopet.js b/commands/search/neopet.js index ad2b3da3..e1644212 100644 --- a/commands/search/neopet.js +++ b/commands/search/neopet.js @@ -31,8 +31,7 @@ module.exports = class NeopetCommand extends Command { const link = $('textarea').first().text(); if (!link.includes('cp')) return message.say(':x: Error! Pet not found!'); return message.say(link); - } - catch (err) { + } catch (err) { return message.say(':x: Error! Something went wrong!'); } } diff --git a/commands/search/osu.js b/commands/search/osu.js index 3a635d5b..b591159a 100644 --- a/commands/search/osu.js +++ b/commands/search/osu.js @@ -62,8 +62,7 @@ module.exports = class OsuCommand extends Command { .addField('**A:**', data.count_rank_a, true); return message.embed(embed); - } - catch (err) { + } catch (err) { return message.say(':x: Error! User not Found!'); } } diff --git a/commands/search/pokedex.js b/commands/search/pokedex.js deleted file mode 100644 index 14911b36..00000000 --- a/commands/search/pokedex.js +++ /dev/null @@ -1,69 +0,0 @@ -const { Command } = require('discord.js-commando'); -const { RichEmbed } = require('discord.js'); -const snekfetch = require('snekfetch'); -const cheerio = require('cheerio'); - -module.exports = class PokedexCommand extends Command { - constructor(client) { - super(client, { - name: 'pokedex', - aliases: [ - 'pokemon' - ], - group: 'search', - memberName: 'pokedex', - description: 'Gives the pokedex entry for a Pokemon. (;pokedex 001)', - examples: [';pokedex 001'], - args: [{ - key: 'index', - prompt: 'What Pokémon would you like to get info on?', - type: 'integer', - validate: pokemon => { - if (pokemon < 803 && pokemon > 0) { - return true; - } - return 'Please enter a pokedex number from 001-802'; - } - }] - }); - } - - async run(message, args) { - if (message.channel.type !== 'dm') { - if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; - if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say(':x: Error! I don\'t have the Embed Links Permission!'); - } - let index = args.index; - let dex = 'xy'; - let location = 'foox'; - let location2 = 'fooy'; - if (index > 721) { - dex = 'sm'; - location = 'foosun'; - location2 = 'foomoon'; - } - index = index.toString(); - const pad = '000'.slice(index.length); - index = `${pad}${index}`; - try { - const response = await snekfetch - .get(`http://www.serebii.net/pokedex-${dex}/${index}.shtml`); - const $ = cheerio.load(response.text); - const entry = $(`td.${location}`).eq(1).next().text(); - const entry2 = $(`td.${location2}`).eq(1).next().text(); - const embed = new RichEmbed() - .setAuthor(`#${index}`, `http://www.serebii.net/pokedex-sm/icon/${index}.png`) - .setColor(0xFF0000) - .setFooter('Pokédex', 'http://cdn.bulbagarden.net/upload/thumb/3/36/479Rotom-Pokédex.png/250px-479Rotom-Pokédex.png') - .setThumbnail(`http://www.serebii.net/sunmoon/pokemon/${index}.png`) - .addField('**Entry 1:**', - entry) - .addField('**Entry 2:**', - entry2); - return message.embed(embed); - } - catch (err) { - return message.say(':x: Error! Something went wrong!'); - } - } -}; diff --git a/commands/search/urban.js b/commands/search/urban.js index 82e1b8fb..915b0b2e 100644 --- a/commands/search/urban.js +++ b/commands/search/urban.js @@ -42,8 +42,7 @@ module.exports = class UrbanCommand extends Command { .addField('**Example:**', data.example.substr(0, 1900) || 'None'); return message.embed(embed); - } - catch (err) { + } catch (err) { return message.say(':x: Error! Word not found!'); } } diff --git a/commands/search/wattpad.js b/commands/search/wattpad.js index 68793700..23c54c08 100644 --- a/commands/search/wattpad.js +++ b/commands/search/wattpad.js @@ -50,8 +50,7 @@ module.exports = class WattpadCommand extends Command { .addField('**Comments:**', data.commentCount, true); return message.embed(embed); - } - catch (err) { + } catch (err) { return message.say(':x: Error! Book not Found!'); } } diff --git a/commands/search/weather.js b/commands/search/weather.js index aba794fd..af6c8e16 100644 --- a/commands/search/weather.js +++ b/commands/search/weather.js @@ -58,8 +58,7 @@ module.exports = class WeatherCommand extends Command { .addField('**Wind Speed:**', data.wind.speed, true); return message.embed(embed); - } - catch (err) { + } catch (err) { return message.say(':x: Error! Make sure you typed the location correctly!'); } } diff --git a/commands/search/wikipedia.js b/commands/search/wikipedia.js index 9a9c86e3..ac28f184 100644 --- a/commands/search/wikipedia.js +++ b/commands/search/wikipedia.js @@ -37,8 +37,7 @@ module.exports = class WikipediaCommand extends Command { .setAuthor('Wikipedia', 'https://upload.wikimedia.org/wikipedia/en/thumb/8/80/Wikipedia-logo-v2.svg/1122px-Wikipedia-logo-v2.svg.png') .setDescription(description); return message.embed(embed); - } - catch (err) { + } catch (err) { return message.say(':x: Error! Entry Not Found!'); } } diff --git a/commands/search/youtube.js b/commands/search/youtube.js index d7c90abf..1e9bd353 100644 --- a/commands/search/youtube.js +++ b/commands/search/youtube.js @@ -39,8 +39,7 @@ module.exports = class YouTubeCommand extends Command { .setURL(`https://www.youtube.com/watch?v=${data.id.videoId}`) .setThumbnail(data.snippet.thumbnails.default.url); return message.embed(embed); - } - catch (err) { + } catch (err) { return message.say(':x: Error! Something went wrong! Maybe no video was found?'); } } diff --git a/commands/search/yugioh.js b/commands/search/yugioh.js index d3bc990d..8bf02828 100644 --- a/commands/search/yugioh.js +++ b/commands/search/yugioh.js @@ -56,8 +56,7 @@ module.exports = class YuGiOhCommand extends Command { .addField('**Card Type:**', data.card_type, true); return message.embed(embed); - } - catch (err) { + } catch (err) { return message.say(':x: Error! Card not Found!\n:notepad_spiral: Note: This command is **extremely** sensitive to casing and dashes and whatnot. Type the *exact* card name to get data!'); } } diff --git a/commands/textedit/binary.js b/commands/textedit/binary.js index 89ac6681..88b58d5a 100644 --- a/commands/textedit/binary.js +++ b/commands/textedit/binary.js @@ -1,10 +1,10 @@ const { Command } = require('discord.js-commando'); const stringToBinary = (str) => { - const pad = "00000000"; + const pad = '00000000'; return unescape(encodeURIComponent(str)) .split('').map(str => { const binary = str.charCodeAt(0).toString(2); - return pad.slice(binary.length) + binary; + return `${pad.slice(binary.length)}${binary}`; }).join(''); }; diff --git a/commands/textedit/webhook.js b/commands/textedit/webhook.js index 1aad8f6d..a3538028 100644 --- a/commands/textedit/webhook.js +++ b/commands/textedit/webhook.js @@ -21,6 +21,7 @@ module.exports = class WebhookCommand extends Command { }] }); } + hasPermission(msg) { return this.client.isOwner(msg.author); } @@ -39,8 +40,7 @@ module.exports = class WebhookCommand extends Command { content: text }); return null; - } - catch (err) { + } catch (err) { return message.say(':x: Error! Message failed to send!'); } } diff --git a/commands/util/info.js b/commands/util/info.js index e42f3a4b..bfc5d670 100644 --- a/commands/util/info.js +++ b/commands/util/info.js @@ -19,7 +19,7 @@ module.exports = class InfoCommand extends Command { }); } - async run(message, args) { + async run(message) { if (message.channel.type !== 'dm') { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say(':x: Error! I don\'t have the Embed Links Permission!'); @@ -33,7 +33,7 @@ module.exports = class InfoCommand extends Command { .addField('Shards', `${this.client.options.shardCount} (${this.client.shard.id})`, true) .addField('Commands', - '108', true) + '106', true) .addField('Owner', 'dragonfire535#8081', true) .addField('Source Code', diff --git a/commands/util/servers.js b/commands/util/servers.js deleted file mode 100644 index e9ef308f..00000000 --- a/commands/util/servers.js +++ /dev/null @@ -1,29 +0,0 @@ -const { Command } = require('discord.js-commando'); - -module.exports = class ServersCommand extends Command { - constructor(client) { - super(client, { - name: 'servers', - aliases: [ - 'serverlist' - ], - group: 'util', - memberName: 'servers', - description: 'Sends a list of all server names and IDs to the log. (;servers)', - examples: [';servers'] - }); - } - hasPermission(msg) { - return this.client.isOwner(msg.author); - } - - run(message) { - if (message.channel.type !== 'dm') { - if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; - } - const guildCount = this.client.guilds.size; - const guildNames = this.client.guilds.map(g => `${g.name} (${g.id})`).join(', '); - console.log(`${guildCount} Servers: ${guildNames}`); - return message.say('Sent the information to the console!'); - } -}; diff --git a/commands/util/shardinfo.js b/commands/util/shardinfo.js index dfd6a42e..3691dce1 100644 --- a/commands/util/shardinfo.js +++ b/commands/util/shardinfo.js @@ -32,9 +32,7 @@ module.exports = class ShardInfoCommand extends Command { if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say(':x: Error! I don\'t have the Embed Links Permission!'); } const shardID = args.shardID; - if (shardID > this.client.options.shardCount - 1 || shardID < 0) { - return message.say(':x: Error! Invalid Shard!'); - } + if (shardID > this.client.options.shardCount - 1 || shardID < 0) return message.say(':x: Error! Invalid Shard!'); const memory = await this.client.shard.broadcastEval('Math.round(process.memoryUsage().heapUsed / 1024 / 1024)'); const uptime = await this.client.shard.fetchClientValues('uptime'); const guilds = await this.client.shard.fetchClientValues('guilds.size'); diff --git a/html/carbondesc.html b/html/carbondesc.html index bb814410..e9970947 100644 --- a/html/carbondesc.html +++ b/html/carbondesc.html @@ -13,7 +13,9 @@