diff --git a/bot.js b/bot.js index 93a12ad..307c4b7 100644 --- a/bot.js +++ b/bot.js @@ -4,12 +4,11 @@ const config = require('./config.json'); const fs = require('fs'); const readline = require('readline'); const DBL = require('dblapi.js'); -if (typeof config.dbltoken == 'undefined') { - console.log("Skipping DBL..."); +if (typeof config.dbltoken === 'undefined') { + console.log('Skipping DBL...'); } else { - bot.dbl = new DBL(config.dbltoken, bot); - console.log("DBL has been found..."); - + bot.dbl = new DBL(config.dbltoken, bot); + console.log('DBL has been found...'); } @@ -28,21 +27,21 @@ bot.plugins = { settings : require('./plugins/settings.js'), whitelist: require('./plugins/whitelist.js'), gyms : require('./plugins/gyms.js')}; -cmdLoader(); + bot.Raven = require('raven'); bot.Raven.config(config.sentry).install(); bot.gyms = new Discord.Collection(); -async function cmdLoader() { - const categories = await fs.readdirSync('./commands'); +function cmdLoader() { + const categories = fs.readdirSync('./commands'); console.log(`Loading ${categories.length} categories(s) into memory\n`); categories.forEach(x => { loadGroup(x); }); } -async function loadGroup(name) { - const files = await fs.readdirSync(`./commands/${name}`); +function loadGroup(name) { + const files = fs.readdirSync(`./commands/${name}`); console.log(`Loading the category '${name}' into memory with a total of ${files.length} command(s)`); @@ -59,7 +58,7 @@ async function loadGroup(name) { console.log(`The category ${name} has been loaded.\n`); } -async function loadCmd(category, cmd) { +function loadCmd(category, cmd) { try { console.log(`Loading the Command ${cmd.split('.')[0]}`); const command = require(`./commands/${category}/${cmd}`); @@ -68,8 +67,7 @@ async function loadCmd(category, cmd) { console.log(`Loading the alias ${alias} for the command ${command.help.name}`); bot.aliases.get(category).set(alias, command.help.name); }); - } - catch (err) { + } catch (err) { console.log(`An error has occured trying to load the command '${cmd.split('.')[0]}'`); console.log(err.stack); bot.Raven.captureException(err); @@ -78,7 +76,9 @@ async function loadCmd(category, cmd) { fs.readdir('./events', (err, files) => { - if (err) console.error(err); + if (err) { + console.error(err); + } console.log(`Attempting to load a total of ${files.length} events into the memory.`); files.forEach(file => { try { @@ -87,8 +87,7 @@ fs.readdir('./events', (err, files) => { console.log(`Attempting to load the event "${eventName}".`); bot.on(eventName, event.bind(null, bot)); delete require.cache[require.resolve(`./events/${file}`)]; - } - catch (err) { + } catch (err) { console.log('An error has occured trying to load a event. Here is the error.'); console.log(err.stack); bot.Raven.captureException(err); @@ -101,69 +100,69 @@ fs.readdir('./events', (err, files) => { rl.on('line', function(cmd) { const args = cmd.split(' '); switch (args[0]) { - case 'guilds': - if (bot.guilds.size === 0) { - console.log(('[!] No guilds found.')); - } else { - console.log('[i] Here\'s the servers that PokeBot is connected to:'); - for (const [id, guild] of bot.guilds) { - console.log(` Guild Name: ${guild.name} - ID: ${guild.id}`); - } + case 'guilds': + if (bot.guilds.size === 0) { + console.log(('[!] No guilds found.')); + } else { + console.log('[i] Here\'s the servers that PokeBot is connected to:'); + for (const guild of bot.guilds) { + console.log(` Guild Name: ${guild[1].name} - ID: ${guild[1].id}`); } - break; - case 'channels': - if (!args[1]) { - console.log('[!] Please insert the guild\'s ID.'); - } else { - var guild = bot.guilds.get(args[1]); - console.log('[i] Here\'s the channels that this guild have:'); - for ([id, channel, guild] of guild && bot.channels) { - console.log(` Channel: #${channel.name} - ID: ${channel.id}`); - } + } + break; + case 'channels': + if (!args[1]) { + console.log('[!] Please insert the guild\'s ID.'); + } else { + const guild = bot.guilds.get(args[1]); + console.log('[i] Here\'s the channels that this guild have:'); + for (const channel of guild && bot.channels) { + console.log(` Channel: #${channel[1].name} - ID: ${channel[1].id}`); } - break; - case 'leave': - if (!args[1]) { - console.log('[!] Please insert the guild\'s ID.'); - } else { - var guild = bot.guilds.get(args[1]); - guild.leave(); + } + break; + case 'leave': + if (!args[1]) { + console.log('[!] Please insert the guild\'s ID.'); + } else { + bot.guilds.get(args[1]).leave(); + } + break; + case 'broadcast': + if (!args[1]) { + console.log('[!] Please insert the guild\'s ID.'); + } else { + const broadcast = args.join(' ').slice(48); + let guild = null; + guild = bot.guilds.get(args[1]); + let channel = null; + channel = guild.channels.get(args[2]); + if (channel != null) { + channel.send(broadcast); } - break; - case 'broadcast': - if (!args[1]) { - console.log('[!] Please insert the guild\'s ID.'); - } else { - const broadcast = args.join(' ').slice(48); - var guild = null; - guild = bot.guilds.get(args[1]); - var channel = null; - channel = guild.channels.get(args[2]); - if (channel != null) { - channel.send(broadcast); - } - if (channel = null) { - console.log ('Usage: broadcast [guildID] [channelID]'); - } + if (channel == null) { + console.log('Usage: broadcast [guildID] [channelID]'); } - break; - case 'exit': - console.log('[i] PokeBot will now exit!'); - bot.user.setStatus('invisible'); - process.exit(0); - break; - case 'help': - var msg = ('PokeBot Console Help\n\n'); - msg += ('guilds - Shows all guilds that PokeBot\'s on.\n'); - msg += ('channels - Shows all the channels that the guilds have.\n'); - msg += ('leave - Leaves a guild.\n'); - msg += ('broadcast - Broadcasts a message to a server.\n'); - msg += ('help - Shows this command.\n'); - msg += ('exit - Exits PokeBot.\n'); - console.log(msg); - break; - default: - console.log('Unknown Command type \'help\' to list the commands...'); + } + break; + case 'exit': + console.log('[i] PokeBot will now exit!'); + bot.user.setStatus('invisible'); + process.exit(0); + break; + case 'help': { + let msg = ('PokeBot Console Help\n\n'); + msg += ('guilds - Shows all guilds that PokeBot\'s on.\n'); + msg += ('channels - Shows all the channels that the guilds have.\n'); + msg += ('leave - Leaves a guild.\n'); + msg += ('broadcast - Broadcasts a message to a server.\n'); + msg += ('help - Shows this command.\n'); + msg += ('exit - Exits PokeBot.\n'); + console.log(msg); + break; + } + default: + console.log('Unknown Command type \'help\' to list the commands...'); } rl.prompt(); }); @@ -172,6 +171,7 @@ process.on('unhandledRejection', (err) => { console.error(err.stack); bot.Raven.captureException(err); }); +cmdLoader(); bot.login(config.token).then(() => { rl.prompt(); }); diff --git a/commands/Fun/8ball.js b/commands/Fun/8ball.js index 48f53e0..23846a3 100644 --- a/commands/Fun/8ball.js +++ b/commands/Fun/8ball.js @@ -7,8 +7,10 @@ * * *************************************/ -exports.run = async (bot, msg, args) => { - if (args.length < 1) return msg.reply('You need to ask the 8-ball something for it to respond!'); +exports.run = (bot, msg, args) => { + if (args.length < 1) { + return msg.reply('You need to ask the 8-ball something for it to respond!'); + } const responses = [ 'May the odds ever be in your favor...', @@ -38,19 +40,19 @@ exports.run = async (bot, msg, args) => { 'My reply is no', 'My sources say no', 'Outlook not so good', - 'Very doubtful', + 'Very doubtful' ]; - msg.channel.send(':8ball: *' + (responses[Math.floor(Math.random() * responses.length)]) + '*'); + msg.channel.send(`:8ball: *${responses[Math.floor(Math.random() * responses.length)]}*`); }; exports.conf = { aliases: ['ask'], - guildOnly: true, + guildOnly: true }; exports.help = { name: '8ball', description: 'Ask the magic 8-ball something. It will answer back, and be as much of a smart-alac as it wants to.', - usage: '<...question>', + usage: '<...question>' }; diff --git a/commands/Fun/balance.js b/commands/Fun/balance.js index afe094e..1a7995b 100644 --- a/commands/Fun/balance.js +++ b/commands/Fun/balance.js @@ -9,15 +9,15 @@ exports.run = async (bot, msg) => { const credits = await bot.plugins.economy.get(msg.author.id); - msg.reply(credits + ' credits'); + msg.reply(`${credits} credits`); }; exports.conf = { aliases: ['bal', 'money', 'credits'], - guildOnly: true, + guildOnly: true }; exports.help = { name: 'balance', - description: 'Check your balance!', + description: 'Check your balance!' }; diff --git a/commands/Fun/cureboredom.js b/commands/Fun/cureboredom.js index 4b99406..f9ae256 100644 --- a/commands/Fun/cureboredom.js +++ b/commands/Fun/cureboredom.js @@ -26,20 +26,22 @@ exports.run = (bot, msg, args) => { 'Messing with Rich Presence :gear:', 'Making videos :movie_camera:', 'Taking pictures :camera:', - 'Suggesting things for the server :dancers:', + 'Suggesting things for the server :dancers:' ]; - if (args[0] === 'list') return msg.channel.send(ideas.join('\n')); + if (args[0] === 'list') { + return msg.channel.send(ideas.join('\n')); + } msg.channel.send(ideas[Math.floor(Math.random() * ideas.length)]); }; exports.conf = { aliases: ['cboredom'], - guildOnly: true, + guildOnly: true }; exports.help = { name: 'cureboredom', - description: 'Finds you something to do.', + description: 'Finds you something to do.' }; diff --git a/commands/Fun/findmyphone.js b/commands/Fun/findmyphone.js index 135d449..bb930ef 100644 --- a/commands/Fun/findmyphone.js +++ b/commands/Fun/findmyphone.js @@ -19,7 +19,7 @@ exports.run = (bot, msg) => { 'Stockton', 'Colorado Springs', 'Portland', - 'Cincinnati', + 'Cincinnati' ]; msg.channel.send(cities[Math.floor(Math.random() * cities.length)]); @@ -27,10 +27,10 @@ exports.run = (bot, msg) => { exports.conf = { aliases: ['findphone', 'findmyiphone', 'findmyandroid', 'findmyandroidphone'], - guildOnly: true, + guildOnly: true }; exports.help = { name: 'findmyphone', - description: 'Find your phone. Not just a random list of cities being randomly picked.', + description: 'Find your phone. Not just a random list of cities being randomly picked.' }; diff --git a/commands/Fun/gamble.js b/commands/Fun/gamble.js index 7921993..8e599dc 100644 --- a/commands/Fun/gamble.js +++ b/commands/Fun/gamble.js @@ -17,55 +17,73 @@ exports.run = async (bot, msg) => { 6, 7, 8, - 9, + 9 ]; const balance = await bot.plugins.economy.get(msg.author.id); - if (balance < 10) return await msg.reply('You don\'t have enough credits (10) to play the slots'); + if (balance < 10) { + return msg.reply('You don\'t have enough credits (10) to play the slots'); + } 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) { + if (number2 == number1 + 1 && number3 == number2 + 1) { await bot.plugins.economy.add(msg.author.id, 1000); const balance = await bot.plugins.economy.get(msg.author.id); - return await msg.channel.send('You won 1000 credits!\nCurrent Balance: ' + balance + ' \n> ' + emojify(number1, number2, number3)); - } - else if (number2 == number3 - 1 && number1 == number2 - 1) { + return msg.channel.send(`You won 1000 credits!\nCurrent Balance: ${ balance } \n> ${ emojify(number1, number2, number3)}`); + } else if (number2 == number3 - 1 && number1 == number2 - 1) { await bot.plugins.economy.add(msg.author.id, 1500); const balance = await bot.plugins.economy.get(msg.author.id); - return await msg.channel.send('You won 1500 credits!\nCurrent Balance: ' + balance + ' \n> ' + emojify(number1, number2, number3)); - } - else { + return msg.channel.send(`You won 1500 credits!\nCurrent Balance: ${ balance } \n> ${ emojify(number1, number2, number3)}`); + } else { await bot.plugins.economy.subtract(msg.author.id, 10); const balance = await bot.plugins.economy.get(msg.author.id); - return await msg.channel.send('Aww, you lost! Better luck next time.\nCurrent Balance: ' + balance + ' \n> ' + emojify(number1, number2, number3)); + return msg.channel.send(`Aww, you lost! Better luck next time.\nCurrent Balance: ${ balance } \n> ${ emojify(number1, number2, number3)}`); } }; function emojify(number1, number2, number3) { - return emote(number1) + ' ' + emote(number2) + ' ' + emote(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:'; + 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: true, + guildOnly: true }; exports.help = { name: 'gamble', - description: 'Develop a gambling addiction by playing Slots!', + description: 'Develop a gambling addiction by playing Slots!' }; diff --git a/commands/Fun/jobs.js b/commands/Fun/jobs.js index f71ba28..d71ac31 100644 --- a/commands/Fun/jobs.js +++ b/commands/Fun/jobs.js @@ -9,31 +9,32 @@ const cooldown = new Set(); exports.run = (bot, msg) => { - if (cooldown.has(msg.author.id)) return msg.reply('You have worked too recently'); + if (cooldown.has(msg.author.id)) { + return msg.reply('You have worked too recently'); + } const jobs = [ - "started a BitCoin farm", - "pissed for an elderly woman", - "became a doctor and illegally sold organs", - "extracted eggs from elderly women", - "became a bus driver", - "started working for Universe Dev Group", - "programmed a Discord bot", - "made a crowdfunding campaign", - "became a news anchor", - "flooded Amsterdam", - "became YouTube famous.", - ] + 'started a BitCoin farm', + 'pissed for an elderly woman', + 'became a doctor and illegally sold organs', + 'extracted eggs from elderly women', + 'became a bus driver', + 'started working for Universe Dev Group', + 'programmed a Discord bot', + 'made a crowdfunding campaign', + 'became a news anchor', + 'flooded Amsterdam', + 'became YouTube famous.' + ]; if (bot.dbl.hasVoted(msg.author.id)) { - var creditsEarned = Math.floor(Math.random() * 650); + const creditsEarned = Math.floor(Math.random() * 650); bot.plugins.economy.add(msg.author.id, creditsEarned); - msg.channel.send('You worked and ' + jobs[Math.floor(Math.random() * jobs.length)] + '\n\nYou earned ' + creditsEarned.toString() + ' credits.'); - } - else { - var creditsEarned = Math.floor(Math.random() * 250); + msg.channel.send(`You worked and ${ jobs[Math.floor(Math.random() * jobs.length)] }\n\nYou earned ${ creditsEarned.toString() } credits.`); + } else { + const creditsEarned = Math.floor(Math.random() * 250); bot.plugins.economy.add(msg.author.id, creditsEarned); - msg.channel.send('You worked and ' + jobs[Math.floor(Math.random() * jobs.length)] + '\n\nYou earned ' + creditsEarned.toString() + ' credits.'); + msg.channel.send(`You worked and ${ jobs[Math.floor(Math.random() * jobs.length)] }\n\nYou earned ${ creditsEarned.toString() } credits.`); } cooldown.add(msg.author.id); setTimeout(() => { @@ -43,10 +44,10 @@ exports.run = (bot, msg) => { exports.conf = { aliases: [], - guildOnly: true, + guildOnly: true }; exports.help = { name: 'jobs', - description: 'Work to add credits to your account.', + description: 'Work to add credits to your account.' }; diff --git a/commands/Fun/og151.js b/commands/Fun/og151.js index d2b3ccf..d14d7dd 100644 --- a/commands/Fun/og151.js +++ b/commands/Fun/og151.js @@ -159,7 +159,7 @@ exports.run = (bot, msg) => { 'Weezing', 'Wigglytuff', 'Zapdos', - 'Zubat', + 'Zubat' ]; msg.channel.send(pokemon[Math.floor(Math.random() * pokemon.length)]); @@ -167,10 +167,10 @@ exports.run = (bot, msg) => { exports.conf = { aliases: [], - guildOnly: true, + guildOnly: true }; exports.help = { name: 'og151', - description: 'Randomly picks one of the generation 1 pokemon, and gives you its name.', + description: 'Randomly picks one of the generation 1 pokemon, and gives you its name.' }; diff --git a/commands/Fun/ship.js b/commands/Fun/ship.js index ba31db5..499ab06 100644 --- a/commands/Fun/ship.js +++ b/commands/Fun/ship.js @@ -8,15 +8,15 @@ * *************************************/ exports.run = (bot, msg) => { - msg.channel.send(msg.author.username + ' x ' + msg.guild.members.random().displayName + ' :cruise_ship:'); + msg.channel.send(`${msg.author.username} x ${msg.guild.members.random().displayName} :cruise_ship:`); }; exports.conf = { aliases: [], - guildOnly: true, + guildOnly: true }; exports.help = { name: 'ship', - description: 'Test the luck of your love life! Ships you with another user.', + description: 'Test the luck of your love life! Ships you with another user.' }; diff --git a/commands/Fun/story.js b/commands/Fun/story.js index c35e3e7..b8a6da6 100644 --- a/commands/Fun/story.js +++ b/commands/Fun/story.js @@ -8,40 +8,38 @@ * *************************************/ exports.run = async (bot, msg) => { - msg.guild.fetchMembers().then(guild => - { - const membersList = guild.members.array(); - const selectedUser1 = membersList[Math.floor(Math.random() * membersList.length)].user; - const selectedUser2 = membersList[Math.floor(Math.random() * membersList.length)].user; - const selectedUser3 = membersList[Math.floor(Math.random() * membersList.length)].user; - const selectedUser4 = membersList[Math.floor(Math.random() * membersList.length)].user; + const guild = await msg.guild.fetchMembers(); + const membersList = guild.members.array(); + const selectedUser1 = membersList[Math.floor(Math.random() * membersList.length)].user; + const selectedUser2 = membersList[Math.floor(Math.random() * membersList.length)].user; + const selectedUser3 = membersList[Math.floor(Math.random() * membersList.length)].user; + const selectedUser4 = membersList[Math.floor(Math.random() * membersList.length)].user; - const stories = + const stories = [ `${selectedUser1.username} bought ${selectedUser2.username} his favorite video game. This game is called "Pokemon". Then, they became best friends.`, `${selectedUser1.username} wants to become a Pokemon trainer, but he needs to get a Pokemon first!`, `One day, ${selectedUser1.username} decided to go to a shop. He took his motorbike. Once he arrived at the shop, he went inside. He headed right, towards the chips. He grabbed a packet, and headed to check-out. He bumped into ${selectedUser2.username} at the counter, and decided to say hi. They had a little chat, and then decided to gossip about ${selectedUser3.username}. Then, as they were saying some horrible things about ${selectedUser3.username}, they unexpectedly showed up! Then, ${selectedUser1.username} and ${selectedUser2.username} got into a fight against ${selectedUser3.username}.\n\nKids, this is why you don't start drama.\nNow ${selectedUser1.username}, ${selectedUser2.username}, and ${selectedUser3.username} are no longer friends.`, `At a point in time, ${selectedUser1.username} was battling ${selectedUser2.username} for a gym. ${selectedUser1.username} chose Sylveon to battle, when ${selectedUser2.username} chose their trusty Eevee. First, Eevee used Tackle, when Sylveon went in for Draining Kiss. Then, ${selectedUser2.username} shouted an expletive. Once they shouted it, ${selectedUser3.username} came inside the room. ${selectedUser3.username} does not like expletives, so they got into an arguement about them. Soon enough, vicr123 got in here too and started using "-" in place of expletives during the argument. Eventually, ${selectedUser2.username} and ${selectedUser3.username} were shouting expletives at each-other, vicr123 was audibly shouting "Dash! Dash you!", while ${selectedUser1.username} was smashing his head on his desk.`, `It was the day of the release of Pokemon Ultra Sun and Ultra Moon. ${selectedUser1.username} and ${selectedUser2.username} decided to go to GameStop to wait in line to grab their pre-order copies. Then, ${selectedUser3.username} came along, and got mad once they realised ${selectedUser1.username} and ${selectedUser2.username} had pre-orders, when ${selectedUser3.username} did not. Eventually, ${selectedUser3.username} started physically assaulting ${selectedUser1.username} when they came outside with their pre-order copy. Then, known police officer ${selectedUser4.username} came up to ${selectedUser3.username} and ${selectedUser1.username} and charged them both for Indecent Exposure, and Assault of the Second Degree.\n\nMoral of the story: Do not get into an assualt over a video-game, like ${selectedUser3.username} and ${selectedUser1.username} did.`, - `${selectedUser1.username} played this new game called Pokemon (this is back in 1996) and his friend ${selectedUser2.username} also bought that game. And then Victor Tran decided to say "Ooh! What's that game". Then ${selectedUser2.username} said "It's Pokemon!". Then Victor said "- you...", after that ${selectedUser1.username} facepalmed.`, + `${selectedUser1.username} played this new game called Pokemon (this is back in 1996) and his friend ${selectedUser2.username} also bought that game. And then Victor Tran decided to say "Ooh! What's that game". Then ${selectedUser2.username} said "It's Pokemon!". Then Victor said "- you...", after that ${selectedUser1.username} facepalmed.` ]; - const storySelected = [Math.floor(Math.random() * stories.length)]; - const { RichEmbed } = require('discord.js'); - const embed = new RichEmbed() - .setColor(0x00ae86) - .setTitle('PokeBot Storytime') - .setDescription(stories[storySelected]) - .setFooter('PokeBot v1.0'); - msg.channel.send({ embed }); - }); + const storySelected = [Math.floor(Math.random() * stories.length)]; + const {RichEmbed} = require('discord.js'); + const embed = new RichEmbed() + .setColor(0x00ae86) + .setTitle('PokeBot Storytime') + .setDescription(stories[storySelected]) + .setFooter('PokeBot v1.0'); + msg.channel.send({embed}); }; exports.conf = { aliases: ['storytime'], - guildOnly: true, + guildOnly: true }; exports.help = { name: 'story', - description: 'Tells you a story.', + description: 'Tells you a story.' }; diff --git a/commands/Getting Started/contribute.js b/commands/Getting Started/contribute.js index 15204fd..66a3511 100644 --- a/commands/Getting Started/contribute.js +++ b/commands/Getting Started/contribute.js @@ -13,10 +13,10 @@ exports.run = (bot, msg) => { exports.conf = { aliases: [], - guildOnly: true, + guildOnly: true }; exports.help = { name: 'contribute', - description: 'Contributing to the bot.', + description: 'Contributing to the bot.' }; diff --git a/commands/Getting Started/help.js b/commands/Getting Started/help.js index 03dc3de..e1325d1 100644 --- a/commands/Getting Started/help.js +++ b/commands/Getting Started/help.js @@ -8,12 +8,12 @@ * *************************************/ exports.run = (bot, msg, args) => { - const { RichEmbed } = require('discord.js'); + const {RichEmbed} = require('discord.js'); if (!args[0]) { - const settings = require("../../assets/settings.json"); + const settings = require('../../assets/settings.json'); const embed = new RichEmbed(); embed - .setColor (0x36393e) + .setColor(0x36393e) .setTitle('PokeBot Command List') .setDescription(`PokeBot prefix is \`${settings.prefix}\`.`) .setFooter(`PokeBot v1.0 is on ${bot.guilds.size} servers.`); @@ -25,23 +25,22 @@ exports.run = (bot, msg, args) => { commands.forEach(cmd => { const command = bot.commands.get(x).get(cmd); if (command.checkPermission != null) { - if (command.checkPermission(bot, msg.member) == true) - { + if (command.checkPermission(bot, msg.member) == true) { cat += `**${command.help.name}**\n`; } - } - else { + } else { cat += `**${command.help.name}**\n`; } }); - if (cat != '') embed.addField(x, cat, true); + if (cat != '') { + embed.addField(x, cat, true); + } }); - msg.channel.send({ embed }); - } - else { + msg.channel.send({embed}); + } else { const embed = new RichEmbed(); embed - .setColor (0x00ae86) + .setColor(0x00ae86) .setDescription('Notice: When using a command do not include "<" and ">".\n(Example: p:suggest Test)') .setFooter('PokeBot v1.0'); @@ -56,7 +55,7 @@ exports.run = (bot, msg, args) => { embed.addField('Description', command.help.description, true); embed.addField('Usage', usage, true); embed.addField('Aliases', command.conf.aliases, true); - msg.channel.send({ embed }); + msg.channel.send({embed}); } }); }); @@ -65,10 +64,10 @@ exports.run = (bot, msg, args) => { exports.conf = { aliases: [], - guildOnly: true, + guildOnly: true }; exports.help = { name: 'help', - description: 'Displays this help message.', + description: 'Displays this help message.' }; diff --git a/commands/Getting Started/ping.js b/commands/Getting Started/ping.js index 365c9f4..17d5456 100644 --- a/commands/Getting Started/ping.js +++ b/commands/Getting Started/ping.js @@ -8,15 +8,15 @@ * *************************************/ exports.run = (bot, msg) => { - msg.channel.send(':ping_pong: Pong! ' + Math.floor(bot.ping) + 'ms.'); + msg.channel.send(`:ping_pong: Pong! ${ Math.floor(bot.ping)}ms.`); }; exports.conf = { aliases: [], - guildOnly: true, + guildOnly: true }; exports.help = { name: 'ping', - description: 'Pings the bot and replies with the latency.', + description: 'Pings the bot and replies with the latency.' }; diff --git a/commands/Getting Started/start.js b/commands/Getting Started/start.js index aa8eb9f..152cc5b 100644 --- a/commands/Getting Started/start.js +++ b/commands/Getting Started/start.js @@ -8,8 +8,10 @@ * *************************************/ exports.run = (bot, msg) => { - const { RichEmbed } = require('discord.js'); - if (msg.guild.id != '417088992329334792') return msg.reply ('This is a PokeWorld exclusive command. Sorry!'); + const {RichEmbed} = require('discord.js'); + if (msg.guild.id != '417088992329334792') { + return msg.reply('This is a PokeWorld exclusive command. Sorry!'); + } msg.channel.send( new RichEmbed() .setColor(0x00ae86) @@ -23,10 +25,10 @@ exports.run = (bot, msg) => { exports.conf = { aliases: ['noobs', 'newcomers'], - guildOnly: true, + guildOnly: true }; exports.help = { name: 'start', - description: 'Introduces you to the PokeWorld server!', + description: 'Introduces you to the PokeWorld server!' }; diff --git a/commands/Moderation/ban.js b/commands/Moderation/ban.js index 593d9e7..a4da613 100644 --- a/commands/Moderation/ban.js +++ b/commands/Moderation/ban.js @@ -8,21 +8,25 @@ * *************************************/ exports.run = async (bot, msg, args) => { - if (!msg.guild.member(bot.user).hasPermission('BAN_MEMBERS')) return msg.reply('I don\'t have permission to ban members.'); + if (!msg.guild.member(bot.user).hasPermission('BAN_MEMBERS')) { + return msg.reply('I don\'t have permission to ban members.'); + } const member = msg.mentions.members.first(); - if (!member) return await msg.reply('Who am I gonna ban? (Remember to @mention them)'); + if (!member) { + return msg.reply('Who am I gonna ban? (Remember to @mention them)'); + } const reason = args.join(' ').slice(3 + member.user.id.length); - await member.ban({ days: 7, reason: msg.author.tag + (reason ? ': ' + reason : '') }) - .catch(err => { - msg.reply('There was an error.'); return console.error(err.stack); - }) - .then(() => { - msg.channel.send(`Alright, I banned **${member.user.tag}**${(reason ? ` for the reason **${reason}**.` : '.')}`); - }); + try { + await member.ban({days: 7, reason: msg.author.tag + (reason ? `: ${ reason}` : '')}); + msg.channel.send(`Alright, I banned **${member.user.tag}**${(reason ? ` for the reason **${reason}**.` : '.')}`); - const { RichEmbed } = require('discord.js'); + } catch(err) { + msg.reply('There was an error.'); return console.error(err.stack); + } + + const {RichEmbed} = require('discord.js'); try { const embed = new RichEmbed() .setColor(0x00ae86) @@ -34,25 +38,26 @@ exports.run = async (bot, msg, args) => { .setTimestamp() .setFooter(`${msg.author.tag} banned ${member.user.tag}`, msg.author.avatarURL); const logChannel = await bot.plugins.settings.getStr('logs', msg.guild.id); - msg.guild.channels.find('id', logChannel).send({ embed }); - } - catch (err) { + msg.guild.channels.find('id', logChannel).send({embed}); + } catch (err) { console.error(err.stack); } }; exports.checkPermission = (bot, member) => { - if (!member.hasPermission('BAN_MEMBERS')) return 'You don\'t have permission to ban members.'; + if (!member.hasPermission('BAN_MEMBERS')) { + return 'You don\'t have permission to ban members.'; + } return true; -} +}; exports.conf = { aliases: [], - guildOnly: true, + guildOnly: true }; exports.help = { name: 'ban', description: 'Ban a user from this server.', - usage: '@user <...reason>', + usage: '@user <...reason>' }; diff --git a/commands/Moderation/interrogate.js b/commands/Moderation/interrogate.js index 39c10a1..2706f69 100644 --- a/commands/Moderation/interrogate.js +++ b/commands/Moderation/interrogate.js @@ -8,16 +8,22 @@ * *************************************/ exports.run = async (bot, msg) => { - if (msg.guild.id != '417088992329334792') return msg.reply ('This is a PokeWorld exclusive command. Sorry!'); + if (msg.guild.id != '417088992329334792') { + return msg.reply('This is a PokeWorld exclusive command. Sorry!'); + } - if (!msg.guild.member(bot.user).hasPermission('MANAGE_ROLES')) return msg.reply('I cannot interrogate anyone.'); + if (!msg.guild.member(bot.user).hasPermission('MANAGE_ROLES')) { + return msg.reply('I cannot interrogate anyone.'); + } const member = msg.mentions.members.first(); - if (!member) return await msg.reply('Who shall I interrogate? (Remember to @mention them)'); + if (!member) { + return msg.reply('Who shall I interrogate? (Remember to @mention them)'); + } member.addRole(msg.guild.roles.find('name', 'Interrogation')); - const { RichEmbed } = require('discord.js'); + const {RichEmbed} = require('discord.js'); try { const embed = new RichEmbed() .setColor(0x00ae86) @@ -28,25 +34,26 @@ exports.run = async (bot, msg) => { .setTimestamp() .setFooter(`${msg.author.tag} interrogated ${member.user.tag}.`, msg.author.avatarURL); const logChannel = await bot.plugins.settings.getStr('logs', msg.guild.id); - msg.guild.channels.find('id', logChannel).send({ embed }); - } - catch (err) { + msg.guild.channels.find('id', logChannel).send({embed}); + } catch (err) { console.error(err.stack); } }; exports.checkPermission = (bot, member) => { - if (!member.hasPermission('BAN_MEMBERS')) return 'You don\'t have permission to interrogate others. Rip-off detectives...'; + if (!member.hasPermission('BAN_MEMBERS')) { + return 'You don\'t have permission to interrogate others. Rip-off detectives...'; + } return true; -} +}; exports.conf = { aliases: [], - guildOnly: true, + guildOnly: true }; exports.help = { name: 'interrogate', description: 'Interrogate a suspect/user.', - usage: '@user', + usage: '@user' }; diff --git a/commands/Moderation/jail.js b/commands/Moderation/jail.js index 87d18da..6cb65b9 100644 --- a/commands/Moderation/jail.js +++ b/commands/Moderation/jail.js @@ -8,16 +8,22 @@ * *************************************/ exports.run = async (bot, msg) => { - if (msg.guild.id != '417088992329334792') return msg.reply ('This is a PokeWorld exclusive command. Sorry!'); + if (msg.guild.id != '417088992329334792') { + return msg.reply('This is a PokeWorld exclusive command. Sorry!'); + } - if (!msg.guild.member(bot.user).hasPermission('MANAGE_ROLES')) return msg.reply('I cannot put anyone in jail.'); + if (!msg.guild.member(bot.user).hasPermission('MANAGE_ROLES')) { + return msg.reply('I cannot put anyone in jail.'); + } const member = msg.mentions.members.first(); - if (!member) return await msg.reply('Who do I put in jail? (Remember to @mention them)'); + if (!member) { + return msg.reply('Who do I put in jail? (Remember to @mention them)'); + } member.addRole(msg.guild.roles.find('name', 'Jail')); - const { RichEmbed } = require('discord.js'); + const {RichEmbed} = require('discord.js'); try { const embed = new RichEmbed() .setColor(0x00ae86) @@ -28,25 +34,26 @@ exports.run = async (bot, msg) => { .setTimestamp() .setFooter(`${msg.author.tag} put ${member.user.tag} in jail.`, msg.author.avatarURL); const logChannel = await bot.plugins.settings.getStr('logs', msg.guild.id); - msg.guild.channels.find('id', logChannel).send({ embed }); - } - catch (err) { + msg.guild.channels.find('id', logChannel).send({embed}); + } catch (err) { console.error(err.stack); } }; exports.checkPermission = (bot, member) => { - if (!member.hasPermission('BAN_MEMBERS')) return 'You don\'t have permission to put members in jail.'; + if (!member.hasPermission('BAN_MEMBERS')) { + return 'You don\'t have permission to put members in jail.'; + } return true; -} +}; exports.conf = { aliases: [], - guildOnly: true, + guildOnly: true }; exports.help = { name: 'jail', description: 'Jail a user.', - usage: '@user', + usage: '@user' }; diff --git a/commands/Moderation/kick.js b/commands/Moderation/kick.js index 3ee88ea..386e5cb 100644 --- a/commands/Moderation/kick.js +++ b/commands/Moderation/kick.js @@ -8,29 +8,37 @@ * *************************************/ exports.run = async (bot, msg, args) => { - if (!msg.guild.member(bot.user).hasPermission('KICK_MEMBERS')) return msg.reply('I don\'t have permission to kick members.'); + if (!msg.guild.member(bot.user).hasPermission('KICK_MEMBERS')) { + return msg.reply('I don\'t have permission to kick members.'); + } const member = msg.mentions.members.first(); - if (!member) return await msg.reply('Who am I gonna kick? (Remember to @mention them)'); + if (!member) { + return msg.reply('Who am I gonna kick? (Remember to @mention them)'); + } const reason = args.join(' ').slice(3 + member.user.id.length); - await member.kick(msg.author.tag + ': ' + (reason ? ': ' + reason : '')) - .catch(err => { msg.reply('There was an error.'); console.error(err.stack);}); + await member.kick(`${msg.author.tag}: ${reason ? `: ${reason}` : ''}`) + .catch(err => { + msg.reply('There was an error.'); console.error(err.stack); + }); msg.channel.send(`Alright, I kicked **${member.user.tag}**${(reason ? ` for the reason **${reason}**.` : '.')}`); }; exports.checkPermission = (bot, member) => { - if (!member.hasPermission('KICK_MEMBERS')) return 'You don\'t have permission to kick members.'; + if (!member.hasPermission('KICK_MEMBERS')) { + return 'You don\'t have permission to kick members.'; + } return true; -} +}; exports.conf = { aliases: [], - guildOnly: true, + guildOnly: true }; exports.help = { name: 'kick', description: 'Kick a user out of the server.', - usage: '@user <...reason>', + usage: '@user <...reason>' }; diff --git a/commands/Moderation/lswarns.js b/commands/Moderation/lswarns.js index 732184d..7b39d12 100644 --- a/commands/Moderation/lswarns.js +++ b/commands/Moderation/lswarns.js @@ -9,24 +9,26 @@ exports.run = async (bot, msg) => { const db = require('quick.db'); - const { RichEmbed } = require('discord.js'); + const {RichEmbed} = require('discord.js'); const warns = await db.fetch(`warns_${msg.guild.id}_${msg.author.id}`); - if (!warns) return await msg.reply('You don\'t have any warnings in this server.'); + if (!warns) { + return msg.reply('You don\'t have any warnings in this server.'); + } const embed = new RichEmbed() .setTitle('Warns'); for (let i = 0; i < warns.count; i++) { - embed.addField('Warning #' + i + 1, warns.reasons[i]); + embed.addField(`Warning #${ i }${1}`, warns.reasons[i]); } - msg.channel.send({ embed }); + msg.channel.send({embed}); }; exports.conf = { aliases: [], - guildOnly: true, + guildOnly: true }; exports.help = { name: 'lswarns', - description: 'Shows all the warnings a user has.', + description: 'Shows all the warnings a user has.' }; diff --git a/commands/Moderation/purge.js b/commands/Moderation/purge.js index f244960..073d4bc 100644 --- a/commands/Moderation/purge.js +++ b/commands/Moderation/purge.js @@ -8,17 +8,25 @@ * *************************************/ exports.run = async (bot, msg, args) => { - if (!msg.guild.member(bot.user).hasPermission('MANAGE_MESSAGES')) return msg.reply('I don\'t have permission to manage messages.'); + if (!msg.guild.member(bot.user).hasPermission('MANAGE_MESSAGES')) { + return msg.reply('I don\'t have permission to manage messages.'); + } const user = msg.mentions.users.first(); const amount = parseInt(args[0]) ? parseInt(args[0]) : parseInt(args[1]); - if (!amount) return msg.reply('How many message shall I delete?'); - if (!amount && !user) return msg.reply('Tell me the user and amount or the just the amount of messages to purge.'); - if (amount > 100 || amount < 3) return msg.reply('Choose an amount less than 98 and greater than 1'); + if (!amount) { + return msg.reply('How many message shall I delete?'); + } + if (!amount && !user) { + return msg.reply('Tell me the user and amount or the just the amount of messages to purge.'); + } + if (amount > 100 || amount < 3) { + return msg.reply('Choose an amount less than 98 and greater than 1'); + } msg.delete(); - let msgs = await msg.channel.fetchMessages({ limit: amount }); + let msgs = await msg.channel.fetchMessages({limit: amount}); if (user) { const filterBy = user ? user.id : bot.user.id; msgs = msgs.filter(m => m.author.id === filterBy).array().slice(0, amount); @@ -27,17 +35,19 @@ exports.run = async (bot, msg, args) => { }; exports.checkPermission = (bot, member) => { - if (!member.hasPermission('MANAGE_MESSAGES')) return 'You don\'t have permission to manage messages.'; + if (!member.hasPermission('MANAGE_MESSAGES')) { + return 'You don\'t have permission to manage messages.'; + } return true; -} +}; exports.conf = { aliases: ['prune', 'rm'], - guildOnly: true, + guildOnly: true }; exports.help = { name: 'purge', description: 'Get rid of messages quickly.', - usage: '@user ', + usage: '@user ' }; diff --git a/commands/Moderation/setLogs.js b/commands/Moderation/setLogs.js index e951c45..1eed5e6 100644 --- a/commands/Moderation/setLogs.js +++ b/commands/Moderation/setLogs.js @@ -7,24 +7,26 @@ * * *************************************/ -exports.run = async (bot, msg, args) => { +exports.run = (bot, msg, args) => { bot.plugins.settings.setStr('logs', args[0], msg.guild.id); - msg.reply('Alright, I have set the log channel to ' + args[0]); + msg.reply(`Alright, I have set the log channel to ${args[0]}`); }; exports.checkPermission = (bot, member) => { - if (!member.hasPermission('MANAGE_MESSAGES')) return 'You don\'t have permission to manage messages.'; + if (!member.hasPermission('MANAGE_MESSAGES')) { + return 'You don\'t have permission to manage messages.'; + } return true; -} +}; exports.conf = { aliases: [], - guildOnly: true, + guildOnly: true }; exports.help = { name: 'setLogs', description: 'Set\'s the Log Channel.', - usage: '', + usage: '' }; diff --git a/commands/Moderation/setSuggestions.js b/commands/Moderation/setSuggestions.js index ff5691e..258f202 100644 --- a/commands/Moderation/setSuggestions.js +++ b/commands/Moderation/setSuggestions.js @@ -7,24 +7,26 @@ * * *************************************/ -exports.run = async (bot, msg, args) => { +exports.run = (bot, msg, args) => { bot.plugins.settings.setStr('suggestions', args[0], msg.guild.id); - msg.reply('Alright, I have set the suggestions channel to ' + args[0]); + msg.reply(`Alright, I have set the suggestions channel to ${args[0]}`); }; exports.checkPermission = (bot, member) => { - if (!member.hasPermission('MANAGE_MESSAGES')) return 'You don\'t have permission to manage messages.'; + if (!member.hasPermission('MANAGE_MESSAGES')) { + return 'You don\'t have permission to manage messages.'; + } return true; -} +}; exports.conf = { aliases: [], - guildOnly: true, + guildOnly: true }; exports.help = { name: 'setSuggestions', description: 'Set\'s the Suggestions Channel.', - usage: '', + usage: '' }; diff --git a/commands/Moderation/softban.js b/commands/Moderation/softban.js index 7c5119b..3bbab28 100644 --- a/commands/Moderation/softban.js +++ b/commands/Moderation/softban.js @@ -8,27 +8,30 @@ * *************************************/ exports.run = async (bot, msg, args) => { - if (!msg.guild.member(bot.user).hasPermission('BAN_MEMBERS')) return msg.reply('I don\'t have permission to ban members.'); + if (!msg.guild.member(bot.user).hasPermission('BAN_MEMBERS')) { + return msg.reply('I don\'t have permission to ban members.'); + } const member = msg.mentions.members.first(); - if (!member) return await msg.reply('Who am I gonna softban?'); + if (!member) { + return msg.reply('Who am I gonna softban?'); + } const reason = args.join(' ').slice(3 + member.user.id.length); + try { + await member.ban({days: 7, reason: `${msg.author.tag }: ${ reason ? reason : ''}`}); + msg.channel.send(`Alright, I softbanned **${member.user.tag}**${(reason ? ` for the reason **${reason}**.` : '.')}`); + } catch(err) { + msg.reply('There was an error.'); + return console.error(err.stack); + } + try{ + await msg.guild.unban(member.user.id); + } catch(err) { + msg.reply('There was an error.'); + return console.error(err.stack); + } - await member.ban({ days: 7, reason: msg.author.tag + ': ' + (reason ? reason : '') }) - .catch(err => { - msg.reply('There was an error.'); - return console.error(err.stack); - }) - .then(() => { - msg.channel.send(`Alright, I softbanned **${member.user.tag}**${(reason ? ` for the reason **${reason}**.` : '.')}`); - }); - await msg.guild.unban(member.user.id) - .catch(err => { - msg.reply('There was an error.'); - return console.error(err.stack); - }); - - const { RichEmbed } = require('discord.js'); + const {RichEmbed} = require('discord.js'); try { const embed = new RichEmbed() .setColor(0x00ae86) @@ -40,26 +43,27 @@ exports.run = async (bot, msg, args) => { .setTimestamp() .setFooter(`${msg.author.tag} softbanned ${member.user.tag}`, msg.author.avatarURL); const logChannel = await bot.plugins.settings.getStr('logs', msg.guild.id); - msg.guild.channels.find('id', logChannel).send({ embed }); - } - catch (err) { + msg.guild.channels.find('id', logChannel).send({embed}); + } catch (err) { console.error(err.stack); } }; exports.checkPermission = (bot, member) => { - if (!member.hasPermission('BAN_MEMBERS')) return 'You don\'t have permission to ban members.'; + if (!member.hasPermission('BAN_MEMBERS')) { + return 'You don\'t have permission to ban members.'; + } return true; -} +}; exports.conf = { aliases: [], - guildOnly: true, + guildOnly: true }; exports.help = { name: 'softban', description: 'Kick the user and delete their messages.', - usage: '@user <...reason>', + usage: '@user <...reason>' }; diff --git a/commands/Moderation/timeout.js b/commands/Moderation/timeout.js index d8722a8..84020cd 100644 --- a/commands/Moderation/timeout.js +++ b/commands/Moderation/timeout.js @@ -8,17 +8,25 @@ * *************************************/ exports.run = async (bot, msg) => { - if (msg.guild.id != '417088992329334792') return msg.reply ('This is a PokeWorld exclusive command. Sorry!'); + if (msg.guild.id != '417088992329334792') { + return msg.reply('This is a PokeWorld exclusive command. Sorry!'); + } - if (!msg.member.hasPermission('BAN_MEMBERS')) return msg.reply('You don\'t have permission to put members in time-out..'); - if (!msg.guild.member(bot.user).hasPermission('MANAGE_ROLES')) return msg.reply('I cannot put anyone in time-out.'); + if (!msg.member.hasPermission('BAN_MEMBERS')) { + return msg.reply('You don\'t have permission to put members in time-out..'); + } + if (!msg.guild.member(bot.user).hasPermission('MANAGE_ROLES')) { + return msg.reply('I cannot put anyone in time-out.'); + } const member = msg.mentions.members.first(); - if (!member) return await msg.reply('Who do I put in time-out?'); + if (!member) { + return msg.reply('Who do I put in time-out?'); + } member.addRole(msg.guild.roles.find('name', 'Timeout')); - const { RichEmbed } = require('discord.js'); + const {RichEmbed} = require('discord.js'); try { const embed = new RichEmbed() .setColor(0x00ae86) @@ -29,25 +37,26 @@ exports.run = async (bot, msg) => { .setTimestamp() .setFooter(`${msg.author.tag} put ${member.user.tag} in time-out.`, msg.author.avatarURL); const logChannel = await bot.plugins.settings.getStr('logs', msg.guild.id); - msg.guild.channels.find('id', logChannel).send({ embed }); - } - catch (err) { + msg.guild.channels.find('id', logChannel).send({embed}); + } catch (err) { console.error(err.stack); } }; exports.checkPermission = (bot, member) => { - if (!member.hasPermission('BAN_MEMBERS')) return 'You don\'t have permission to put members in time-out..'; + if (!member.hasPermission('BAN_MEMBERS')) { + return 'You don\'t have permission to put members in time-out..'; + } return true; -} +}; exports.conf = { aliases: [], - guildOnly: true, + guildOnly: true }; exports.help = { name: 'timeout', description: 'Put a user in time-out', - usage: '@user', + usage: '@user' }; diff --git a/commands/Moderation/warn.js b/commands/Moderation/warn.js index b8548a3..5dcd5ef 100644 --- a/commands/Moderation/warn.js +++ b/commands/Moderation/warn.js @@ -21,13 +21,12 @@ exports.run = async (bot, msg, args) => { if (warns) { const reasons = warns.reasons; reasons.push(warnReason); - await db.set(`warns_${msg.guild.id}_${victim.user.id}`, { count : warns.count + 1, reasons : reasons }); - } - else { - await db.set(`warns_${msg.guild.id}_${victim.user.id}`, { count : 1, reasons : [warnReason]}); + await db.set(`warns_${msg.guild.id}_${victim.user.id}`, {count : warns.count + 1, reasons : reasons}); + } else { + await db.set(`warns_${msg.guild.id}_${victim.user.id}`, {count : 1, reasons : [warnReason]}); } - const { RichEmbed } = require('discord.js'); + const {RichEmbed} = require('discord.js'); const logChannel = await bot.plugins.settings.getStr('logs', msg.guild.id); bot.channels.find('id', logChannel).send( new RichEmbed() @@ -38,22 +37,24 @@ exports.run = async (bot, msg, args) => { .addField('ID', victim.id, true) .addField('Created Account', victim.user.createdAt, true) .setTimestamp() - .setFooter('Warned by: ' + msg.author.tag, msg.author.avatarURL) + .setFooter(`Warned by: ${msg.author.tag}`, msg.author.avatarURL) ); }; exports.checkPermission = (bot, member) => { - if (!member.hasPermission('MANAGE_MESSAGES')) return 'You don\'t have permission to warn.'; + if (!member.hasPermission('MANAGE_MESSAGES')) { + return 'You don\'t have permission to warn.'; + } return true; -} +}; exports.conf = { aliases: [], - guildOnly: true, + guildOnly: true }; exports.help = { name: 'warn', description: 'Logs a warning to the user.', - usage : '@user ', + usage : '@user ' }; diff --git a/commands/Owners Only/eval.js b/commands/Owners Only/eval.js index 5153b63..bd0528b 100644 --- a/commands/Owners Only/eval.js +++ b/commands/Owners Only/eval.js @@ -7,8 +7,8 @@ * * *************************************/ -exports.run = async (bot, msg, args) => { - const { RichEmbed } = require('discord.js'); +exports.run = (bot, msg, args) => { + const {RichEmbed} = require('discord.js'); const code = args.join(' '); let evaled; @@ -17,7 +17,7 @@ exports.run = async (bot, msg, args) => { try { remove = text => { if (typeof(text) === 'string') { - return text.replace(/`/g, '`' + String.fromCharCode(8203)).replace(/@/g, '@' + String.fromCharCode(8203)); + return text.replace(/`/g, `\`${String.fromCharCode(8203)}`).replace(/@/g, `@${ String.fromCharCode(8203)}`); } else { return text; } @@ -37,7 +37,7 @@ exports.run = async (bot, msg, args) => { .addField(':outbox_tray: Output:', `\`\`\`${err}\`\`\``) .setFooter('Eval', bot.user.avatarURL) .setColor('RED'); - return msg.channel.send({ embed }); + return msg.channel.send({embed}); } try { @@ -49,7 +49,7 @@ exports.run = async (bot, msg, args) => { .setFooter('Eval', bot.user.avatarURL) .setColor('GREEN'); - return msg.channel.send({ embed }); + return msg.channel.send({embed}); } catch (err) { const embed = new RichEmbed() .setAuthor('Eval Error') @@ -58,22 +58,24 @@ exports.run = async (bot, msg, args) => { .addField(':outbox_tray: Output:', `\`\`\`${err}\`\`\``) .setFooter('Eval', bot.user.avatarURL) .setColor('RED'); - return msg.channel.send({ embed }); + return msg.channel.send({embed}); } }; exports.checkPermission = (bot, member) => { - if (!['242775871059001344', '247221105515823104', '236279900728721409'].includes(member.id)) return false; + if (!['242775871059001344', '247221105515823104', '236279900728721409'].includes(member.id)) { + return false; + } return true; -} +}; exports.conf = { aliases: ['exec'], - guildOnly: false, + guildOnly: false }; exports.help = { name: 'eval', description: 'Evaluates Javascript Code', - usage: '', + usage: '' }; diff --git a/commands/Owners Only/leaveguild.js b/commands/Owners Only/leaveguild.js index f214b8b..3d8db42 100644 --- a/commands/Owners Only/leaveguild.js +++ b/commands/Owners Only/leaveguild.js @@ -1,27 +1,29 @@ /**************************************** - * + * * LeaveGuild: Plugin for PokeBot that leaves a guild * Copyright (C) 2018 TheEdge, jtsshieh, Alee * * Licensed under the Open Software License version 3.0 - * + * * *************************************/ -module.exports.run = async (bot, msg) => { - msg.channel.send('Alright, I\'m leaving the server now. Bye everyone!') - msg.guild.leave(); - }; +module.exports.run = (bot, msg) => { + msg.channel.send('Alright, I\'m leaving the server now. Bye everyone!'); + msg.guild.leave(); +}; - exports.checkPermission = (bot, member) => { - if (!['242775871059001344', '247221105515823104', '236279900728721409'].includes(member.id)) return false; - return true; +exports.checkPermission = (bot, member) => { + if (!['242775871059001344', '247221105515823104', '236279900728721409'].includes(member.id)) { + return false; } + return true; +}; - exports.conf = { - aliases: [], - guildOnly: true, - }; - exports.help = { - name: 'leaveguild', - description: 'Makes the bot leave the server', - }; +exports.conf = { + aliases: [], + guildOnly: true +}; +exports.help = { + name: 'leaveguild', + description: 'Makes the bot leave the server' +}; diff --git a/commands/Owners Only/modifycredits.js b/commands/Owners Only/modifycredits.js index 6ec7506..4ab5e00 100644 --- a/commands/Owners Only/modifycredits.js +++ b/commands/Owners Only/modifycredits.js @@ -7,7 +7,7 @@ * * *************************************/ -exports.run = async (bot, msg) => { +exports.run = (bot, msg) => { let user; if (!msg.mentions.users.first()) { user = msg.author; @@ -23,17 +23,19 @@ exports.run = async (bot, msg) => { }; exports.checkPermission = (bot, member) => { - if (!['242775871059001344', '247221105515823104', '236279900728721409'].includes(member.id)) return false; + if (!['242775871059001344', '247221105515823104', '236279900728721409'].includes(member.id)) { + return false; + } return true; -} +}; exports.conf = { aliases: [], - guildOnly: true, + guildOnly: true }; exports.help = { name: 'modifycredits', description: 'Modifies the credits of a user', - usage: '@user ', + usage: '@user ' }; diff --git a/commands/Owners Only/poweroff.js b/commands/Owners Only/poweroff.js index 3d2cbdd..bfd5f86 100644 --- a/commands/Owners Only/poweroff.js +++ b/commands/Owners Only/poweroff.js @@ -9,22 +9,24 @@ exports.run = async (bot, msg) => { await msg.reply(':warning: Pokebot is now powering off!'); - await bot.user.setStatus('invisible') + await bot.user.setStatus('invisible'); console.log('Pokebot is now powering off...'); process.exit(0); }; exports.checkPermission = (bot, member) => { - if (!['242775871059001344', '247221105515823104', '236279900728721409'].includes(member.id)) return false; + if (!['242775871059001344', '247221105515823104', '236279900728721409'].includes(member.id)) { + return false; + } return true; -} +}; exports.conf = { aliases: ['reboot', 'restart'], - guildOnly: true, + guildOnly: true }; exports.help = { name: 'poweroff', - description: 'Powers off the bot.', + description: 'Powers off the bot.' }; diff --git a/commands/Owners Only/say.js b/commands/Owners Only/say.js index ace2874..ad1a9bd 100644 --- a/commands/Owners Only/say.js +++ b/commands/Owners Only/say.js @@ -7,23 +7,25 @@ * * *************************************/ -exports.run = async (bot, msg, args) => { +exports.run = (bot, msg, args) => { msg.channel.send(args.join(' ')); msg.delete(); }; exports.checkPermission = (bot, member) => { - if (!['242775871059001344', '247221105515823104', '236279900728721409'].includes(member.id)) return false; + if (!['242775871059001344', '247221105515823104', '236279900728721409'].includes(member.id)) { + return false; + } return true; -} +}; exports.conf = { aliases: [], - guildOnly: true, + guildOnly: true }; exports.help = { name: 'say', description: 'Control on what the bot says.', - usage: '<...text>', + usage: '<...text>' }; diff --git a/commands/Owners Only/testingcredits.js b/commands/Owners Only/testingcredits.js index 85cc859..87c1924 100644 --- a/commands/Owners Only/testingcredits.js +++ b/commands/Owners Only/testingcredits.js @@ -7,7 +7,7 @@ * * *************************************/ -exports.run = async (bot, msg) => { +exports.run = (bot, msg) => { let user; if (!msg.mentions.members.first()) { user = msg.author; @@ -21,17 +21,19 @@ exports.run = async (bot, msg) => { }; exports.checkPermission = (bot, member) => { - if (!['242775871059001344', '247221105515823104', '236279900728721409'].includes(member.id)) return false; + if (!['242775871059001344', '247221105515823104', '236279900728721409'].includes(member.id)) { + return false; + } return true; -} +}; exports.conf = { aliases: [], - guildOnly: true, + guildOnly: true }; exports.help = { name: 'testingcredits', description: 'Modifies the credits of a user', - usage: '@user ', + usage: '@user ' }; diff --git a/commands/Pokemon/claim.js b/commands/Pokemon/claim.js index 506ca0f..24880c4 100644 --- a/commands/Pokemon/claim.js +++ b/commands/Pokemon/claim.js @@ -9,46 +9,64 @@ exports.run = async (bot, msg) => { const isWhitelist = await bot.plugins.whitelist.isWhitelist(msg.guild.id); - if (!isWhitelist) return msg.reply ('This command is still in testing. Only whitelisted servers can use this command. Sorry!'); + if (!isWhitelist) { + return msg.reply('This command is still in testing. Only whitelisted servers can use this command. Sorry!'); + } - if (!msg.channel.name.startsWith('gym-')) return msg.reply('Go into one of the gym channels and try again.'); + if (!msg.channel.name.startsWith('gym-')) { + return msg.reply('Go into one of the gym channels and try again.'); + } if (!bot.plugins.gyms.isOwned(msg.channel.topic)) { const team = bot.plugins.gyms.getTeam(msg.member); - if (!team) return msg.reply('You have to join a team before you can claim a gym.'); + if (!team) { + return msg.reply('You have to join a team before you can claim a gym.'); + } msg.reply('Alright, you have claimed this gym as yours! Be ready to battle anyone who approaches you'); return msg.channel.setTopic(bot.plugins.gyms.getGymString(bot, msg.member)); } const team = bot.plugins.gyms.getTeam(msg.member); - if (!team) return msg.reply('You have to join a team before you can claim a gym.'); + if (!team) { + return msg.reply('You have to join a team before you can claim a gym.'); + } const owner = bot.plugins.gyms.getOwnerId(msg.channel.topic); - if (msg.guild.members.find('id', owner).roles.find('name', team)) return msg.reply('Don\'t try battling your own team. They won\'t like you.'); + if (msg.guild.members.find('id', owner).roles.find('name', team)) { + return msg.reply('Don\'t try battling your own team. They won\'t like you.'); + } - if (bot.gyms.get(msg.channel.id) != null) return msg.reply('Nope, someone is already battling the gym.'); + if (bot.gyms.get(msg.channel.id) != null) { + return msg.reply('Nope, someone is already battling the gym.'); + } - msg.channel.send('<@' + owner + '>, come here as ' + msg.member.displayName + ' wants to battle you.'); + msg.channel.send(`<@${ owner }>, come here as ${ msg.member.displayName } wants to battle you.`); const func = async mess => { - if (mess.channel != msg.channel) return; + if (mess.channel != msg.channel) { + return; + } if (!mess.embeds[0] && !mess.embeds[0].description && !mess.embeds[0].description.split('\n')[0] && !mess.embeds[0].description.split('\n')[0].split(' ')[0] - ) return; + ) { + return; + } const field = mess.embeds[0].description.split('\n')[0].split(' ')[0]; const user = msg.guild.members.find(member => member.user.username === field); - if (!user) return; + if (!user) { + return; + } if (user.id == owner) { await msg.channel.send('The owner has not been defeated!'); - } - else if (user.id == msg.author.id) { + } else if (user.id == msg.author.id) { await msg.channel.send('The owner has been defeated! Transferring gym!'); await msg.channel.setTopic(bot.plugins.gyms.getGymString(bot, msg.member)); + } else { + return; } - else { return; } bot.gyms.set(msg.channel.id, null); bot.removeListener('message', func); }; @@ -58,10 +76,10 @@ exports.run = async (bot, msg) => { exports.conf = { aliases: [], - guildOnly: true, + guildOnly: true }; exports.help = { name: 'claim', - description: 'Claim a gym.', + description: 'Claim a gym.' }; diff --git a/commands/Pokemon/dropgym.js b/commands/Pokemon/dropgym.js index cb9ad2e..c19c13f 100644 --- a/commands/Pokemon/dropgym.js +++ b/commands/Pokemon/dropgym.js @@ -9,17 +9,19 @@ exports.run = async (bot, msg) => { const isWhitelist = await bot.plugins.whitelist.isWhitelist(msg.guild.id); - if (!isWhitelist) return msg.reply ('This command is still in testing. Only whitelisted servers can use this command. Sorry!'); - if (!msg.channel.name.startsWith('gym-')) return msg.reply('Go into one of the gym channels and try again.'); + if (!isWhitelist) { + return msg.reply('This command is still in testing. Only whitelisted servers can use this command. Sorry!'); + } + if (!msg.channel.name.startsWith('gym-')) { + return msg.reply('Go into one of the gym channels and try again.'); + } if (msg.channel.topic == 'Current Owner: *none*') { msg.reply('There is no owner for this gym. Claim it now with p:claim!'); - } - else { + } else { const owner = msg.channel.topic.slice(15).substring(0, 18); if (msg.author.id != owner) { return msg.reply('You are not the owner of this gym.'); - } - else { + } else { msg.channel.setTopic('Current Owner: *none*'); msg.channel.send('You have dropped the gym.'); } @@ -28,10 +30,10 @@ exports.run = async (bot, msg) => { exports.conf = { aliases: [], - guildOnly: true, + guildOnly: true }; exports.help = { name: 'dropgym', - description: 'Drop a gym.', + description: 'Drop a gym.' }; diff --git a/commands/Pokemon/forcedrop.js b/commands/Pokemon/forcedrop.js index bc2945d..7f29031 100644 --- a/commands/Pokemon/forcedrop.js +++ b/commands/Pokemon/forcedrop.js @@ -9,14 +9,19 @@ exports.run = async (bot, msg) => { const isWhitelist = await bot.plugins.whitelist.isWhitelist(msg.guild.id); - if (!isWhitelist) return msg.reply ('This command is still in testing. Only whitelisted servers can use this command. Sorry!'); + if (!isWhitelist) { + return msg.reply('This command is still in testing. Only whitelisted servers can use this command. Sorry!'); + } - if (!msg.member.hasPermission('MANAGE_MESSAGES')) return msg.reply('You don\'t have permission to force drop.'); - if (!msg.channel.name.startsWith('gym-')) return msg.reply('Go into one of the gym channels and try again.'); + if (!msg.member.hasPermission('MANAGE_MESSAGES')) { + return msg.reply('You don\'t have permission to force drop.'); + } + if (!msg.channel.name.startsWith('gym-')) { + return msg.reply('Go into one of the gym channels and try again.'); + } if (msg.channel.topic == 'Current Owner: *none*') { msg.reply('This gym does not have an owner.'); - } - else { + } else { msg.channel.setTopic('Current Owner: *none*'); msg.channel.send('You have dropped the gym.'); } @@ -24,10 +29,10 @@ exports.run = async (bot, msg) => { exports.conf = { aliases: [], - guildOnly: true, + guildOnly: true }; exports.help = { name: 'forcedrop', - description: 'Force a gym to have no owner.', + description: 'Force a gym to have no owner.' }; diff --git a/commands/Pokemon/jointeam.js b/commands/Pokemon/jointeam.js index e396afe..d4f125f 100644 --- a/commands/Pokemon/jointeam.js +++ b/commands/Pokemon/jointeam.js @@ -9,27 +9,30 @@ exports.run = async (bot, msg, args) => { const isWhitelist = await bot.plugins.whitelist.isWhitelist(msg.guild.id); - if (!isWhitelist) return msg.reply ('This command is still in testing. Only whitelisted servers can use this command. Sorry!'); + if (!isWhitelist) { + return msg.reply('This command is still in testing. Only whitelisted servers can use this command. Sorry!'); + } - if (args.length < 1) return msg.reply('Please choose a team to join'); + if (args.length < 1) { + return msg.reply('Please choose a team to join'); + } const team = findTeam(msg, args[0].toUpperCase()); - switch (args[0]) - { - case 'skull': { - msg.member.addRole(msg.guild.roles.find('name', 'Skull')); - msg.reply(`Alright, ${team ? 'you have left team ' + team + ' and ' : 'you have '}joined team Skull.`); - break; - } - case 'flare' : { - msg.member.addRole(msg.guild.roles.find('name', 'Flare')); - msg.reply(`Alright, ${team ? 'you have left team ' + team + ' and ' : 'you have '}joined team Flare.`); - break; - } - default : { - msg.reply('You have to pick a team (skull, flare.)'); - break; - } + switch (args[0]) { + case 'skull': { + msg.member.addRole(msg.guild.roles.find('name', 'Skull')); + msg.reply(`Alright, ${team ? `you have left team ${ team } and ` : 'you have '}joined team Skull.`); + break; + } + case 'flare' : { + msg.member.addRole(msg.guild.roles.find('name', 'Flare')); + msg.reply(`Alright, ${team ? `you have left team ${ team } and ` : 'you have '}joined team Flare.`); + break; + } + default : { + msg.reply('You have to pick a team (skull, flare.)'); + break; + } } }; @@ -38,12 +41,15 @@ function findTeam(msg, team) { let oldTeam; if (msg.member.roles.find('name', 'Skull')) { - if (team == 'skull') return; + if (team == 'skull') { + return; + } msg.member.removeRole(msg.guild.roles.find('name', 'Skull')); oldTeam = 'Skull'; - } - else if (msg.member.roles.find('name', 'Flare')) { - if (team == 'flare') return; + } else if (msg.member.roles.find('name', 'Flare')) { + if (team == 'flare') { + return; + } msg.member.removeRole(msg.guild.roles.find('name', 'Flare')); oldTeam = 'Flare'; } @@ -52,11 +58,11 @@ function findTeam(msg, team) { exports.conf = { aliases: ['pick', 'choose'], - guildOnly: true, + guildOnly: true }; exports.help = { name: 'jointeam', description: 'Join one of the teams!', - usage: '', + usage: '' }; diff --git a/commands/Pokemon/leaveteam.js b/commands/Pokemon/leaveteam.js index b2e1805..e1096a3 100644 --- a/commands/Pokemon/leaveteam.js +++ b/commands/Pokemon/leaveteam.js @@ -9,27 +9,27 @@ exports.run = async (bot, msg) => { const isWhitelist = await bot.plugins.whitelist.isWhitelist(msg.guild.id); - if (!isWhitelist) return msg.reply ('This command is still in testing. Only whitelisted servers can use this command. Sorry!'); + if (!isWhitelist) { + return msg.reply('This command is still in testing. Only whitelisted servers can use this command. Sorry!'); + } if (msg.member.roles.find('name', 'Skull')) { msg.member.removeRole(msg.guild.roles.find('name', 'Skull')); msg.reply('Alright, you are not longer in team Skull.'); - } - else if (msg.member.roles.find('name', 'Flare')) { + } else if (msg.member.roles.find('name', 'Flare')) { msg.member.removeRole(msg.guild.roles.find('name', 'Flare')); msg.reply('Alright, you are not longer in team Flare.'); - } - else { + } else { msg.reply('You are not in a team.'); } }; exports.conf = { aliases: [], - guildOnly: true, + guildOnly: true }; exports.help = { name: 'leaveteam', - description: 'Leave the team you currently are in.', + description: 'Leave the team you currently are in.' }; diff --git a/commands/Pokemon/lsitem.js b/commands/Pokemon/lsitem.js index fbdc4a0..8e8bdd8 100644 --- a/commands/Pokemon/lsitem.js +++ b/commands/Pokemon/lsitem.js @@ -8,34 +8,38 @@ * *************************************/ exports.run = async (bot, msg, args) => { - if (msg.guild.id != '417088992329334792') return msg.reply ('This command is still in early testing, so it is only available within Pokeworld.'); + if (msg.guild.id != '417088992329334792') { + return msg.reply('This command is still in early testing, so it is only available within Pokeworld.'); + } - const { RichEmbed } = require('discord.js'); + const {RichEmbed} = require('discord.js'); const data = args.join(' ').split('|'); - const msgs = await bot.channels.find('id', '637877120185532416').fetchMessages({ limit: 10 }); + const msgs = await bot.channels.find('id', '637877120185532416').fetchMessages({limit: 10}); const mess = msgs.first(); - if (!mess.embeds) return; + if (!mess.embeds) { + return; + } const id = parseInt(mess.embeds[0].author.name.split(':')[1]) + 1; bot.channels.find('id', '637877120185532416').send( new RichEmbed() .setTitle('A new pokemon is up for sale!') - .setAuthor('ID: ' + id) + .setAuthor(`ID: ${ id}`) .addField('Starting Price', data[1], true) .addField('Pokemon', data[0], true) .addField('Other', data[2], true) .addField('Seller', `<@${msg.author.id}>`, true) - .addField('How to bid', 'DM the seller for the pokemon giving them the id, ' + id) + .addField('How to bid', `DM the seller for the pokemon giving them the id, ${ id}`) ); }; exports.conf = { aliases: [], - guildOnly: true, + guildOnly: true }; exports.help = { name: 'lsitem', description: 'List an item to the marketplace.', - usage: '||', + usage: '||' }; diff --git a/commands/Pokemon/tradegym.js b/commands/Pokemon/tradegym.js index 5d981be..5f54333 100644 --- a/commands/Pokemon/tradegym.js +++ b/commands/Pokemon/tradegym.js @@ -9,34 +9,47 @@ exports.run = async (bot, msg) => { const isWhitelist = await bot.plugins.whitelist.isWhitelist(msg.guild.id); - if (!isWhitelist) return msg.reply ('This command is still in testing. Only whitelisted servers can use this command. Sorry!'); + if (!isWhitelist) { + return msg.reply('This command is still in testing. Only whitelisted servers can use this command. Sorry!'); + } - if (!msg.channel.name.startsWith('gym-')) return msg.reply('Go into one of the gym channels and try again.'); + if (!msg.channel.name.startsWith('gym-')) { + return msg.reply('Go into one of the gym channels and try again.'); + } let team; - if (msg.member.roles.find('name', 'Skull')) team = 'Skull'; - if (msg.member.roles.find('name', 'Flare')) team = 'Flare'; - if (msg.channel.topic == 'Current Owner: ' + msg.author.id + '/' + msg.author.tag + '/' + team) { - if (!msg.mentions.members.first()) return msg.reply('Sorry, you have to ping the recipient of the gym!'); + if (msg.member.roles.find('name', 'Skull')) { + team = 'Skull'; + } + if (msg.member.roles.find('name', 'Flare')) { + team = 'Flare'; + } + if (msg.channel.topic == `Current Owner: ${ msg.author.id }/${ msg.author.tag }/${ team}`) { + if (!msg.mentions.members.first()) { + return msg.reply('Sorry, you have to ping the recipient of the gym!'); + } const recipient = msg.mentions.members.first(); - msg.reply('Trading gym to ' + recipient); + msg.reply(`Trading gym to ${ recipient}`); let recipientTeam; - if (recipient.roles.find('name', 'Skull')) recipientTeam = 'Skull'; - if (recipient.roles.find('name', 'Flare')) recipientTeam = 'Flare'; - msg.channel.setTopic('Current Owner: ' + recipient.id + '/' + recipient.user.tag + '/' + recipientTeam); - } - else { + if (recipient.roles.find('name', 'Skull')) { + recipientTeam = 'Skull'; + } + if (recipient.roles.find('name', 'Flare')) { + recipientTeam = 'Flare'; + } + msg.channel.setTopic(`Current Owner: ${ recipient.id }/${ recipient.user.tag }/${ recipientTeam}`); + } else { msg.reply('You have to own the gym to be able to trade it!'); } }; exports.conf = { aliases: [], - guildOnly: true, + guildOnly: true }; exports.help = { name: 'tradegym', description: 'Trade a gym to the pinged member.', - usage: '@user', + usage: '@user' }; diff --git a/commands/Utility/character.js b/commands/Utility/character.js index 56d9bfb..2ed549e 100644 --- a/commands/Utility/character.js +++ b/commands/Utility/character.js @@ -8,14 +8,16 @@ * *************************************/ exports.run = (bot, msg, args) => { - const { RichEmbed } = require('discord.js'); + const {RichEmbed} = require('discord.js'); const embed = new RichEmbed() .setTitle('***Character Analysis***') .setDescription('Find out the decimal and hexadecimal of each and every character in a string.') .setColor('#000'); const str = args.join(' '); - if (str.length > 50) return msg.reply('The limit is 50 for how many characters you can input'); + if (str.length > 50) { + return msg.reply('The limit is 50 for how many characters you can input'); + } const array = str.split(''); let decimal = ''; @@ -29,22 +31,22 @@ exports.run = (bot, msg, args) => { const code = str.charCodeAt(x); let codeHex = code.toString(16).toUpperCase(); while (codeHex.length < 4) { - codeHex = '0' + codeHex; + codeHex = `0${codeHex}`; } hexadecimal += `\`\\u${codeHex}\`\t${array[x]}\n`; } embed.addField('*Hexadecimal*', hexadecimal, true); - msg.channel.send({ embed }); + msg.channel.send({embed}); }; exports.conf = { aliases: [], - guildOnly: true, + guildOnly: true }; exports.help = { name: 'character', description: 'Gets the decimal and hexadecimal of (a) character(s)', - usage: '<...characters>', + usage: '<...characters>' }; diff --git a/commands/Utility/hinfo.js b/commands/Utility/hinfo.js index 982a3bf..edffe5b 100644 --- a/commands/Utility/hinfo.js +++ b/commands/Utility/hinfo.js @@ -8,24 +8,24 @@ * *************************************/ exports.run = (bot, msg) => { - const { RichEmbed } = require('discord.js'); - const os = require('os'); - const embed = new RichEmbed() - .setTitle('Information on PokeBot\'s Host') - .addField('OS Hostname: ', os.hostname() , true) - .addField('NodeJS Version: ', process.versions.node , true) - .addField('OS Platform: ', os.platform() , true) - .addField('OS Version: ', os.release() , true) - .setColor('#000000'); - msg.channel.send({embed}); + const {RichEmbed} = require('discord.js'); + const os = require('os'); + const embed = new RichEmbed() + .setTitle('Information on PokeBot\'s Host') + .addField('OS Hostname: ', os.hostname(), true) + .addField('NodeJS Version: ', process.versions.node, true) + .addField('OS Platform: ', os.platform(), true) + .addField('OS Version: ', os.release(), true) + .setColor('#000000'); + msg.channel.send({embed}); }; exports.conf = { aliases: [], - guildOnly: true, + guildOnly: true }; exports.help = { name: 'hinfo', - description: 'Gives host information to user.', + description: 'Gives host information to user.' }; diff --git a/commands/Utility/invite.js b/commands/Utility/invite.js index 933e9ba..f029fcb 100644 --- a/commands/Utility/invite.js +++ b/commands/Utility/invite.js @@ -13,10 +13,10 @@ exports.run = (bot, msg) => { exports.conf = { aliases: [], - guildOnly: true, + guildOnly: true }; exports.help = { name: 'invite', - description: 'Gives the user a link to invite the bot.', + description: 'Gives the user a link to invite the bot.' }; diff --git a/commands/Utility/nick.js b/commands/Utility/nick.js index bec9578..f02af0f 100644 --- a/commands/Utility/nick.js +++ b/commands/Utility/nick.js @@ -8,14 +8,18 @@ * *************************************/ exports.run = async (bot, msg, args) => { - const { RichEmbed } = require('discord.js'); + const {RichEmbed} = require('discord.js'); msg.member.setNickname(args.join(' '), 'Requested by bot'); - msg.channel.send('Changed nickname to: ' + args.join(' ')); + msg.channel.send(`Changed nickname to: ${args.join(' ')}`); const logChannel = await bot.plugins.settings.getStr('logs', msg.member.guild.id); - if (!logChannel) return; + if (!logChannel) { + return; + } const channelObj = bot.channels.find('id', logChannel); - if (!channelObj) return; + if (!channelObj) { + return; + } channelObj.send( new RichEmbed() .setColor(0x00ae86) @@ -25,16 +29,15 @@ exports.run = async (bot, msg, args) => { .setTimestamp() .setFooter('PokeBot v1.0') ); - }; exports.conf = { aliases: ['nickname'], - guildOnly: true, + guildOnly: true }; exports.help = { name: 'nick', description: 'Change your nickname.', - usage: '<...new nick>', + usage: '<...new nick>' }; diff --git a/commands/Utility/suggest.js b/commands/Utility/suggest.js index f1b4206..b935977 100644 --- a/commands/Utility/suggest.js +++ b/commands/Utility/suggest.js @@ -8,11 +8,11 @@ * *************************************/ exports.run = async (bot, msg, args) => { - const { RichEmbed } = require('discord.js'); + const {RichEmbed} = require('discord.js'); const suggestionChannel = await bot.plugins.settings.getStr('suggestions', msg.member.guild.id); bot.channels.find('id', suggestionChannel).send( new RichEmbed() - .setColor (0x00ae86) + .setColor(0x00ae86) .setTitle('Suggestion') .setDescription('This is a suggestion from a community member for something relating to the server. Please rate it based on your opinion, and a staff member will decide what to do with the suggestion.') .addField('Suggestion Contents', args.join(' ')) @@ -24,11 +24,11 @@ exports.run = async (bot, msg, args) => { exports.conf = { aliases: [], - guildOnly: true, + guildOnly: true }; exports.help = { name: 'suggest', description: 'Suggest a feature for the bot or the server.', - usage: '<...suggestion>', + usage: '<...suggestion>' }; diff --git a/commands/Utility/uptime.js b/commands/Utility/uptime.js index 8492df2..dd072a4 100644 --- a/commands/Utility/uptime.js +++ b/commands/Utility/uptime.js @@ -15,22 +15,28 @@ exports.run = (bot, msg, args) => { let hours = 0; while (uptimeMinutes >= 60) { hours++; - uptimeMinutes = uptimeMinutes - 60; + uptimeMinutes -= 60; } const uptimeSeconds = minutes % 60; - if (args[0] === 'ms') return msg.channel.send(bot.uptime + ' ms.'); - if (args[0] === 's') return msg.channel.send(uptimeSeconds + ' seconds.'); - if (args[0] === 'min') return msg.channel.send(Math.floor(uptime / 60) + ' minutes ' + uptimeSeconds + ' seconds.'); - msg.channel.send(':clock3: Pokebot has been up for ' + hours + ' hours, ' + uptimeMinutes + ' minutes, and ' + uptimeSeconds + ' seconds.'); + if (args[0] === 'ms') { + return msg.channel.send(`${bot.uptime } ms.`); + } + if (args[0] === 's') { + return msg.channel.send(`${uptimeSeconds } seconds.`); + } + if (args[0] === 'min') { + return msg.channel.send(`${Math.floor(uptime / 60) } minutes ${ uptimeSeconds } seconds.`); + } + msg.channel.send(`:clock3: Pokebot has been up for ${ hours } hours, ${ uptimeMinutes } minutes, and ${ uptimeSeconds } seconds.`); }; exports.conf = { aliases: [], - guildOnly: true, + guildOnly: true }; exports.help = { name: 'uptime', - description: 'Get the uptime of the bot.', + description: 'Get the uptime of the bot.' }; diff --git a/commands/Utility/userinfo.js b/commands/Utility/userinfo.js index 80844e1..e57351d 100644 --- a/commands/Utility/userinfo.js +++ b/commands/Utility/userinfo.js @@ -7,8 +7,8 @@ * * *************************************/ -exports.run = async (bot, msg) => { - const { RichEmbed } = require('discord.js'); +exports.run = (bot, msg) => { + const {RichEmbed} = require('discord.js'); let user; if (!msg.mentions.members.first()) { user = msg.member; @@ -22,18 +22,18 @@ exports.run = async (bot, msg) => { .addField('User ID', user.id) .addField('Account Creation Date', user.user.createdAt) .addField('Join Guild Date', user.joinedAt) - .addField('Names', 'Display Name: ' + user.displayName + `\nUsername: ${user.user.tag}`) + .addField('Names', `Display Name: ${user.displayName }\nUsername: ${user.user.tag}`) .setFooter('PokeBot v1.0') ); }; exports.conf = { aliases: ['uinfo', 'userinformation'], - guildOnly: true, + guildOnly: true }; exports.help = { name: 'userinfo', description: 'Shows information about the mentioned user', - usage: '@user', + usage: '@user' }; diff --git a/events/guildMemberAdd.js b/events/guildMemberAdd.js index 1c8273a..8527f63 100644 --- a/events/guildMemberAdd.js +++ b/events/guildMemberAdd.js @@ -8,11 +8,15 @@ * *************************************/ module.exports = async (bot, member) => { - const { RichEmbed } = require('discord.js'); + const {RichEmbed} = require('discord.js'); const logChannel = await bot.plugins.settings.getStr('logs', member.guild.id); - if (!logChannel) return; + if (!logChannel) { + return; + } const channelObj = bot.channels.find('id', logChannel); - if (!channelObj) return; + if (!channelObj) { + return; + } channelObj.send( new RichEmbed() .setColor(0x00ae86) @@ -24,14 +28,16 @@ module.exports = async (bot, member) => { .setFooter(member.user.tag, member.user.avatarURL) ); - if (member.guild.id != '417088992329334792') return; + if (member.guild.id != '417088992329334792') { + return; + } const botCount = member.guild.members.filter(x => x.user.bot).size; - bot.channels.get('635835776613220353').setName('User Count: ' + member.guild.memberCount); - bot.channels.get('635835832913231872').setName('Member Count: ' + (member.guild.memberCount - botCount)); - bot.channels.get('635835875065987073').setName('Bot Count: ' + botCount); + bot.channels.get('635835776613220353').setName(`User Count: ${member.guild.memberCount}`); + bot.channels.get('635835832913231872').setName(`Member Count: ${member.guild.memberCount - botCount}`); + bot.channels.get('635835875065987073').setName(`Bot Count: ${botCount}`); bot.channels.get('417100669980508160').send(`Welcome to the server **${member.user.tag}**! Make sure to read the rules! We now have ${member.guild.memberCount} members.`); - bot.channels.get('417088992329334794').send('Welcome to the server <@' + member.id + '>. Be sure to join a team: `p:join `. Also, make sure to read our introduction: `p:start`.'); + bot.channels.get('417088992329334794').send(`Welcome to the server <@${member.id }>. Be sure to join a team: \`p:join \`. Also, make sure to read our introduction: \`p:start\`.`); const role = member.guild.roles.find('name', 'Trainers'); member.addRole(role); }; diff --git a/events/guildMemberRemove.js b/events/guildMemberRemove.js index 9100f6b..6d793a6 100644 --- a/events/guildMemberRemove.js +++ b/events/guildMemberRemove.js @@ -8,11 +8,15 @@ * *************************************/ module.exports = async (bot, member) => { - const { RichEmbed } = require('discord.js'); + const {RichEmbed} = require('discord.js'); const logChannel = await bot.plugins.settings.getStr('logs', member.guild.id); - if (!logChannel) return; + if (!logChannel) { + return; + } const channelObj = bot.channels.find('id', logChannel); - if (!channelObj) return; + if (!channelObj) { + return; + } channelObj.send( new RichEmbed() .setColor(0x00ae86) @@ -24,10 +28,12 @@ module.exports = async (bot, member) => { .setTimestamp() .setFooter(member.user.tag, member.user.avatarURL) ); - if (member.guild.id != '417088992329334792') return; + if (member.guild.id != '417088992329334792') { + return; + } const botCount = member.guild.members.filter(x => x.user.bot).size; - bot.channels.get('635835776613220353').setName('User Count: ' + member.guild.memberCount); - bot.channels.get('635835832913231872').setName('Member Count: ' + (member.guild.memberCount - botCount)); - bot.channels.get('635835875065987073').setName('Bot Count: ' + botCount); + bot.channels.get('635835776613220353').setName(`User Count: ${member.guild.memberCount}`); + bot.channels.get('635835832913231872').setName(`Member Count: ${member.guild.memberCount - botCount}`); + bot.channels.get('635835875065987073').setName(`Bot Count: ${botCount}`); bot.channels.get('417100669980508160').send(`**${member.user.tag}** just left. We now have ${member.guild.memberCount} members left. Aww man...`); }; diff --git a/events/message.js b/events/message.js index 21463a7..5c03099 100644 --- a/events/message.js +++ b/events/message.js @@ -26,23 +26,35 @@ module.exports = (bot, msg) => { }; function parseCommand(bot, msg) { - let category; - const settings = require("../assets/settings.json"); - const prefix = settings.prefix; - if (msg.author.bot) return; + if (msg.author.bot) { + return; + } + + const settings = require('../assets/settings.json'); + const prefix = settings.prefix; + + if (!msg.content.startsWith(prefix)) { + return; + } - if (!msg.content.startsWith(prefix)) return; const args = msg.content.slice(prefix.length).trim().split(/ +/g); + + let category; const command = args.shift(); let cmd; Array.from(bot.categories.keys()).forEach(i => { const cmds = bot.categories.get(i); - if (cmds.includes(command)) category = i; - if (bot.aliases.get(i).has(command)) category = i; + if (cmds.includes(command)) { + category = i; + } + if (bot.aliases.get(i).has(command)) { + category = i; + } }); - if (!category) return; - + if (!category) { + return; + } if (bot.commands.get(category).has(command)) { cmd = bot.commands.get(category).get(command); } else if (bot.aliases.get(category).has(command)) { @@ -54,18 +66,18 @@ function parseCommand(bot, msg) { return msg.reply('This command can only be ran in a guild.'); } if (cmd.checkPermission != null) { - let result = cmd.checkPermission(bot, msg.member) - if (result != true) - { - if (result == false) return msg.reply('You are not authorized to run this command.'); + const result = cmd.checkPermission(bot, msg.member); + if (result != true) { + if (result == false) { + return msg.reply('You are not authorized to run this command.'); + } return msg.reply(result); } } try { console.log(`${msg.author.tag} ran the command '${cmd.help.name}' in the guild '${msg.member.guild.name}'`); cmd.run(bot, msg, args); - } - catch (e) { + } catch (e) { console.error(e.stack); bot.Raven.captureException(e); msg.channel.send('There was an error trying to process your command. Don\'t worry because this issue is being looked into'); diff --git a/events/messageDelete.js b/events/messageDelete.js index 5fb2007..05a3a65 100644 --- a/events/messageDelete.js +++ b/events/messageDelete.js @@ -8,8 +8,10 @@ * *************************************/ module.exports = async (bot, msg) => { - const { RichEmbed } = require('discord.js'); - if (!msg.content) return; + const {RichEmbed} = require('discord.js'); + if (!msg.content) { + return; + } try { const embed = new RichEmbed() .setColor(0x00ae86) @@ -19,12 +21,15 @@ module.exports = async (bot, msg) => { .setTimestamp() .setFooter(`Deleted message orginally created by: ${msg.author.tag}`, msg.author.avatarURL); const logChannel = await bot.plugins.settings.getStr('logs', msg.guild.id); - if (!logChannel) return; + if (!logChannel) { + return; + } const channelObj = bot.channels.find('id', logChannel); - if (!channelObj) return; - channelObj.send({ embed }); - } - catch (err) { + if (!channelObj) { + return; + } + channelObj.send({embed}); + } catch (err) { console.error(err.stack); } }; diff --git a/events/messageDeleteBulk.js b/events/messageDeleteBulk.js index 9640dbf..d62848f 100644 --- a/events/messageDeleteBulk.js +++ b/events/messageDeleteBulk.js @@ -8,7 +8,7 @@ * *************************************/ module.exports = async (bot, msgs) => { - const { RichEmbed } = require('discord.js'); + const {RichEmbed} = require('discord.js'); try { const embed = new RichEmbed() .setColor(0x00ae86) @@ -17,12 +17,15 @@ module.exports = async (bot, msgs) => { .setTimestamp() .setFooter('Messages purged'); const logChannel = await bot.plugins.settings.getStr('logs', msgs.first().guild.id); - if (!logChannel) return; + if (!logChannel) { + return; + } const channelObj = bot.channels.find('id', logChannel); - if (!channelObj) return; - channelObj.send({ embed }); - } - catch (err) { + if (!channelObj) { + return; + } + channelObj.send({embed}); + } catch (err) { console.error(err.stack); } }; diff --git a/events/messageUpdate.js b/events/messageUpdate.js index 43a6a67..c694255 100644 --- a/events/messageUpdate.js +++ b/events/messageUpdate.js @@ -8,8 +8,10 @@ * *************************************/ module.exports = async (bot, oldMsg, newMsg) => { - const { RichEmbed } = require('discord.js'); - if (oldMsg.content == newMsg.content) return; + const {RichEmbed} = require('discord.js'); + if (oldMsg.content == newMsg.content) { + return; + } try { const embed = new RichEmbed() .setColor(0x00ae86) @@ -20,12 +22,15 @@ module.exports = async (bot, oldMsg, newMsg) => { .setTimestamp() .setFooter(`Edited message originally created by: ${oldMsg.author.tag}`, oldMsg.author.avatarURL); const logChannel = await bot.plugins.settings.getStr('logs', oldMsg.guild.id); - if (!logChannel) return; + if (!logChannel) { + return; + } const channelObj = bot.channels.find('id', logChannel); - if (!channelObj) return; - channelObj.send({ embed }); - } - catch (err) { + if (!channelObj) { + return; + } + channelObj.send({embed}); + } catch (err) { console.error(err.stack); } }; diff --git a/events/ready.js b/events/ready.js index 9c30717..3d1ce67 100644 --- a/events/ready.js +++ b/events/ready.js @@ -16,7 +16,7 @@ module.exports = (bot) => { 'Finding pokemon', 'Type p:help for help', 'Fighting AstralMod', - 'Arrays start at 1', + 'Arrays start at 1' ]; bot.user.setPresence({ @@ -24,8 +24,8 @@ module.exports = (bot) => { afk: false, game: { type: 0, - name: games[Math.floor(Math.random() * games.length)], - }, + name: games[Math.floor(Math.random() * games.length)] + } }); }, 200000); }; diff --git a/package-lock.json b/package-lock.json index bf1ad83..51cf040 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4,6 +4,38 @@ "lockfileVersion": 1, "requires": true, "dependencies": { + "@babel/code-frame": { + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.5.5.tgz", + "integrity": "sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw==", + "dev": true, + "requires": { + "@babel/highlight": "^7.0.0" + } + }, + "@babel/highlight": { + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.5.0.tgz", + "integrity": "sha512-7dV4eu9gBxoM0dAnj/BCFDW9LFU0zvTrkq0ugM7pnHEgguOEeOz1so2ZghEdzviYzQEED0r4EAgpsBChKy1TRQ==", + "dev": true, + "requires": { + "chalk": "^2.0.0", + "esutils": "^2.0.2", + "js-tokens": "^4.0.0" + } + }, + "acorn": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.0.tgz", + "integrity": "sha512-kL5CuoXA/dgxlBbVrflsflzQ3PAas7RYZB52NOm/6839iVYJgKMJ3cQJD+t2i5+qFa8h3MDpEOJiS64E8JLnSQ==", + "dev": true + }, + "acorn-jsx": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.1.0.tgz", + "integrity": "sha512-tMUqwBWfLFbJbizRmEcWSLw6HnFzfdJs2sOJEOwwtVPMoH/0Ay+E703oZz78VSXZiiDcZrQ5XKjPIUQixhmgVw==", + "dev": true + }, "ajv": { "version": "6.10.2", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz", @@ -15,6 +47,39 @@ "uri-js": "^4.2.2" } }, + "ansi-escapes": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.2.1.tgz", + "integrity": "sha512-Cg3ymMAdN10wOk/VYfLV7KCQyv7EDirJ64500sU7n9UlmioEtDuU5Gd+hj73hXSU/ex7tHJSssmyftDdkMLO8Q==", + "dev": true, + "requires": { + "type-fest": "^0.5.2" + } + }, + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, "asn1": { "version": "0.2.4", "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", @@ -28,6 +93,12 @@ "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" }, + "astral-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", + "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", + "dev": true + }, "async-limiter": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz", @@ -48,6 +119,12 @@ "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==" }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, "bcrypt-pbkdf": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", @@ -77,11 +154,44 @@ "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.1.tgz", "integrity": "sha512-DdmyoGCleJnkbp3nkbxTLJ18rjDsE4yCggEwKNXkeV123sPNfOCYeDoeuOY+F2FrSjO1YXcTU+dsy96KMy+gcg==" }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true + }, "caseless": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "chardet": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", + "dev": true + }, "charenc": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz", @@ -92,6 +202,36 @@ "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.3.tgz", "integrity": "sha512-i70fVHhmV3DtTl6nqvZOnIjbY0Pe4kAUjwHj8z0zAdgBtYrJyYwLKCCuRBQ5ppkyL0AkN7HKRnETdmdp1zqNXw==" }, + "cli-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", + "dev": true, + "requires": { + "restore-cursor": "^3.1.0" + } + }, + "cli-width": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", + "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", + "dev": true + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, "combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -100,6 +240,12 @@ "delayed-stream": "~1.0.0" } }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, "cookie": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", @@ -110,6 +256,27 @@ "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, "crypt": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/crypt/-/crypt-0.0.2.tgz", @@ -138,6 +305,21 @@ } } }, + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "dev": true + }, "delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", @@ -162,6 +344,15 @@ } } }, + "doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + }, "ecc-jsbn": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", @@ -171,11 +362,151 @@ "safer-buffer": "^2.1.0" } }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "eslint": { + "version": "6.6.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-6.6.0.tgz", + "integrity": "sha512-PpEBq7b6qY/qrOmpYQ/jTMDYfuQMELR4g4WI1M/NaSDDD/bdcMb+dj4Hgks7p41kW2caXsPsEZAEAyAgjVVC0g==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "ajv": "^6.10.0", + "chalk": "^2.1.0", + "cross-spawn": "^6.0.5", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "eslint-scope": "^5.0.0", + "eslint-utils": "^1.4.3", + "eslint-visitor-keys": "^1.1.0", + "espree": "^6.1.2", + "esquery": "^1.0.1", + "esutils": "^2.0.2", + "file-entry-cache": "^5.0.1", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^5.0.0", + "globals": "^11.7.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "inquirer": "^7.0.0", + "is-glob": "^4.0.0", + "js-yaml": "^3.13.1", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.3.0", + "lodash": "^4.17.14", + "minimatch": "^3.0.4", + "mkdirp": "^0.5.1", + "natural-compare": "^1.4.0", + "optionator": "^0.8.2", + "progress": "^2.0.0", + "regexpp": "^2.0.1", + "semver": "^6.1.2", + "strip-ansi": "^5.2.0", + "strip-json-comments": "^3.0.1", + "table": "^5.2.3", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + } + }, + "eslint-scope": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.0.0.tgz", + "integrity": "sha512-oYrhJW7S0bxAFDvWqzvMPRm6pcgcnWc4QnofCAqRTRfQC0JcwenzGglTtsLyIuuWFfkqDG9vz67cnttSd53djw==", + "dev": true, + "requires": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + } + }, + "eslint-utils": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.3.tgz", + "integrity": "sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^1.1.0" + } + }, + "eslint-visitor-keys": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz", + "integrity": "sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A==", + "dev": true + }, + "espree": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/espree/-/espree-6.1.2.tgz", + "integrity": "sha512-2iUPuuPP+yW1PZaMSDM9eyVf8D5P0Hi8h83YtZ5bPc/zHYjII5khoixIUTMO794NOY8F/ThF1Bo8ncZILarUTA==", + "dev": true, + "requires": { + "acorn": "^7.1.0", + "acorn-jsx": "^5.1.0", + "eslint-visitor-keys": "^1.1.0" + } + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "esquery": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.1.tgz", + "integrity": "sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA==", + "dev": true, + "requires": { + "estraverse": "^4.0.0" + } + }, + "esrecurse": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", + "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", + "dev": true, + "requires": { + "estraverse": "^4.1.0" + } + }, + "estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true + }, + "esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true + }, "extend": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" }, + "external-editor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", + "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", + "dev": true, + "requires": { + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", + "tmp": "^0.0.33" + } + }, "extsprintf": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", @@ -191,6 +522,47 @@ "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "figures": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-3.1.0.tgz", + "integrity": "sha512-ravh8VRXqHuMvZt/d8GblBeqDMkdJMBdv/2KntFH+ra5MXkO7nxNKpzQ3n6QD/2da1kH0aWmNISdvhM7gl2gVg==", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.5" + } + }, + "file-entry-cache": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", + "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", + "dev": true, + "requires": { + "flat-cache": "^2.0.1" + } + }, + "flat-cache": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", + "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", + "dev": true, + "requires": { + "flatted": "^2.0.0", + "rimraf": "2.6.3", + "write": "1.0.3" + } + }, + "flatted": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.1.tgz", + "integrity": "sha512-a1hQMktqW9Nmqr5aktAux3JMNqaucxGcjtjWnZLHX7yyPCmlSV3M54nGYbqT8K+0GhF3NBgmJCc3ma+WOgX8Jg==", + "dev": true + }, "forever-agent": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", @@ -214,6 +586,18 @@ "minipass": "^2.6.0" } }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, "getpass": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", @@ -222,6 +606,35 @@ "assert-plus": "^1.0.0" } }, + "glob": { + "version": "7.1.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.5.tgz", + "integrity": "sha512-J9dlskqUXK1OeTOYBEn5s8aMukWMwWfs+rPTn/jn50Ux4MNXVhubL1wu/j2t+H4NVI+cXEcCaYellqaPVGXNqQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-parent": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.0.tgz", + "integrity": "sha512-qjtRgnIVmOfnKUE3NJAQEdk+lKrxfw8t5ke7SXtfMTHcjsBfOfWXCQfdb30zfDoZQ2IRSIiidmjtbHZPZ++Ihw==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true + }, "har-schema": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", @@ -236,6 +649,12 @@ "har-schema": "^2.0.0" } }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, "http-signature": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", @@ -246,6 +665,74 @@ "sshpk": "^1.7.0" } }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + }, + "import-fresh": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.1.0.tgz", + "integrity": "sha512-PpuksHKGt8rXfWEr9m9EHIpgyyaltBy8+eF6GJM0QCAxMgxCfucMF3mjecK2QsJr0amJW7gTqh5/wht0z2UhEQ==", + "dev": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + } + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "inquirer": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.0.0.tgz", + "integrity": "sha512-rSdC7zelHdRQFkWnhsMu2+2SO41mpv2oF2zy4tMhmiLWkcKbOAs87fWAJhVXttKVwhdZvymvnuM95EyEXg2/tQ==", + "dev": true, + "requires": { + "ansi-escapes": "^4.2.1", + "chalk": "^2.4.2", + "cli-cursor": "^3.1.0", + "cli-width": "^2.0.0", + "external-editor": "^3.0.3", + "figures": "^3.0.0", + "lodash": "^4.17.15", + "mute-stream": "0.0.8", + "run-async": "^2.2.0", + "rxjs": "^6.4.0", + "string-width": "^4.1.0", + "strip-ansi": "^5.1.0", + "through": "^2.3.6" + } + }, "integer": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/integer/-/integer-2.1.0.tgz", @@ -256,16 +743,65 @@ "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-promise": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", + "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", + "dev": true + }, "is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, "isstream": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "js-yaml": { + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", + "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, "jsbn": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", @@ -281,6 +817,12 @@ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, "json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", @@ -297,6 +839,16 @@ "verror": "1.10.0" } }, + "levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "dev": true, + "requires": { + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" + } + }, "lodash": { "version": "4.17.15", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", @@ -345,6 +897,21 @@ "mime-db": "1.40.0" } }, + "mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, "minimist": { "version": "0.0.8", "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", @@ -382,21 +949,116 @@ "minimist": "0.0.8" } }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "mute-stream": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", + "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", + "dev": true + }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, + "nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, "oauth-sign": { "version": "0.9.0", "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "onetime": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.0.tgz", + "integrity": "sha512-5NcSkPHhwTVFIQN+TUqXoS5+dlElHXdpAWu9I0HP20YOtIi+aZ0Ct82jdlILDxjLEAWwvm+qj1m6aEtsDVmm6Q==", + "dev": true, + "requires": { + "mimic-fn": "^2.1.0" + } + }, + "optionator": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", + "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", + "dev": true, + "requires": { + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.4", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "wordwrap": "~1.0.0" + } + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true + }, + "parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "requires": { + "callsites": "^3.0.0" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true + }, "performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" }, + "prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "dev": true + }, "prism-media": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/prism-media/-/prism-media-0.0.1.tgz", "integrity": "sha1-o0JcnKvVDRxsAuVDlBoRiVZnvRA=" }, + "progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true + }, "psl": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.4.0.tgz", @@ -435,6 +1097,12 @@ "uuid": "3.0.0" } }, + "regexpp": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", + "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", + "dev": true + }, "request": { "version": "2.88.0", "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", @@ -502,6 +1170,49 @@ "lodash": "^4.17.11" } }, + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true + }, + "restore-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", + "dev": true, + "requires": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + } + }, + "rimraf": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "run-async": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", + "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", + "dev": true, + "requires": { + "is-promise": "^2.1.0" + } + }, + "rxjs": { + "version": "6.5.3", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.3.tgz", + "integrity": "sha512-wuYsAYYFdWTAnAaPoKGNhfpWwKZbJW+HgAJ+mImp+Epl7BG8oNWBCTyRM8gba9k4lk8BgWdoYm21Mo/RYhhbgA==", + "dev": true, + "requires": { + "tslib": "^1.9.0" + } + }, "safe-buffer": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", @@ -512,11 +1223,63 @@ "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true + }, + "signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "dev": true + }, + "slice-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", + "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "astral-regex": "^1.0.0", + "is-fullwidth-code-point": "^2.0.0" + }, + "dependencies": { + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + } + } + }, "snekfetch": { "version": "4.0.0-rc.0", "resolved": "https://registry.npmjs.org/snekfetch/-/snekfetch-4.0.0-rc.0.tgz", "integrity": "sha512-0WXLTGBL46tLUf/ZIpaLsXH7krxN/dhOpggbcCkVXTBOE+1oUn56hbTZIhnP72ci3ounQjUR3yhXy8w8JoS5CA==" }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, "sshpk": { "version": "1.16.1", "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", @@ -550,6 +1313,78 @@ "resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz", "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=" }, + "string-width": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.1.0.tgz", + "integrity": "sha512-NrX+1dVVh+6Y9dnQ19pR0pP4FiEIlUvdTGn8pw6CKTNq5sgib2nIhmUNT5TAmhWmvKr3WcxBcP3E8nWezuipuQ==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^5.2.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + }, + "strip-json-comments": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.0.1.tgz", + "integrity": "sha512-VTyMAUfdm047mwKl+u79WIdrZxtFtn+nBxHeb844XBQ9uMNTuTHdx2hc5RiAJYqwTj3wc/xe5HLSdJSkJ+WfZw==", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "table": { + "version": "5.4.6", + "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", + "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", + "dev": true, + "requires": { + "ajv": "^6.10.2", + "lodash": "^4.17.14", + "slice-ansi": "^2.1.0", + "string-width": "^3.0.0" + }, + "dependencies": { + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + } + } + }, "tar": { "version": "4.4.13", "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.13.tgz", @@ -571,11 +1406,32 @@ } } }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "dev": true + }, "timed-out": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/timed-out/-/timed-out-4.0.1.tgz", "integrity": "sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8=" }, + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "requires": { + "os-tmpdir": "~1.0.2" + } + }, "tough-cookie": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", @@ -592,6 +1448,12 @@ } } }, + "tslib": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz", + "integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==", + "dev": true + }, "tunnel-agent": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", @@ -605,6 +1467,21 @@ "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.0.tgz", "integrity": "sha1-cT2LgY2kIGh0C/aDhtBHnmb8ins=" }, + "type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "dev": true, + "requires": { + "prelude-ls": "~1.1.2" + } + }, + "type-fest": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.5.2.tgz", + "integrity": "sha512-DWkS49EQKVX//Tbupb9TFa19c7+MK1XmzkrZUR8TAktmE/DizXoaoJV6TZ/tSIPXipqNiRI6CyAe7x69Jb6RSw==", + "dev": true + }, "uri-js": { "version": "4.2.2", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", @@ -625,6 +1502,12 @@ "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.0.0.tgz", "integrity": "sha1-Zyj8BFnEUNeWqZwxg3VpvfZy1yg=" }, + "v8-compile-cache": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.1.0.tgz", + "integrity": "sha512-usZBT3PW+LOjM25wbqIlZwPeJV+3OSz3M1k1Ws8snlW39dZyYL9lOGC5FgPVHfk0jKmjiDV8Z0mIbVQPiwFs7g==", + "dev": true + }, "verror": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", @@ -635,6 +1518,36 @@ "extsprintf": "^1.2.0" } }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", + "dev": true + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "write": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz", + "integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==", + "dev": true, + "requires": { + "mkdirp": "^0.5.1" + } + }, "ws": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/ws/-/ws-4.1.0.tgz", diff --git a/package.json b/package.json index 37b9972..35205c2 100644 --- a/package.json +++ b/package.json @@ -16,5 +16,8 @@ "request": "^2.88.0", "request-promise": "^4.2.4", "snekfetch": "^4.0.0-rc.0" + }, + "devDependencies": { + "eslint": "^6.6.0" } } diff --git a/plugins/economy.js b/plugins/economy.js index 3658ce8..a1273d7 100644 --- a/plugins/economy.js +++ b/plugins/economy.js @@ -12,10 +12,9 @@ exports.get = async (userid) => { const amount = await db.fetch(`money_${userid}`); if (amount) { return amount; - } - else { + } else { await db.set(`money_${userid}`, 0); - return await db.fetch(`money_${userid}`); + return db.fetch(`money_${userid}`); } }; @@ -23,8 +22,7 @@ exports.add = async (userid, money) => { const amount = await db.fetch(`money_${userid}`); if (amount) { await db.set(`money_${userid}`, amount + money); - } - else { + } else { await db.set(`money_${userid}`, money); } }; @@ -33,8 +31,7 @@ exports.subtract = async (userid, money) => { const amount = await db.fetch(`money_${userid}`); if (amount) { await db.set(`money_${userid}`, amount - money); - } - else { + } else { await db.set(`money_${userid}`, 0 - money); } }; diff --git a/plugins/gyms.js b/plugins/gyms.js index d4b1afe..8dd0f9d 100644 --- a/plugins/gyms.js +++ b/plugins/gyms.js @@ -9,15 +9,23 @@ exports.isTeam = (member) => { let team; - if (member.roles.find('name', 'Skull')) team = 'Skull'; - if (member.roles.find('name', 'Flare')) team = 'Flare'; - return team ? true : false; + if (member.roles.find('name', 'Skull')) { + team = 'Skull'; + } + if (member.roles.find('name', 'Flare')) { + team = 'Flare'; + } + return Boolean(team); }; exports.getTeam = (member) => { let team; - if (member.roles.find('name', 'Skull')) team = 'Skull'; - if (member.roles.find('name', 'Flare')) team = 'Flare'; + if (member.roles.find('name', 'Skull')) { + team = 'Skull'; + } + if (member.roles.find('name', 'Flare')) { + team = 'Flare'; + } return team; }; @@ -26,7 +34,7 @@ exports.getOwnerId = (title) => { }; exports.getGymString = (bot, member) => { - return 'Current Owner: ' + member.id + '/' + member.user.tag + '/' + bot.plugins.gyms.getTeam(member); + return `Current Owner: ${ member.id }/${ member.user.tag }/${ bot.plugins.gyms.getTeam(member)}`; }; exports.isOwned = (title) => { diff --git a/plugins/settings.js b/plugins/settings.js index bfa15d5..c696a96 100644 --- a/plugins/settings.js +++ b/plugins/settings.js @@ -12,10 +12,9 @@ exports.getInt = async (key, guildID) => { const value = await db.fetch(`settings_${guildID}_${key}`); if (value) { return value; - } - else { + } else { await db.set(`settings_${guildID}_${key}`, 0); - return await db.fetch(`settings_${guildID}_${key}`); + return db.fetch(`settings_${guildID}_${key}`); } }; @@ -23,10 +22,9 @@ exports.getStr = async (key, guildID) => { const value = await db.fetch(`settings_${guildID}_${key}`); if (value) { return value; - } - else { + } else { await db.set(`settings_${guildID}_${key}`, ''); - return await db.fetch(`settings_${guildID}_${key}`); + return db.fetch(`settings_${guildID}_${key}`); } }; @@ -34,10 +32,9 @@ exports.getBool = async (key, guildID) => { const value = await db.fetch(`settings_${guildID}_${key}`); if (value) { return value; - } - else { + } else { await db.set(`settings_${guildID}_${key}`, false); - return await db.fetch(`settings_${guildID}_${key}`); + return db.fetch(`settings_${guildID}_${key}`); } }; diff --git a/plugins/whitelist.js b/plugins/whitelist.js index 41b4398..dc594a7 100644 --- a/plugins/whitelist.js +++ b/plugins/whitelist.js @@ -20,9 +20,8 @@ exports.isWhitelist = async (guildID) => { const value = await db.fetch(`whitelist_${guildID}`); if (value) { return value; - } - else { + } else { await db.set(`whitelist_${guildID}`, false); - return await db.fetch(`whitelist_${guildID}`); + return db.fetch(`whitelist_${guildID}`); } };