From d6877a3035e094ac94e2c85702d36a73e7290df7 Mon Sep 17 00:00:00 2001 From: Tom Hunkapiller Date: Sun, 13 May 2018 20:08:23 -0500 Subject: [PATCH] update dependencies; fix weather issue #114; update deprecation usage (.sendMessage -> .send); bot now runs if help-directory is missing instead of crashing --- TheAwesomeBot.js | 14 +- commands/eval/eval.js | 2 +- commands/help/help.js | 2 +- commands/pbf/pbf.js | 8 +- commands/pro/pro.js | 21 ++- commands/quickref/quickref.js | 6 +- commands/stream/stream.js | 36 ++-- commands/uptime/uptime.js | 2 +- commands/vote/vote.js | 14 +- commands/weather/weather.js | 5 +- commands/xkcd/xkcd.js | 4 +- package-lock.json | 342 +++++++++++++++++++--------------- package.json | 6 +- 13 files changed, 260 insertions(+), 202 deletions(-) diff --git a/TheAwesomeBot.js b/TheAwesomeBot.js index ca0db9e..7aac267 100644 --- a/TheAwesomeBot.js +++ b/TheAwesomeBot.js @@ -35,6 +35,11 @@ class TheAwesomeBot { return; } + // don't respond to dm + if (message.channel.type === 'dm') { + return; + } + // check if message is a command const cmdMatch = message.cleanContent.match(this.cmd_re); @@ -44,7 +49,7 @@ class TheAwesomeBot { let helpText = 'maybe try these valid commands? *kthnxbye!*\n\n```'; helpText += this.usageList; helpText += '```'; - message.channel.sendMessage(helpText); + message.channel.send(helpText); } return; } @@ -58,7 +63,7 @@ class TheAwesomeBot { try { showUsage = this.commands[cmd].run(this, message, cmdArgs); } catch (err) { - message.channel.sendMessage('There was an error running the command:\n' + + message.channel.send('There was an error running the command:\n' + '```\n' + err.toString() + '\n```'); console.error(err); console.error(err.stack); @@ -69,7 +74,7 @@ class TheAwesomeBot { if (typeof usage !== 'string') { usage = usage.join('\n'); } - message.channel.sendMessage('```\n' + usage + '\n```'); + message.channel.send('```\n' + usage + '\n```'); } }; } @@ -86,7 +91,7 @@ class TheAwesomeBot { } serverNewMember() { - return ((server, user) => this.client.sendMessage(user, this.usageList)); + return ((server, user) => this.client.send(user, this.usageList)); } onDisconnected() { @@ -156,4 +161,3 @@ class TheAwesomeBot { } module.exports = TheAwesomeBot; - diff --git a/commands/eval/eval.js b/commands/eval/eval.js index 6b3105d..3c2ceb7 100644 --- a/commands/eval/eval.js +++ b/commands/eval/eval.js @@ -101,7 +101,7 @@ module.exports = { 80, lang, gentoken(apiToken)); - message.channel.sendMessage('⏲ evaluating...') + message.channel.send('⏲ evaluating...') .then((evalMsg) => { let newContent = ''; repl.evaluateOnce( diff --git a/commands/help/help.js b/commands/help/help.js index bf81ff9..64e48f7 100644 --- a/commands/help/help.js +++ b/commands/help/help.js @@ -22,7 +22,7 @@ module.exports = { run: (bot, message) => { let r = 'This command is deprecated.\n'; r += 'See https://github.com/progdisc/resources for our new and improved resource list.'; - message.channel.sendMessage(r); + message.channel.send(r); }, init: () => { diff --git a/commands/pbf/pbf.js b/commands/pbf/pbf.js index c885535..5d2b216 100644 --- a/commands/pbf/pbf.js +++ b/commands/pbf/pbf.js @@ -9,12 +9,12 @@ function parsePbfLink(pbfLink, message) { if (htmlBody('#topimg')) { const img = htmlBody('#topimg'); - message.channel.sendMessage('```diff\n' + + message.channel.send('```diff\n' + `Title: ${img.attr('alt')}\n` + '```\n' + `http://pbfcomics.com${img.attr('src')}`); } else { - message.channel.sendMessage(`I'm sorry ${message.author}, i couldn't find a PBF Comic.`); + message.channel.send(`I'm sorry ${message.author}, i couldn't find a PBF Comic.`); } } }); @@ -48,12 +48,12 @@ module.exports = { } }); } catch (e) { - message.channel.sendMessage('There was a problem with DuckDuckGo query.'); + message.channel.send('There was a problem with DuckDuckGo query.'); } // we are done with finding a link if (!pbfLink) { // link is either empty (this should NOT happen) or we don't have a link - message.channel.sendMessage(`I'm sorry ${message.author}, i couldn't find a PBF Comic.`); + message.channel.send(`I'm sorry ${message.author}, i couldn't find a PBF Comic.`); } else { parsePbfLink(pbfLink, message); } diff --git a/commands/pro/pro.js b/commands/pro/pro.js index 616de1e..34b050c 100644 --- a/commands/pro/pro.js +++ b/commands/pro/pro.js @@ -39,6 +39,12 @@ function loadAndMatchPros(bot) { updateProsMatcher(); const helpChannel = bot.client.channels.find('name', 'help-directory'); + if (!helpChannel) { + const err = new Error('help-directory channel not found'); + err.intentional = true; + return Promise.reject(err); + } + return helpChannel.fetchMessages({ limit: 100 }) .then((messages) => { messages.forEach((messageObj) => { @@ -83,9 +89,9 @@ module.exports = { if (memberId in proHelpText) { let response = `**Help Directory entry for user ${message.mentions.users.first().username}:**\n`; response += proHelpText[memberId]; - message.channel.sendMessage(response); + message.channel.send(response); } else { - message.channel.sendMessage(`Could not find user ${message.mentions.users.first().username} in directory`); + message.channel.send(`Could not find user ${message.mentions.users.first().username} in directory`); } return false; } @@ -94,7 +100,7 @@ module.exports = { if (lang === 'reset' && bot.isAdminOrMod(message.member)) { loadAndMatchPros(bot).then(() => { - message.channel.sendMessage('Pros list refreshed.'); + message.channel.send('Pros list refreshed.'); return false; }) .catch((err) => { @@ -109,7 +115,7 @@ module.exports = { lang = ((match && match[1]) || lang).toLowerCase(); const foundPros = getPros(bot, lang); - message.channel.sendMessage(foundPros ? + message.channel.send(foundPros ? `Here are some pros online that can help with **${pros[lang].original}**: \n${foundPros}` : `No pros found for ${cmdArgs} :(`); return false; @@ -122,9 +128,10 @@ module.exports = { console.log('Done reading in pros from #helpdirectory!'); }) .catch((err) => { - console.error(err); - console.error(err.stack); + console.error('[error]', err.message); + if (!err.intentional) { + console.error(err.stack); + } }); }, }; - diff --git a/commands/quickref/quickref.js b/commands/quickref/quickref.js index fdd8b11..1ea641f 100644 --- a/commands/quickref/quickref.js +++ b/commands/quickref/quickref.js @@ -23,17 +23,17 @@ module.exports = { const response = references[cmdArgs.toLowerCase()]; if (response) { - message.channel.sendMessage( + message.channel.send( `${response}`); } else { - message.channel.sendMessage('I don\'t have any references for that. If you have a suggestion, let us know!'); + message.channel.send('I don\'t have any references for that. If you have a suggestion, let us know!'); } } else { let r = '\nreferences I have ready to go:'; r += '\n```'; r += Object.keys(references).map(t => `\n - ${t}`).join(''); r += '\n```'; - message.channel.sendMessage(r); + message.channel.send(r); } }, init: () => { diff --git a/commands/stream/stream.js b/commands/stream/stream.js index 558486c..f3b5792 100644 --- a/commands/stream/stream.js +++ b/commands/stream/stream.js @@ -63,11 +63,11 @@ const commands = { let [, topic, link, user] = args.split(' '); // eslint-disable-line prefer-const if (!topic || !link) { - return message.channel.sendMessage('err, please provide topic and link!'); + return message.channel.send('err, please provide topic and link!'); } if (link.indexOf('http://') === -1 && link.indexOf('https://') === -1) { - return message.channel.sendMessage('a valid link must be supplied (starting with http/https)!'); + return message.channel.send('a valid link must be supplied (starting with http/https)!'); } user = message.mentions.users.first(); @@ -93,14 +93,14 @@ const commands = { streams[topic][user.id].link = link; existingChannel.setTopic(link).catch(err => - existingChannel.sendMessage('There was an error setting the existings channel topic!')); + existingChannel.send('There was an error setting the existings channel topic!')); - return message.channel.sendMessage('Channel already exists.. Updated stream link!'); + return message.channel.send('Channel already exists.. Updated stream link!'); } return createChannel(channelFormat, bot, message, topic, user.id) .then(createdChannel => setTopicToLink(createdChannel, link, bot, topic, user.id)) - .then(channelWithTopic => message.channel.sendMessage(`Created ${channelWithTopic}!`)) - .catch(err => message.channel.sendMessage(`Sorry, could not create channel (${err})`)); + .then(channelWithTopic => message.channel.send(`Created ${channelWithTopic}!`)) + .catch(err => message.channel.send(`Sorry, could not create channel (${err})`)); }, remove: function handleRemoveStream(bot, message) { @@ -110,7 +110,7 @@ const commands = { const id = user ? user.id : message.author.id; if (!bot.isAdminOrMod(message.member) && id !== message.author.id) { - message.channel.sendMessage('Only admins or mods can remove others\' streams.'); + message.channel.send('Only admins or mods can remove others\' streams.'); return; } @@ -121,13 +121,13 @@ const commands = { deleteStreamInObject(topic, id); channelToDelete.delete().catch(err => - message.channel.sendMessage('Sorry, could not delete channel')); + message.channel.send('Sorry, could not delete channel')); - message.channel.sendMessage( + message.channel.send( `Removed ${user || message.author} from active streamers list and deleted #${channelToDelete.name}`); } else { // user has no stream in this topic - // return message.channel.sendMessage(`Could not find ${user}`); + // return message.channel.send(`Could not find ${user}`); } }); }, @@ -138,7 +138,7 @@ const commands = { const topics = Object.keys(streams); if (topics.length === 0) { - return message.channel.sendMessage('No streams! :frowning:'); + return message.channel.send('No streams! :frowning:'); } topics.forEach((topic) => { @@ -151,19 +151,22 @@ const commands = { }); }); - return message.channel.sendMessage(buildMessage); + return message.channel.send(buildMessage); }, removeall: function removeAllStreams(bot, message) { if (message && !bot.isAdminOrMod(message.member)) { - message.channel.sendMessage('Only Admins or Mods can delete all stream channels'); + message.channel.send('Only Admins or Mods can delete all stream channels'); return; } console.log('Removing all stream channels..'); - bot.client.guilds.first().channels.filter(channel => - channel && channel.name !== undefined && channel.name.startsWith('stream')) - .forEach(channel => channel.delete()); + + bot.client.guilds.array().forEach((guild) => { + guild.channels.filter(channel => + channel && channel.name !== undefined && channel.name.startsWith('stream')) + .forEach(channel => channel.delete()); + }); Object.keys(streams).forEach(topic => delete streams[topic]); }, @@ -188,4 +191,3 @@ module.exports = { commands.removeall(bot); }, }; - diff --git a/commands/uptime/uptime.js b/commands/uptime/uptime.js index d670504..997f398 100644 --- a/commands/uptime/uptime.js +++ b/commands/uptime/uptime.js @@ -3,7 +3,7 @@ const time = require('../../lib/utils.js').time; module.exports = { usage: 'uptime - prints my uptime', run: (bot, message) => { - message.channel.sendMessage( + message.channel.send( `Uptime: ${time.timeElapsed(bot.bootTime, new Date())}`); }, }; diff --git a/commands/vote/vote.js b/commands/vote/vote.js index 5707cad..b7f003d 100644 --- a/commands/vote/vote.js +++ b/commands/vote/vote.js @@ -42,7 +42,7 @@ function processVote(type, bot, message, guild, member) { if (!voting) { // sets a timeout for this voting const timeoutClj = () => { - message.channel.sendMessage(`Vote to ${type} ${member} has timed out. Phew!`); + message.channel.send(`Vote to ${type} ${member} has timed out. Phew!`); delete currentVotes[type][member.user.username]; }; const timeoutObj = setTimeout(timeoutClj, bot.settings.voting.timeout_in_minutes * 1000 * 60); @@ -62,13 +62,13 @@ function processVote(type, bot, message, guild, member) { voting.votes.push(message.author.username); if (voting.votes.length >= bot.settings.voting.voteThreshold) { clearTimeout(voting.timeout); - message.channel.sendMessage(`Sorry, ${member}, but their wish is my command!`); + message.channel.send(`Sorry, ${member}, but their wish is my command!`); voteTypes[type](bot, member, guild); delete currentVotes[type][member.user.username]; } else { let msg = `[${voting.votes.length}/${bot.settings.voting.voteThreshold}]`; msg += ` votes to ${type} ${member}!`; - message.channel.sendMessage(msg); + message.channel.send(msg); } } @@ -86,7 +86,7 @@ module.exports = { const user = message.mentions.users.first(); if (!user) { - message.channel.sendMessage('You need to specify a valid member!'); + message.channel.send('You need to specify a valid member!'); return false; } const member = guild.members.get(user.id); @@ -94,17 +94,17 @@ module.exports = { // user validation // warning: assume bot is in one guild only if (user === message.author) { - message.channel.sendMessage('You can\'t start a vote against yourself, silly.'); + message.channel.send('You can\'t start a vote against yourself, silly.'); return false; } else if (user === bot.client.user) { - message.channel.sendMessage(`I'm sorry ${message.author}, I'm afraid I can't let you do that.,`); + message.channel.send(`I'm sorry ${message.author}, I'm afraid I can't let you do that.,`); return false; } // roles validation const userRoles = new Set(member.roles.array().map(r => r.name)); if (setIntersection(userRoles, new Set(bot.settings.voting.immuneRoles)).size > 0) { - message.channel.sendMessage('try.is(\'nice\') === true'); + message.channel.send('try.is(\'nice\') === true'); return false; } diff --git a/commands/weather/weather.js b/commands/weather/weather.js index 161f864..f76abdc 100644 --- a/commands/weather/weather.js +++ b/commands/weather/weather.js @@ -44,9 +44,8 @@ function getWeatherData(location) { const offset = weatherData.offset; const utcTime = weatherData.currently.time; - // datetime is weird in javascript, please do change this part if you can - const localTime = new Date(utcTime * 1000); - localTime.setHours(localTime.getHours() + offset); + const localTime = new Date(1000 * (utcTime + (offset * 60 * 60))); + let dateString; // toGMTString prints out timezone of host so we slice it off if (offset > 0) { diff --git a/commands/xkcd/xkcd.js b/commands/xkcd/xkcd.js index 28be82e..2f06229 100644 --- a/commands/xkcd/xkcd.js +++ b/commands/xkcd/xkcd.js @@ -69,10 +69,10 @@ module.exports = { } findXkcdFromKeywords(cmdArgs).then((data) => { - message.channel.sendMessage(data); + message.channel.send(data); }) .catch((err) => { - message.channel.sendMessage(err); + message.channel.send(err); }); return false; diff --git a/package-lock.json b/package-lock.json index 65cff5e..cb26d6f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -31,6 +31,7 @@ "version": "4.11.8", "resolved": "https://registry.npmjs.org/ajv/-/ajv-4.11.8.tgz", "integrity": "sha1-gv+wKynmYq5TvcIK8VlHcGc5xTY=", + "dev": true, "requires": { "co": "4.6.0", "json-stable-stringify": "1.0.1" @@ -121,9 +122,9 @@ "integrity": "sha1-2sh4dxPJlmhJ/IGAd36+nB3fO4Y=" }, "assert-plus": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz", - "integrity": "sha1-104bh+ev/A24qttwIfP+SBAasjQ=" + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" }, "ast-types-flow": { "version": "0.0.7", @@ -131,20 +132,25 @@ "integrity": "sha1-9wtzXGvKGlycItmCw+Oef+ujva0=", "dev": true }, + "async-limiter": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz", + "integrity": "sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg==" + }, "asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" }, "aws-sign2": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz", - "integrity": "sha1-FDQt0428yU0OW4fXY81jYSwOeU8=" + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" }, "aws4": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz", - "integrity": "sha1-g+9cqGCysy5KDe7e6MdxudtXRx4=" + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.7.0.tgz", + "integrity": "sha512-32NDda82rhwD9/JBCCkB+MRYDp0oSvlo2IL6rQWA10PQi7tDUM3eqMSltXmY+Oyl/7N3P3qNtAlv7X0d9bI28w==" }, "babel-code-frame": { "version": "6.26.0", @@ -170,6 +176,14 @@ "optional": true, "requires": { "tweetnacl": "0.14.5" + }, + "dependencies": { + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "optional": true + } } }, "bluebird": { @@ -183,11 +197,11 @@ "integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=" }, "boom": { - "version": "2.10.1", - "resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz", - "integrity": "sha1-OciRjO/1eZ+D+UkqhI9iWt0Mdm8=", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/boom/-/boom-4.3.1.tgz", + "integrity": "sha1-T4owBctKfjiJ90kDD9JbluAdLjE=", "requires": { - "hoek": "2.16.3" + "hoek": "4.2.1" } }, "brace-expansion": { @@ -295,9 +309,9 @@ "dev": true }, "combined-stream": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz", - "integrity": "sha1-k4NwpXtKUd6ix3wV1cX9+JUWQAk=", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", + "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", "requires": { "delayed-stream": "1.0.0" } @@ -337,11 +351,21 @@ "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" }, "cryptiles": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz", - "integrity": "sha1-O9/s3GCBR8HGcgL6KR59ylnqo7g=", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-3.1.2.tgz", + "integrity": "sha1-qJ+7Ig9c4l7FboxKqKT9e1sNKf4=", "requires": { - "boom": "2.10.1" + "boom": "5.2.0" + }, + "dependencies": { + "boom": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/boom/-/boom-5.2.0.tgz", + "integrity": "sha512-Z5BTk6ZRe4tXXQlkqftmsAUANpXmuwlsF5Oov8ThoMbQRzdGTA1ngYRW160GexgOgjsFOKJz0LYhoNi+2AMBUw==", + "requires": { + "hoek": "4.2.1" + } + } } }, "css-select": { @@ -381,13 +405,6 @@ "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", "requires": { "assert-plus": "1.0.0" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" - } } }, "debug": { @@ -448,15 +465,22 @@ "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" }, "discord.js": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-11.1.0.tgz", - "integrity": "sha1-U1HVnjeY9TbeGXXpLK5NEa89kmY=", - "requires": { - "long": "3.2.0", - "prism-media": "0.0.1", - "snekfetch": "3.2.9", - "tweetnacl": "0.14.5", - "ws": "2.3.1" + "version": "11.3.2", + "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-11.3.2.tgz", + "integrity": "sha512-Abw9CTMX3Jb47IeRffqx2VNSnXl/OsTdQzhvbw/JnqCyqc2imAocc7pX2HoRmgKd8CgSqsjBFBneusz/E16e6A==", + "requires": { + "long": "4.0.0", + "prism-media": "0.0.2", + "snekfetch": "3.6.4", + "tweetnacl": "1.0.0", + "ws": "4.1.0" + }, + "dependencies": { + "snekfetch": { + "version": "3.6.4", + "resolved": "https://registry.npmjs.org/snekfetch/-/snekfetch-3.6.4.tgz", + "integrity": "sha512-NjxjITIj04Ffqid5lqr7XdgwM7X61c/Dns073Ly170bPQHLm6jkmelye/eglS++1nfTWktpP6Y2bFXjdPlQqdw==" + } } }, "doctrine": { @@ -877,6 +901,16 @@ "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" }, + "fast-deep-equal": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", + "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=" + }, + "fast-json-stable-stringify": { + "version": "2.0.0", + "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", @@ -946,12 +980,12 @@ "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" }, "form-data": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.1.4.tgz", - "integrity": "sha1-M8GDrPGTJ27KqYFDpp6Uv+4XUNE=", + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz", + "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", "requires": { "asynckit": "0.4.0", - "combined-stream": "1.0.5", + "combined-stream": "1.0.6", "mime-types": "2.1.16" } }, @@ -988,13 +1022,6 @@ "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", "requires": { "assert-plus": "1.0.0" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" - } } }, "glob": { @@ -1038,17 +1065,30 @@ "dev": true }, "har-schema": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-1.0.5.tgz", - "integrity": "sha1-0mMTX0MwfALGAq/I/pWXDAFRNp4=" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" }, "har-validator": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-4.2.1.tgz", - "integrity": "sha1-M0gdDxu/9gDdID11gSpqX7oALio=", + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.0.3.tgz", + "integrity": "sha1-ukAsJmGU8VlW7xXg/PJCmT9qff0=", "requires": { - "ajv": "4.11.8", - "har-schema": "1.0.5" + "ajv": "5.5.2", + "har-schema": "2.0.0" + }, + "dependencies": { + "ajv": { + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", + "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", + "requires": { + "co": "4.6.0", + "fast-deep-equal": "1.1.0", + "fast-json-stable-stringify": "2.0.0", + "json-schema-traverse": "0.3.1" + } + } } }, "has": { @@ -1070,20 +1110,20 @@ } }, "hawk": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz", - "integrity": "sha1-B4REvXwWQLD+VA0sm3PVlnjo4cQ=", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/hawk/-/hawk-6.0.2.tgz", + "integrity": "sha512-miowhl2+U7Qle4vdLqDdPt9m09K6yZhkLDTWGoUiUzrQCn+mHHSmfJgAyGaLRZbPmTqfFFjRV1QWCW0VWUJBbQ==", "requires": { - "boom": "2.10.1", - "cryptiles": "2.0.5", - "hoek": "2.16.3", - "sntp": "1.0.9" + "boom": "4.3.1", + "cryptiles": "3.1.2", + "hoek": "4.2.1", + "sntp": "2.1.0" } }, "hoek": { - "version": "2.16.3", - "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz", - "integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0=" + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/hoek/-/hoek-4.2.1.tgz", + "integrity": "sha512-QLg82fGkfnJ/4iy1xZ81/9SIJiq1NGFUMGs6ParyjBZr6jW2Ufj/snDqTHixNlHdPNwN2RLVD0Pi3igeK9+JfA==" }, "hosted-git-info": { "version": "2.5.0", @@ -1105,13 +1145,13 @@ } }, "http-signature": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz", - "integrity": "sha1-33LiZwZs0Kxn+3at+OE0qPvPkb8=", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", "requires": { - "assert-plus": "0.2.0", + "assert-plus": "1.0.0", "jsprim": "1.4.1", - "sshpk": "1.13.1" + "sshpk": "1.14.1" } }, "ignore": { @@ -1327,10 +1367,16 @@ "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" }, + "json-schema-traverse": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", + "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=" + }, "json-stable-stringify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=", + "dev": true, "requires": { "jsonify": "0.0.0" } @@ -1343,7 +1389,8 @@ "jsonify": { "version": "0.0.0", "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", - "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=" + "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=", + "dev": true }, "jsonpointer": { "version": "4.0.1", @@ -1487,9 +1534,9 @@ "integrity": "sha1-G7nzFO9ri63tE7VJFpsqlF62jk0=" }, "long": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/long/-/long-3.2.0.tgz", - "integrity": "sha1-2CG3E4yhy1gcFymQ7xTbIAtcR0s=" + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", + "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" }, "mime-db": { "version": "1.29.0", @@ -1708,9 +1755,9 @@ } }, "performance-now": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-0.2.0.tgz", - "integrity": "sha1-M+8wxcd9TqIcWlOGnZG1bY8lVeU=" + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" }, "pify": { "version": "2.3.0", @@ -1772,9 +1819,9 @@ } }, "prism-media": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/prism-media/-/prism-media-0.0.1.tgz", - "integrity": "sha1-o0JcnKvVDRxsAuVDlBoRiVZnvRA=" + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/prism-media/-/prism-media-0.0.2.tgz", + "integrity": "sha512-L6yc8P5NVG35ivzvfI7bcTYzqFV+K8gTfX9YaJbmIFfMXTs71RMnAupvTQPTCteGsiOy9QcNLkQyWjAafY/hCQ==" }, "process-nextick-args": { "version": "1.0.7", @@ -1793,9 +1840,9 @@ "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" }, "qs": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.4.0.tgz", - "integrity": "sha1-E+JtKK1rD/qpExLNO/cI7TUecjM=" + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" }, "re-emitter": { "version": "1.1.3", @@ -1878,49 +1925,64 @@ } }, "request": { - "version": "2.81.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.81.0.tgz", - "integrity": "sha1-xpKJRqDgbF+Nb4qTM0af/aRimKA=", + "version": "2.85.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.85.0.tgz", + "integrity": "sha512-8H7Ehijd4js+s6wuVPLjwORxD4zeuyjYugprdOXlPSqaApmL/QOy+EB/beICHVCHkGMKNh5rvihb5ov+IDw4mg==", "requires": { - "aws-sign2": "0.6.0", - "aws4": "1.6.0", + "aws-sign2": "0.7.0", + "aws4": "1.7.0", "caseless": "0.12.0", - "combined-stream": "1.0.5", + "combined-stream": "1.0.6", "extend": "3.0.1", "forever-agent": "0.6.1", - "form-data": "2.1.4", - "har-validator": "4.2.1", - "hawk": "3.1.3", - "http-signature": "1.1.1", + "form-data": "2.3.2", + "har-validator": "5.0.3", + "hawk": "6.0.2", + "http-signature": "1.2.0", "is-typedarray": "1.0.0", "isstream": "0.1.2", "json-stringify-safe": "5.0.1", - "mime-types": "2.1.16", + "mime-types": "2.1.18", "oauth-sign": "0.8.2", - "performance-now": "0.2.0", - "qs": "6.4.0", + "performance-now": "2.1.0", + "qs": "6.5.2", "safe-buffer": "5.1.1", "stringstream": "0.0.5", - "tough-cookie": "2.3.2", + "tough-cookie": "2.3.4", "tunnel-agent": "0.6.0", - "uuid": "3.1.0" + "uuid": "3.2.1" + }, + "dependencies": { + "mime-db": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.33.0.tgz", + "integrity": "sha512-BHJ/EKruNIqJf/QahvxwQZXKygOQ256myeN/Ew+THcAa5q+PjyTTMMeNQC4DZw5AwfvelsUrA6B67NKMqXDbzQ==" + }, + "mime-types": { + "version": "2.1.18", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.18.tgz", + "integrity": "sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==", + "requires": { + "mime-db": "1.33.0" + } + } } }, "request-promise": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/request-promise/-/request-promise-4.2.1.tgz", - "integrity": "sha1-fuxWyJMXqCLL/qmbA5zlQ8LhX2c=", + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/request-promise/-/request-promise-4.2.2.tgz", + "integrity": "sha1-0epG1lSm7k+O5qT+oQGMIpEZBLQ=", "requires": { - "bluebird": "3.5.0", + "bluebird": "3.5.1", "request-promise-core": "1.1.1", "stealthy-require": "1.1.1", - "tough-cookie": "2.3.2" + "tough-cookie": "2.3.4" }, "dependencies": { "bluebird": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.0.tgz", - "integrity": "sha1-eRQg1/VR7qKJdFOop3ZT+WYG1nw=" + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.1.tgz", + "integrity": "sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA==" } } }, @@ -2028,17 +2090,12 @@ "integrity": "sha1-7b+JA/ZvfOL46v1s7tZeJkyDGzU=", "dev": true }, - "snekfetch": { - "version": "3.2.9", - "resolved": "https://registry.npmjs.org/snekfetch/-/snekfetch-3.2.9.tgz", - "integrity": "sha512-0ZYxGRMtgBska6uQ616F0jcPYad/sLe+uBJJ2vewD62ftEFnh6rY5mza05KoUS5UWcclMuiUfAZSf10ZYnkOZA==" - }, "sntp": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz", - "integrity": "sha1-ZUEYTMkK7qbG57NeJlkIJEPGYZg=", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/sntp/-/sntp-2.1.0.tgz", + "integrity": "sha512-FL1b58BDrqS3A11lJ0zEdnJ3UOKqVxawAkF3k7F0CVN7VQ34aZrV+G8BZ1WC9ZL7NyrwsW0oviwsWDgRuVYtJg==", "requires": { - "hoek": "2.16.3" + "hoek": "4.2.1" } }, "spdx-correct": { @@ -2078,9 +2135,9 @@ "dev": true }, "sshpk": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.13.1.tgz", - "integrity": "sha1-US322mKHFEMW3EwY/hzx2UBzm+M=", + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.14.1.tgz", + "integrity": "sha1-Ew9Zde3a2WPx1W+SuaxsUfqfg+s=", "requires": { "asn1": "0.2.3", "assert-plus": "1.0.0", @@ -2092,10 +2149,11 @@ "tweetnacl": "0.14.5" }, "dependencies": { - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "optional": true } } }, @@ -2280,9 +2338,9 @@ "dev": true }, "tough-cookie": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.2.tgz", - "integrity": "sha1-8IH3bkyFcg5sN6X6ztc3FQ2EByo=", + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.4.tgz", + "integrity": "sha512-TZ6TTfI5NtZnuyy/Kecv+CnoROnyXn2DN97LontgQpCwsX2XyLYCC0ENhYkehSOwAp8rTQKc/NUIF7BkQ5rKLA==", "requires": { "punycode": "1.4.1" } @@ -2308,9 +2366,9 @@ } }, "tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.0.tgz", + "integrity": "sha1-cT2LgY2kIGh0C/aDhtBHnmb8ins=" }, "type-check": { "version": "0.3.2", @@ -2327,11 +2385,6 @@ "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", "dev": true }, - "ultron": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/ultron/-/ultron-1.1.0.tgz", - "integrity": "sha1-sHoualQagV/Go0zNRTO67DB8qGQ=" - }, "user-home": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/user-home/-/user-home-2.0.0.tgz", @@ -2347,9 +2400,9 @@ "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" }, "uuid": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.1.0.tgz", - "integrity": "sha512-DIWtzUkw04M4k3bf1IcpS2tngXEL26YUD2M0tMDUpnUrz2hgzUBlD55a4FjdLGPvfHxS6uluGWvaVEqgBcVa+g==" + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.2.1.tgz", + "integrity": "sha512-jZnMwlb9Iku/O3smGWvZhauCf6cvvpKi4BKRiliS3cxnI+Gz9j5MEpTz2UFuXiKPJocb7gnsLHwiS05ige5BEA==" }, "validate-npm-package-license": { "version": "3.0.1", @@ -2400,19 +2453,12 @@ } }, "ws": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-2.3.1.tgz", - "integrity": "sha1-a5Sz5EfLajY/eF6vlK9jWejoHIA=", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-4.1.0.tgz", + "integrity": "sha512-ZGh/8kF9rrRNffkLFV4AzhvooEclrOH0xaugmqGsIfFgOE/pIz4fMc4Ef+5HSQqTEug2S9JZIWDR47duDSLfaA==", "requires": { - "safe-buffer": "5.0.1", - "ultron": "1.1.0" - }, - "dependencies": { - "safe-buffer": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.0.1.tgz", - "integrity": "sha1-0mPKVGls2KMGtcplUekt5XkY++c=" - } + "async-limiter": "1.0.0", + "safe-buffer": "5.1.1" } }, "xmlhttprequest": { diff --git a/package.json b/package.json index 5276263..c26f497 100644 --- a/package.json +++ b/package.json @@ -20,10 +20,10 @@ "homepage": "https://github.com/rgoliveira/AwesomeBot", "dependencies": { "cheerio": "^0.22.0", - "discord.js": "^11.0.0", + "discord.js": "^11.3.2", "replit-client": "^0.19.0", - "request": "^2.81.0", - "request-promise": "^4.2.0", + "request": "^2.85.0", + "request-promise": "^4.2.2", "xmlhttprequest": "^1.8.0" }, "devDependencies": {