From 4785be262e98cd69c2c565166c64bea55582bac4 Mon Sep 17 00:00:00 2001 From: Dev Agrawal Date: Sat, 23 Jan 2021 16:24:28 -0500 Subject: [PATCH 01/55] getting started with checkin --- .gitignore | 3 ++- checkin.js | 27 +++++++++++++++++++++++++++ index.js | 17 ++++++++++++++--- package-lock.json | 23 +++++++++++++++++++++++ package.json | 5 ++++- 5 files changed, 70 insertions(+), 5 deletions(-) create mode 100644 checkin.js diff --git a/.gitignore b/.gitignore index 2d18699..3dc8509 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ token.js -node_modules/ \ No newline at end of file +node_modules/ +.env \ No newline at end of file diff --git a/checkin.js b/checkin.js new file mode 100644 index 0000000..47661dd --- /dev/null +++ b/checkin.js @@ -0,0 +1,27 @@ +const Discord = require('discord.js') + +/** + * + * @param {string} email + * @param {Discord.Message} message + */ +module.exports = function(email, message) { + // send a request to revuc api to check in the email + + // if check in failed, return with an error message + // registrant with this email does not exist + // server error somewhere + + // check in succeeded + const registrant = response.data + // grant the hacker role + const role = message.guild.roles.cache.find(role => role.name === 'Hacker') + const user = message.author + + // return with a success prompt + + // censor the original message + // devagrawal09@gmail.com + // d****9@gmail.com + +} \ No newline at end of file diff --git a/index.js b/index.js index 2e05f6b..f817ada 100644 --- a/index.js +++ b/index.js @@ -1,10 +1,13 @@ -const token = require("./token") const Discord = require('discord.js') +const emailValidator = require('email-validator') + +const token = require("./token") const help = require("./help") const multiply = require("./multiply") const react = require("./react") const countdown = require("./countdown") +const checkin = require('./checkin') const client = new Discord.Client() @@ -44,12 +47,20 @@ client.once('ready', () => { // receivedMessage.channel.send("Message received from " + receivedMessage.author.toString() + ": " + receivedMessage.content) // } - client.on('message', (receivedMessage) => { + client.on('message', async (receivedMessage) => { if(receivedMessage.author == client.user) { return } - if(receivedMessage.content.startsWith('!')) { + + if(receivedMessage.channel.name === process.env.CHECK_IN_CHANNEL_NAME) { + // if receivedMessage is an email + if(emailValidator.validate(receivedMessage)) { + // run the checkIn function + const email = receivedMessage + checkin(email, receivedMessage) + } + } else if(receivedMessage.content.startsWith('!')) { processCommand(receivedMessage) } }) diff --git a/package-lock.json b/package-lock.json index 327bb48..8ef90e4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -32,6 +32,14 @@ "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" }, + "axios": { + "version": "0.21.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz", + "integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==", + "requires": { + "follow-redirects": "^1.10.0" + } + }, "combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -60,11 +68,26 @@ "ws": "^7.3.1" } }, + "dotenv": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.2.0.tgz", + "integrity": "sha512-8sJ78ElpbDJBHNeBzUbUVLsqKdccaa/BXF1uPTw3GrvQTBgrQrtObr2mUrE38vzYd8cEv+m/JBfDLioYcfXoaw==" + }, + "email-validator": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/email-validator/-/email-validator-2.0.4.tgz", + "integrity": "sha512-gYCwo7kh5S3IDyZPLZf6hSS0MnZT8QmJFqYvbqlDZSbwdZlY6QZWxJ4i/6UhITOJ4XzyI647Bm2MXKCLqnJ4nQ==" + }, "event-target-shim": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==" }, + "follow-redirects": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.1.tgz", + "integrity": "sha512-SSG5xmZh1mkPGyKzjZP8zLjltIfpW32Y5QpdNJyjcfGxK3qo3NDDkZOZSFiGn1A6SclQxY9GzEwAHQ3dmYRWpg==" + }, "mime-db": { "version": "1.44.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", diff --git a/package.json b/package.json index ddcb4ff..9503566 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,9 @@ }, "homepage": "https://github.com/sahupr/cathacks#readme", "dependencies": { - "discord.js": "^12.5.1" + "axios": "^0.21.1", + "discord.js": "^12.5.1", + "dotenv": "^8.2.0", + "email-validator": "^2.0.4" } } From 17b17253833edadb026973c3ac7c900014478460 Mon Sep 17 00:00:00 2001 From: sahupr Date: Wed, 27 Jan 2021 03:26:51 -0500 Subject: [PATCH 02/55] role assignment and email verification - no authentication --- checkin.js | 47 ++++++++++++++++++++++++++++++++++++----------- index.js | 29 +++++++++++++++++------------ package-lock.json | 28 ++++++++++++++-------------- package.json | 2 +- react.js | 2 ++ 5 files changed, 70 insertions(+), 38 deletions(-) diff --git a/checkin.js b/checkin.js index 47661dd..ee64daf 100644 --- a/checkin.js +++ b/checkin.js @@ -1,4 +1,5 @@ const Discord = require('discord.js') +const emailValidator = require('email-validator') /** * @@ -9,19 +10,43 @@ module.exports = function(email, message) { // send a request to revuc api to check in the email // if check in failed, return with an error message - // registrant with this email does not exist - // server error somewhere - - // check in succeeded - const registrant = response.data + if(emailValidator.validate(email.toString()) && message.channel.id === '803803905712324638') { + + console.log('valid email') + + // check in succeeded + const user = message.author.id + // grant the hacker role - const role = message.guild.roles.cache.find(role => role.name === 'Hacker') - const user = message.author - - // return with a success prompt - - // censor the original message + const member = message.guild.members.cache.find((member) => member.id === user.toString()) + let testRole = message.guild.roles.cache.find(role => role.id === "803776127482724373") //the role ID needs to change + member.roles.add(testRole) + + // censor the original message // devagrawal09@gmail.com // d****9@gmail.com + let ptEmail = email.toString() + let letter = '' + let stars = '' + i=0 + while(letter != '@'){ + letter = ptEmail[i] + i += 1 + stars += '*' + } + let censor = ptEmail.slice(1,i-2) + stars = stars.substr(1,i-3) + message.delete({timeout: 3000}) + message.channel.send(ptEmail.replace(censor, stars) + ' is checked in!') + } + else { + console.log('invalid email') + message.delete({timeout: 3000}) + } + // registrant with this email does not exist + // server error somewhere + + // return with a success prompt + } \ No newline at end of file diff --git a/index.js b/index.js index f817ada..49d65f7 100644 --- a/index.js +++ b/index.js @@ -52,7 +52,6 @@ client.once('ready', () => { return } - if(receivedMessage.channel.name === process.env.CHECK_IN_CHANNEL_NAME) { // if receivedMessage is an email if(emailValidator.validate(receivedMessage)) { @@ -76,18 +75,24 @@ function processCommand(receivedMessage) { console.log('command received: ' + primaryCommand) console.log('Arguments: ' + arguments) - if (primaryCommand == "help") { - help(arguments, receivedMessage) - } - else if (primaryCommand == 'multiply') { - multiply(arguments, receivedMessage) - } - else if (primaryCommand == 'react') { - react(arguments, receivedMessage) - } - else if (primaryCommand == 'countdown') { - countdown(arguments, receivedMessage) + switch(primaryCommand) { + case 'help': + help(arguments, receivedMessage) + break + case 'mulitply': + multiply(arguments, receivedMessage) + break + case 'react': + react(arguments, receivedMessage) + break + case 'countdown': + countdown(arguments, receivedMessage) + break + case 'checkin': + checkin(arguments, receivedMessage) + break } + } client.login(token) \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 8ef90e4..d1a6a37 100644 --- a/package-lock.json +++ b/package-lock.json @@ -54,14 +54,14 @@ "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" }, "discord.js": { - "version": "12.5.1", - "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-12.5.1.tgz", - "integrity": "sha512-VwZkVaUAIOB9mKdca0I5MefPMTQJTNg0qdgi1huF3iwsFwJ0L5s/Y69AQe+iPmjuV6j9rtKoG0Ta0n9vgEIL6w==", + "version": "12.3.1", + "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-12.3.1.tgz", + "integrity": "sha512-mSFyV/mbvzH12UXdS4zadmeUf8IMQOo/YdunubG1wWt1xjWvtaJz/s9CGsFD2B5pTw1W/LXxxUbrQjIZ/xlUdw==", "requires": { "@discordjs/collection": "^0.1.6", "@discordjs/form-data": "^3.0.1", "abort-controller": "^3.0.0", - "node-fetch": "^2.6.1", + "node-fetch": "^2.6.0", "prism-media": "^1.2.2", "setimmediate": "^1.0.5", "tweetnacl": "^1.0.3", @@ -89,16 +89,16 @@ "integrity": "sha512-SSG5xmZh1mkPGyKzjZP8zLjltIfpW32Y5QpdNJyjcfGxK3qo3NDDkZOZSFiGn1A6SclQxY9GzEwAHQ3dmYRWpg==" }, "mime-db": { - "version": "1.44.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", - "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==" + "version": "1.45.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.45.0.tgz", + "integrity": "sha512-CkqLUxUk15hofLoLyljJSrukZi8mAtgd+yE5uO4tqRZsdsAJKv0O+rFMhVDRJgozy+yG6md5KwuXhD4ocIoP+w==" }, "mime-types": { - "version": "2.1.27", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz", - "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==", + "version": "2.1.28", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.28.tgz", + "integrity": "sha512-0TO2yJ5YHYr7M2zzT7gDU1tbwHxEUWBCLt0lscSNpcdAfFyJOVEpRYNS7EXVcTLNj/25QO8gulHC5JtTzSE2UQ==", "requires": { - "mime-db": "1.44.0" + "mime-db": "1.45.0" } }, "node-fetch": { @@ -122,9 +122,9 @@ "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==" }, "ws": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.1.tgz", - "integrity": "sha512-pTsP8UAfhy3sk1lSk/O/s4tjD0CRwvMnzvwr4OKGX7ZvqZtUyx4KIJB5JWbkykPoc55tixMGgTNoh3k4FkNGFQ==" + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.2.tgz", + "integrity": "sha512-T4tewALS3+qsrpGI/8dqNMLIVdq/g/85U98HPMa6F0m6xTbvhXU6RCQLqPH3+SlomNV/LdY6RXEbBpMH6EOJnA==" } } } diff --git a/package.json b/package.json index 9503566..f0659fb 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "homepage": "https://github.com/sahupr/cathacks#readme", "dependencies": { "axios": "^0.21.1", - "discord.js": "^12.5.1", + "discord.js": "^12.3.1", "dotenv": "^8.2.0", "email-validator": "^2.0.4" } diff --git a/react.js b/react.js index b951cbe..b7035e7 100644 --- a/react.js +++ b/react.js @@ -1,3 +1,5 @@ +const Discord = require('discord.js') + function react(arguments, receivedMessage) { receivedMessage.react('👍') } From e16c68efcb21256d87bfc977795ef465d596a5ba Mon Sep 17 00:00:00 2001 From: Dev Agrawal Date: Sun, 31 Jan 2021 02:50:00 -0500 Subject: [PATCH 03/55] added checkin using revuc api --- checkin.js | 35 ++++++++++++++++++++++++----------- index.js | 3 +-- 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/checkin.js b/checkin.js index ee64daf..0c7d3de 100644 --- a/checkin.js +++ b/checkin.js @@ -1,32 +1,45 @@ const Discord = require('discord.js') const emailValidator = require('email-validator') +const Axios = require('axios').default + +const API_TOKEN = process.env.API_TOKEN /** * - * @param {string} email * @param {Discord.Message} message */ -module.exports = function(email, message) { - // send a request to revuc api to check in the email +module.exports = async function(message) { + const email = message.toString(); + + if(emailValidator.validate(email) && message.channel.id === '803803905712324638') { + // send a request to revuc api to check in the email + try { + const res = await Axios.post(`https://revolutionuc-api.herokuapp.com/api/v2/admin/registrants/checkin?email=${email}`, {}, { + headers: { + Authorization: `Bearer ${API_TOKEN}` + } + }) + + const { firstName, lastName } = res.data - // if check in failed, return with an error message - if(emailValidator.validate(email.toString()) && message.channel.id === '803803905712324638') { - - console.log('valid email') - // check in succeeded const user = message.author.id // grant the hacker role - const member = message.guild.members.cache.find((member) => member.id === user.toString()) - let testRole = message.guild.roles.cache.find(role => role.id === "803776127482724373") //the role ID needs to change + const member = message.guild.members.cache.find(member => member.id === user) + const testRole = message.guild.roles.cache.find(role => role.id === "803776127482724373") //the role ID needs to change member.roles.add(testRole) + + } catch (err) { + // if check in failed, return with an error message + } + // censor the original message // devagrawal09@gmail.com // d****9@gmail.com - let ptEmail = email.toString() + let ptEmail = email let letter = '' let stars = '' i=0 diff --git a/index.js b/index.js index 49d65f7..b3ef872 100644 --- a/index.js +++ b/index.js @@ -56,8 +56,7 @@ client.once('ready', () => { // if receivedMessage is an email if(emailValidator.validate(receivedMessage)) { // run the checkIn function - const email = receivedMessage - checkin(email, receivedMessage) + await checkin(receivedMessage) } } else if(receivedMessage.content.startsWith('!')) { processCommand(receivedMessage) From bde2fa99720f8f68e3e3135be1f768d42d77d6ca Mon Sep 17 00:00:00 2001 From: sahupr Date: Sun, 7 Feb 2021 19:17:32 -0500 Subject: [PATCH 04/55] levelling --- index.js | 53 ++++++++++++++++++++++++++++++++++++----------- level.js | 0 package-lock.json | 45 ++++++++++++++++++++++++++++++++++++++++ package.json | 3 ++- 4 files changed, 88 insertions(+), 13 deletions(-) create mode 100644 level.js diff --git a/index.js b/index.js index b3ef872..81c3b93 100644 --- a/index.js +++ b/index.js @@ -2,6 +2,7 @@ const Discord = require('discord.js') const emailValidator = require('email-validator') const token = require("./token") +const random = require('random'); const help = require("./help") const multiply = require("./multiply") @@ -11,6 +12,8 @@ const checkin = require('./checkin') const client = new Discord.Client() +var stats = {} + client.once('ready', () => { console.log('the bot is online!') client.user.setActivity('with Javascript', {type: "PLAYING"}) @@ -47,22 +50,48 @@ client.once('ready', () => { // receivedMessage.channel.send("Message received from " + receivedMessage.author.toString() + ": " + receivedMessage.content) // } - client.on('message', async (receivedMessage) => { - if(receivedMessage.author == client.user) { - return +}) + +const ParticipationCodes = ['REVUC2021OC', 'NICETOMEETYALL', 'HACKINGINTENSIFIES', 'W1SOFUN', 'SUPERCOOLW2', 'YOUMEANDW3', 'W4RULES', 'SPIDERWEBS', 'SIOTPLAYER', 'CHITCHATSH', 'FRIENDLYTREES', 'GOTOSLEEP', 'QOTHISLIT', 'NOMORESITTING', 'UNTILNEXTYEAR'] + +client.on('message', async (receivedMessage) => { + if(receivedMessage.author == client.user) { + return + } + + if(receivedMessage.channel.name === process.env.CHECK_IN_CHANNEL_NAME) { + // if receivedMessage is an email + if(emailValidator.validate(receivedMessage)) { + // run the checkIn function + await checkin(receivedMessage) } + } - if(receivedMessage.channel.name === process.env.CHECK_IN_CHANNEL_NAME) { - // if receivedMessage is an email - if(emailValidator.validate(receivedMessage)) { - // run the checkIn function - await checkin(receivedMessage) - } - } else if(receivedMessage.content.startsWith('!')) { - processCommand(receivedMessage) + if (receivedMessage.guild.id in stats === false) { + stats[receivedMessage.guild.id] = {}; + } + + const guildStats = stats[receivedMessage.guild.id] + if (receivedMessage.author.id in guildStats === false){ + guildStats[receivedMessage.author.id] = { + xp: 0, + level: 0, + lastMessage: 0 + } + } + const userStats = guildStats[receivedMessage.author.id] + ParticipationCodes.forEach((code) => { + if (receivedMessage.content == code) { + console.log(code) + userStats.xp += random.int(15,25) } }) + console.log(receivedMessage.author.username + ' now has ' + userStats.xp) + + if(receivedMessage.content.startsWith('!')) { + processCommand(receivedMessage) + } }) function processCommand(receivedMessage) { @@ -78,7 +107,7 @@ function processCommand(receivedMessage) { case 'help': help(arguments, receivedMessage) break - case 'mulitply': + case 'multiply': multiply(arguments, receivedMessage) break case 'react': diff --git a/level.js b/level.js new file mode 100644 index 0000000..e69de29 diff --git a/package-lock.json b/package-lock.json index d1a6a37..5d26dbb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -40,6 +40,15 @@ "follow-redirects": "^1.10.0" } }, + "babel-runtime": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", + "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", + "requires": { + "core-js": "^2.4.0", + "regenerator-runtime": "^0.11.0" + } + }, "combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -48,6 +57,11 @@ "delayed-stream": "~1.0.0" } }, + "core-js": { + "version": "2.6.12", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz", + "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==" + }, "delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", @@ -106,11 +120,42 @@ "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==" }, + "ow": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/ow/-/ow-0.4.0.tgz", + "integrity": "sha512-kJNzxUgVd6EF5LoGs+s2/etJPwjfRDLXPTCfEgV8At77sRrV+PSFA8lcoW2HF15Qd455mIR2Stee/2MzDiFBDA==" + }, + "ow-lite": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/ow-lite/-/ow-lite-0.0.2.tgz", + "integrity": "sha1-359QDmdAtlkKHpqWVzDUmo61l9E=" + }, "prism-media": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/prism-media/-/prism-media-1.2.3.tgz", "integrity": "sha512-fSrR66n0l6roW9Rx4rSLMyTPTjRTiXy5RVqDOurACQ6si1rKHHKDU5gwBJoCsIV0R3o9gi+K50akl/qyw1C74A==" }, + "random": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/random/-/random-2.2.0.tgz", + "integrity": "sha512-4HBR4Xye4jJ41QBi6RfIaO1yKQpxVUZafQtdE6NvvjzirNlwWgsk3tkGLTbQtWUarF4ofZsUVEmWqB1TDQlkwA==", + "requires": { + "babel-runtime": "^6.26.0", + "ow": "^0.4.0", + "ow-lite": "^0.0.2", + "seedrandom": "^3.0.5" + } + }, + "regenerator-runtime": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", + "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==" + }, + "seedrandom": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/seedrandom/-/seedrandom-3.0.5.tgz", + "integrity": "sha512-8OwmbklUNzwezjGInmZ+2clQmExQPvomqjL7LFqOYqtmuxRgQYqOD3mHaU+MvZn5FLUeVxVfQjwLZW/n/JFuqg==" + }, "setimmediate": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", diff --git a/package.json b/package.json index f0659fb..ce8dcf6 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "axios": "^0.21.1", "discord.js": "^12.3.1", "dotenv": "^8.2.0", - "email-validator": "^2.0.4" + "email-validator": "^2.0.4", + "random": "^2.2.0" } } From 929ae50049f59291b6de9a52239a3f229fed33a1 Mon Sep 17 00:00:00 2001 From: Dev Agrawal Date: Sun, 7 Feb 2021 19:24:06 -0500 Subject: [PATCH 05/55] env variables --- checkin.js | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/checkin.js b/checkin.js index 0c7d3de..e2bc08f 100644 --- a/checkin.js +++ b/checkin.js @@ -3,6 +3,8 @@ const emailValidator = require('email-validator') const Axios = require('axios').default const API_TOKEN = process.env.API_TOKEN +const HACKER_ROLE = process.env.HACKER_ROLE +const CHECKIN_CHANNEL_ID = process.env.CHECKIN_CHANNEL_ID /** * @@ -11,25 +13,36 @@ const API_TOKEN = process.env.API_TOKEN module.exports = async function(message) { const email = message.toString(); - if(emailValidator.validate(email) && message.channel.id === '803803905712324638') { + if(emailValidator.validate(email) && message.channel.id === CHECKIN_CHANNEL_ID) { // send a request to revuc api to check in the email try { - const res = await Axios.post(`https://revolutionuc-api.herokuapp.com/api/v2/admin/registrants/checkin?email=${email}`, {}, { + const res = await Axios.post(`http://192.168.0.102/api/v2/attendee/checkin`, { email }, { headers: { Authorization: `Bearer ${API_TOKEN}` } }) - const { firstName, lastName } = res.data + const { name, role } = res.data + + let roleToBeAdded; + + switch(role) { + case `HACKER`: + roleToBeAdded = HACKER_ROLE; + break; + default: + throw new Error(`Invalid role`); + } // check in succeeded const user = message.author.id // grant the hacker role const member = message.guild.members.cache.find(member => member.id === user) - const testRole = message.guild.roles.cache.find(role => role.id === "803776127482724373") //the role ID needs to change + const testRole = message.guild.roles.cache.find(role => role.id === roleToBeAdded) //the role ID needs to change member.roles.add(testRole) + message.channel.send(name + ' is checked in!') } catch (err) { // if check in failed, return with an error message @@ -50,8 +63,8 @@ module.exports = async function(message) { } let censor = ptEmail.slice(1,i-2) stars = stars.substr(1,i-3) + message.edit(ptEmail.replace(censor, stars)); message.delete({timeout: 3000}) - message.channel.send(ptEmail.replace(censor, stars) + ' is checked in!') } else { console.log('invalid email') From 18f6293db2a6e5b19403c357835a140b5a096b00 Mon Sep 17 00:00:00 2001 From: sahupr Date: Sun, 7 Feb 2021 19:32:24 -0500 Subject: [PATCH 06/55] checkin --- checkin.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/checkin.js b/checkin.js index e2bc08f..dc1595c 100644 --- a/checkin.js +++ b/checkin.js @@ -10,8 +10,10 @@ const CHECKIN_CHANNEL_ID = process.env.CHECKIN_CHANNEL_ID * * @param {Discord.Message} message */ -module.exports = async function(message) { - const email = message.toString(); +module.exports = async function(args, message) { + const email = args[0]; + console.log(email) + console.log(message) if(emailValidator.validate(email) && message.channel.id === CHECKIN_CHANNEL_ID) { // send a request to revuc api to check in the email From 63d55501ee337768884122536776e98b421c3506 Mon Sep 17 00:00:00 2001 From: Dev Agrawal Date: Sun, 7 Feb 2021 20:23:26 -0500 Subject: [PATCH 07/55] using nodemon --- package-lock.json | 988 ++++++++++++++++++++++++++++++++++++++++++++++ package.json | 6 +- 2 files changed, 993 insertions(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index 5d26dbb..3439e63 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,6 +19,27 @@ "mime-types": "^2.1.12" } }, + "@sindresorhus/is": { + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz", + "integrity": "sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ==", + "dev": true + }, + "@szmarczak/http-timer": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-1.1.2.tgz", + "integrity": "sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA==", + "dev": true, + "requires": { + "defer-to-connect": "^1.0.1" + } + }, + "abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "dev": true + }, "abort-controller": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", @@ -27,6 +48,53 @@ "event-target-shim": "^5.0.0" } }, + "ansi-align": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.0.tgz", + "integrity": "sha512-ZpClVKqXN3RGBmKibdfWzqCY4lnjEuoNzU5T0oEFpfd/z5qJHVarukridD4juLO2FXMiwUQxr9WqQtaYa8XRYw==", + "dev": true, + "requires": { + "string-width": "^3.0.0" + }, + "dependencies": { + "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" + } + } + } + }, + "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": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "anymatch": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", + "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==", + "dev": true, + "requires": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + } + }, "asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", @@ -49,6 +117,170 @@ "regenerator-runtime": "^0.11.0" } }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "binary-extensions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "dev": true + }, + "boxen": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/boxen/-/boxen-4.2.0.tgz", + "integrity": "sha512-eB4uT9RGzg2odpER62bBwSLvUeGC+WbRjjyyFhGsKnc8wp/m0+hQsMUvUe3H2V0D5vw0nBdO1hCJoZo5mKeuIQ==", + "dev": true, + "requires": { + "ansi-align": "^3.0.0", + "camelcase": "^5.3.1", + "chalk": "^3.0.0", + "cli-boxes": "^2.2.0", + "string-width": "^4.1.0", + "term-size": "^2.1.0", + "type-fest": "^0.8.1", + "widest-line": "^3.1.0" + } + }, + "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" + } + }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, + "cacheable-request": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-6.1.0.tgz", + "integrity": "sha512-Oj3cAGPCqOZX7Rz64Uny2GYAZNliQSqfbePrgAQ1wKAihYmCUnraBtJtKcGR4xz7wF+LoJC+ssFZvv5BgF9Igg==", + "dev": true, + "requires": { + "clone-response": "^1.0.2", + "get-stream": "^5.1.0", + "http-cache-semantics": "^4.0.0", + "keyv": "^3.0.0", + "lowercase-keys": "^2.0.0", + "normalize-url": "^4.1.0", + "responselike": "^1.0.2" + }, + "dependencies": { + "get-stream": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", + "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", + "dev": true, + "requires": { + "pump": "^3.0.0" + } + }, + "lowercase-keys": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", + "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==", + "dev": true + } + } + }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, + "chalk": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", + "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "dependencies": { + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "chokidar": { + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.1.tgz", + "integrity": "sha512-9+s+Od+W0VJJzawDma/gvBNQqkTiqYTWLuZoyAsivsI4AaWTCzHG06/TMjsf1cYe9Cb97UCEhjz7HvnPk2p/tw==", + "dev": true, + "requires": { + "anymatch": "~3.1.1", + "braces": "~3.0.2", + "fsevents": "~2.3.1", + "glob-parent": "~5.1.0", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.5.0" + } + }, + "ci-info": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", + "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", + "dev": true + }, + "cli-boxes": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-2.2.1.tgz", + "integrity": "sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw==", + "dev": true + }, + "clone-response": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz", + "integrity": "sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws=", + "dev": true, + "requires": { + "mimic-response": "^1.0.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, "combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -57,11 +289,67 @@ "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 + }, + "configstore": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/configstore/-/configstore-5.0.1.tgz", + "integrity": "sha512-aMKprgk5YhBNyH25hj8wGt2+D52Sw1DRRIzqBwLp2Ya9mFmY8KPvvtvmna8SxVR9JMZ4kzMD68N22vlaRpkeFA==", + "dev": true, + "requires": { + "dot-prop": "^5.2.0", + "graceful-fs": "^4.1.2", + "make-dir": "^3.0.0", + "unique-string": "^2.0.0", + "write-file-atomic": "^3.0.0", + "xdg-basedir": "^4.0.0" + } + }, "core-js": { "version": "2.6.12", "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz", "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==" }, + "crypto-random-string": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-2.0.0.tgz", + "integrity": "sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA==", + "dev": true + }, + "debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "decompress-response": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", + "integrity": "sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=", + "dev": true, + "requires": { + "mimic-response": "^1.0.0" + } + }, + "deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "dev": true + }, + "defer-to-connect": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-1.1.3.tgz", + "integrity": "sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ==", + "dev": true + }, "delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", @@ -82,26 +370,304 @@ "ws": "^7.3.1" } }, + "dot-prop": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz", + "integrity": "sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==", + "dev": true, + "requires": { + "is-obj": "^2.0.0" + } + }, "dotenv": { "version": "8.2.0", "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.2.0.tgz", "integrity": "sha512-8sJ78ElpbDJBHNeBzUbUVLsqKdccaa/BXF1uPTw3GrvQTBgrQrtObr2mUrE38vzYd8cEv+m/JBfDLioYcfXoaw==" }, + "duplexer3": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", + "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=", + "dev": true + }, "email-validator": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/email-validator/-/email-validator-2.0.4.tgz", "integrity": "sha512-gYCwo7kh5S3IDyZPLZf6hSS0MnZT8QmJFqYvbqlDZSbwdZlY6QZWxJ4i/6UhITOJ4XzyI647Bm2MXKCLqnJ4nQ==" }, + "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 + }, + "end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "dev": true, + "requires": { + "once": "^1.4.0" + } + }, + "escape-goat": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/escape-goat/-/escape-goat-2.1.1.tgz", + "integrity": "sha512-8/uIhbG12Csjy2JEW7D9pHbreaVaS/OpN3ycnyvElTdwM5n6GY6W6e2IPemfvGZeUMqZ9A/3GqIZMgKnBhAw/Q==", + "dev": true + }, "event-target-shim": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==" }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, "follow-redirects": { "version": "1.13.1", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.1.tgz", "integrity": "sha512-SSG5xmZh1mkPGyKzjZP8zLjltIfpW32Y5QpdNJyjcfGxK3qo3NDDkZOZSFiGn1A6SclQxY9GzEwAHQ3dmYRWpg==" }, + "fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "optional": true + }, + "get-stream": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "dev": true, + "requires": { + "pump": "^3.0.0" + } + }, + "glob-parent": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", + "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "global-dirs": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-2.1.0.tgz", + "integrity": "sha512-MG6kdOUh/xBnyo9cJFeIKkLEc1AyFq42QTU4XiX51i2NEdxLxLWXIjEjmqKeSuKR7pAZjTqUVoT2b2huxVLgYQ==", + "dev": true, + "requires": { + "ini": "1.3.7" + } + }, + "got": { + "version": "9.6.0", + "resolved": "https://registry.npmjs.org/got/-/got-9.6.0.tgz", + "integrity": "sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q==", + "dev": true, + "requires": { + "@sindresorhus/is": "^0.14.0", + "@szmarczak/http-timer": "^1.1.2", + "cacheable-request": "^6.0.0", + "decompress-response": "^3.3.0", + "duplexer3": "^0.1.4", + "get-stream": "^4.1.0", + "lowercase-keys": "^1.0.1", + "mimic-response": "^1.0.1", + "p-cancelable": "^1.0.0", + "to-readable-stream": "^1.0.0", + "url-parse-lax": "^3.0.0" + } + }, + "graceful-fs": { + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.5.tgz", + "integrity": "sha512-kBBSQbz2K0Nyn+31j/w36fUfxkBW9/gfwRWdUY1ULReH3iokVJgddZAFcD1D0xlgTmFxJCbUkUclAlc6/IDJkw==", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "has-yarn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/has-yarn/-/has-yarn-2.1.0.tgz", + "integrity": "sha512-UqBRqi4ju7T+TqGNdqAO0PaSVGsDGJUBQvk9eUWNGRY1CFGDzYhLWoM7JQEemnlvVcv/YEmc2wNW8BC24EnUsw==", + "dev": true + }, + "http-cache-semantics": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz", + "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==", + "dev": true + }, + "ignore-by-default": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", + "integrity": "sha1-SMptcvbGo68Aqa1K5odr44ieKwk=", + "dev": true + }, + "import-lazy": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-2.1.0.tgz", + "integrity": "sha1-BWmOPUXIjo1+nZLLBYTnfwlvPkM=", + "dev": true + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, + "ini": { + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.7.tgz", + "integrity": "sha512-iKpRpXP+CrP2jyrxvg1kMUpXDyRUFDWurxbnVT1vQPx+Wz9uCYsMIqYuSBLV+PAaZG/d7kRLKRFc9oDMsH+mFQ==", + "dev": true + }, + "is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "requires": { + "binary-extensions": "^2.0.0" + } + }, + "is-ci": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", + "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==", + "dev": true, + "requires": { + "ci-info": "^2.0.0" + } + }, + "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": "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 + }, + "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-installed-globally": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.3.2.tgz", + "integrity": "sha512-wZ8x1js7Ia0kecP/CHM/3ABkAmujX7WPvQk6uu3Fly/Mk44pySulQpnHG46OMjHGXApINnV4QhY3SWnECO2z5g==", + "dev": true, + "requires": { + "global-dirs": "^2.0.1", + "is-path-inside": "^3.0.1" + } + }, + "is-npm": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-4.0.0.tgz", + "integrity": "sha512-96ECIfh9xtDDlPylNPXhzjsykHsMJZ18ASpaWzQyBr4YRTcVjUvzaHayDAES2oU/3KpljhHUjtSRNiDwi0F0ig==", + "dev": true + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "is-obj": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", + "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==", + "dev": true + }, + "is-path-inside": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.2.tgz", + "integrity": "sha512-/2UGPSgmtqwo1ktx8NDHjuPwZWmHhO+gj0f93EkhLB5RgW9RZevWYYlIkS6zePc6U2WpOdQYIwHe9YC4DWEBVg==", + "dev": true + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true + }, + "is-yarn-global": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/is-yarn-global/-/is-yarn-global-0.3.0.tgz", + "integrity": "sha512-VjSeb/lHmkoyd8ryPVIKvOCn4D1koMqY+vqyjjUfc3xyKtP4dYOxM44sZrnqQSzSds3xyOrUTLTC9LVCVgLngw==", + "dev": true + }, + "json-buffer": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz", + "integrity": "sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg=", + "dev": true + }, + "keyv": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-3.1.0.tgz", + "integrity": "sha512-9ykJ/46SN/9KPM/sichzQ7OvXyGDYKGTaDlKMGCAlg2UK8KRy4jb0d8sFc+0Tt0YYnThq8X2RZgCg74RPxgcVA==", + "dev": true, + "requires": { + "json-buffer": "3.0.0" + } + }, + "latest-version": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-5.1.0.tgz", + "integrity": "sha512-weT+r0kTkRQdCdYCNtkMwWXQTMEswKrFBkm4ckQOMVhhqhIMI1UT2hMj+1iigIhgSZm5gTmrRXBNoGUgaTY1xA==", + "dev": true, + "requires": { + "package-json": "^6.3.0" + } + }, + "lowercase-keys": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", + "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==", + "dev": true + }, + "make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "requires": { + "semver": "^6.0.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, "mime-db": { "version": "1.45.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.45.0.tgz", @@ -115,11 +681,86 @@ "mime-db": "1.45.0" } }, + "mimic-response": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", + "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==", + "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": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, "node-fetch": { "version": "2.6.1", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==" }, + "nodemon": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.7.tgz", + "integrity": "sha512-XHzK69Awgnec9UzHr1kc8EomQh4sjTQ8oRf8TsGrSmHDx9/UmiGG9E/mM3BuTfNeFwdNBvrqQq/RHL0xIeyFOA==", + "dev": true, + "requires": { + "chokidar": "^3.2.2", + "debug": "^3.2.6", + "ignore-by-default": "^1.0.1", + "minimatch": "^3.0.4", + "pstree.remy": "^1.1.7", + "semver": "^5.7.1", + "supports-color": "^5.5.0", + "touch": "^3.1.0", + "undefsafe": "^2.0.3", + "update-notifier": "^4.1.0" + } + }, + "nopt": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", + "integrity": "sha1-bd0hvSoxQXuScn3Vhfim83YI6+4=", + "dev": true, + "requires": { + "abbrev": "1" + } + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true + }, + "normalize-url": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.0.tgz", + "integrity": "sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ==", + "dev": true + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, "ow": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/ow/-/ow-0.4.0.tgz", @@ -130,11 +771,74 @@ "resolved": "https://registry.npmjs.org/ow-lite/-/ow-lite-0.0.2.tgz", "integrity": "sha1-359QDmdAtlkKHpqWVzDUmo61l9E=" }, + "p-cancelable": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz", + "integrity": "sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw==", + "dev": true + }, + "package-json": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/package-json/-/package-json-6.5.0.tgz", + "integrity": "sha512-k3bdm2n25tkyxcjSKzB5x8kfVxlMdgsbPr0GkZcwHsLpba6cBjqCt1KlcChKEvxHIcTB1FVMuwoijZ26xex5MQ==", + "dev": true, + "requires": { + "got": "^9.6.0", + "registry-auth-token": "^4.0.0", + "registry-url": "^5.0.0", + "semver": "^6.2.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "picomatch": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", + "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", + "dev": true + }, + "prepend-http": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", + "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=", + "dev": true + }, "prism-media": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/prism-media/-/prism-media-1.2.3.tgz", "integrity": "sha512-fSrR66n0l6roW9Rx4rSLMyTPTjRTiXy5RVqDOurACQ6si1rKHHKDU5gwBJoCsIV0R3o9gi+K50akl/qyw1C74A==" }, + "pstree.remy": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", + "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==", + "dev": true + }, + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "pupa": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/pupa/-/pupa-2.1.1.tgz", + "integrity": "sha512-l1jNAspIBSFqbT+y+5FosojNpVpF94nlI+wDUpqP9enwOTfHx9f0gh5nB96vl+6yTpsJsypeNrwfzPrKuHB41A==", + "dev": true, + "requires": { + "escape-goat": "^2.0.0" + } + }, "random": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/random/-/random-2.2.0.tgz", @@ -146,30 +850,314 @@ "seedrandom": "^3.0.5" } }, + "rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "dev": true, + "requires": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + } + }, + "readdirp": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.5.0.tgz", + "integrity": "sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ==", + "dev": true, + "requires": { + "picomatch": "^2.2.1" + } + }, "regenerator-runtime": { "version": "0.11.1", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==" }, + "registry-auth-token": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-4.2.1.tgz", + "integrity": "sha512-6gkSb4U6aWJB4SF2ZvLb76yCBjcvufXBqvvEx1HbmKPkutswjW1xNVRY0+daljIYRbogN7O0etYSlbiaEQyMyw==", + "dev": true, + "requires": { + "rc": "^1.2.8" + } + }, + "registry-url": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-5.1.0.tgz", + "integrity": "sha512-8acYXXTI0AkQv6RAOjE3vOaIXZkT9wo4LOFbBKYQEEnnMNBpKqdUrI6S4NT0KPIo/WVvJ5tE/X5LF/TQUf0ekw==", + "dev": true, + "requires": { + "rc": "^1.2.8" + } + }, + "responselike": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/responselike/-/responselike-1.0.2.tgz", + "integrity": "sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec=", + "dev": true, + "requires": { + "lowercase-keys": "^1.0.0" + } + }, "seedrandom": { "version": "3.0.5", "resolved": "https://registry.npmjs.org/seedrandom/-/seedrandom-3.0.5.tgz", "integrity": "sha512-8OwmbklUNzwezjGInmZ+2clQmExQPvomqjL7LFqOYqtmuxRgQYqOD3mHaU+MvZn5FLUeVxVfQjwLZW/n/JFuqg==" }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, + "semver-diff": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-3.1.1.tgz", + "integrity": "sha512-GX0Ix/CJcHyB8c4ykpHGIAvLyOwOobtM/8d+TQkAd81/bEjgPHrfba41Vpesr7jX/t8Uh+R3EX9eAS5be+jQYg==", + "dev": true, + "requires": { + "semver": "^6.3.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, "setimmediate": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=" }, + "signal-exit": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", + "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", + "dev": true + }, + "string-width": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + }, + "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 + }, + "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 + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.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": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "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" + } + }, + "term-size": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/term-size/-/term-size-2.2.1.tgz", + "integrity": "sha512-wK0Ri4fOGjv/XPy8SBHZChl8CM7uMc5VML7SqiQ0zG7+J5Vr+RMQDoHa2CNT6KHUnTGIXH34UDMkPzAUyapBZg==", + "dev": true + }, + "to-readable-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/to-readable-stream/-/to-readable-stream-1.0.0.tgz", + "integrity": "sha512-Iq25XBt6zD5npPhlLVXGFN3/gyR2/qODcKNNyTMd4vbm39HUaOiAM4PMq0eMVC/Tkxz+Zjdsc55g9yyz+Yq00Q==", + "dev": true + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + }, + "touch": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.0.tgz", + "integrity": "sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA==", + "dev": true, + "requires": { + "nopt": "~1.0.10" + } + }, "tweetnacl": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==" }, + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true + }, + "typedarray-to-buffer": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", + "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", + "dev": true, + "requires": { + "is-typedarray": "^1.0.0" + } + }, + "undefsafe": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.3.tgz", + "integrity": "sha512-nrXZwwXrD/T/JXeygJqdCO6NZZ1L66HrxM/Z7mIq2oPanoN0F1nLx3lwJMu6AwJY69hdixaFQOuoYsMjE5/C2A==", + "dev": true, + "requires": { + "debug": "^2.2.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "unique-string": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-2.0.0.tgz", + "integrity": "sha512-uNaeirEPvpZWSgzwsPGtU2zVSTrn/8L5q/IexZmH0eH6SA73CmAA5U4GwORTxQAZs95TAXLNqeLoPPNO5gZfWg==", + "dev": true, + "requires": { + "crypto-random-string": "^2.0.0" + } + }, + "update-notifier": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-4.1.3.tgz", + "integrity": "sha512-Yld6Z0RyCYGB6ckIjffGOSOmHXj1gMeE7aROz4MG+XMkmixBX4jUngrGXNYz7wPKBmtoD4MnBa2Anu7RSKht/A==", + "dev": true, + "requires": { + "boxen": "^4.2.0", + "chalk": "^3.0.0", + "configstore": "^5.0.1", + "has-yarn": "^2.1.0", + "import-lazy": "^2.1.0", + "is-ci": "^2.0.0", + "is-installed-globally": "^0.3.1", + "is-npm": "^4.0.0", + "is-yarn-global": "^0.3.0", + "latest-version": "^5.0.0", + "pupa": "^2.0.1", + "semver-diff": "^3.1.1", + "xdg-basedir": "^4.0.0" + } + }, + "url-parse-lax": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-3.0.0.tgz", + "integrity": "sha1-FrXK/Afb42dsGxmZF3gj1lA6yww=", + "dev": true, + "requires": { + "prepend-http": "^2.0.0" + } + }, + "widest-line": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz", + "integrity": "sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg==", + "dev": true, + "requires": { + "string-width": "^4.0.0" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "write-file-atomic": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", + "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", + "dev": true, + "requires": { + "imurmurhash": "^0.1.4", + "is-typedarray": "^1.0.0", + "signal-exit": "^3.0.2", + "typedarray-to-buffer": "^3.1.5" + } + }, "ws": { "version": "7.4.2", "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.2.tgz", "integrity": "sha512-T4tewALS3+qsrpGI/8dqNMLIVdq/g/85U98HPMa6F0m6xTbvhXU6RCQLqPH3+SlomNV/LdY6RXEbBpMH6EOJnA==" + }, + "xdg-basedir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-4.0.0.tgz", + "integrity": "sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q==", + "dev": true } } } diff --git a/package.json b/package.json index ce8dcf6..9c0549f 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,8 @@ "description": "its a discord bot eh", "main": "index.js", "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" + "test": "echo \"Error: no test specified\" && exit 1", + "start": "nodemon index.js" }, "repository": { "type": "git", @@ -22,5 +23,8 @@ "dotenv": "^8.2.0", "email-validator": "^2.0.4", "random": "^2.2.0" + }, + "devDependencies": { + "nodemon": "^2.0.7" } } From c462a1e320164f57d2b192be63f55ca5b9aab6fc Mon Sep 17 00:00:00 2001 From: Dev Agrawal Date: Sun, 7 Feb 2021 20:27:27 -0500 Subject: [PATCH 08/55] checkin complete --- checkin.js | 76 +++++++++++++++++++++++++++++------------------------- index.js | 31 +++++++++++----------- 2 files changed, 57 insertions(+), 50 deletions(-) diff --git a/checkin.js b/checkin.js index dc1595c..fada92e 100644 --- a/checkin.js +++ b/checkin.js @@ -4,18 +4,36 @@ const Axios = require('axios').default const API_TOKEN = process.env.API_TOKEN const HACKER_ROLE = process.env.HACKER_ROLE +const JUDGE_ROLE = process.env.JUDGE_ROLE const CHECKIN_CHANNEL_ID = process.env.CHECKIN_CHANNEL_ID +/** + * + * @param {string} email + */ +const censorEmail = email => { + const ptEmail = email + let letter = '' + let stars = '' + let i=0 + while(letter != '@' && i < email.length){ + letter = ptEmail[i] + i += 1 + stars += '*' + } + let censor = ptEmail.slice(1,i-2) + stars = stars.substr(1,i-3) + return ptEmail.replace(censor, stars) +} + /** * * @param {Discord.Message} message */ -module.exports = async function(args, message) { - const email = args[0]; - console.log(email) - console.log(message) +module.exports = async function(message) { + const email = message.toString(); - if(emailValidator.validate(email) && message.channel.id === CHECKIN_CHANNEL_ID) { + if(emailValidator.validate(email) && message.channel.id == CHECKIN_CHANNEL_ID) { // send a request to revuc api to check in the email try { const res = await Axios.post(`http://192.168.0.102/api/v2/attendee/checkin`, { email }, { @@ -32,6 +50,9 @@ module.exports = async function(args, message) { case `HACKER`: roleToBeAdded = HACKER_ROLE; break; + case `JUDGE`: + roleToBeAdded = JUDGE_ROLE; + break; default: throw new Error(`Invalid role`); } @@ -41,40 +62,25 @@ module.exports = async function(args, message) { // grant the hacker role const member = message.guild.members.cache.find(member => member.id === user) - const testRole = message.guild.roles.cache.find(role => role.id === roleToBeAdded) //the role ID needs to change + const testRole = message.guild.roles.cache.find(role => role.id === roleToBeAdded) member.roles.add(testRole) - message.channel.send(name + ' is checked in!') - } catch (err) { - // if check in failed, return with an error message - - } - - // censor the original message - // devagrawal09@gmail.com - // d****9@gmail.com + const censoredEmail = censorEmail(email); + console.log({ censoredEmail }) - let ptEmail = email - let letter = '' - let stars = '' - i=0 - while(letter != '@'){ - letter = ptEmail[i] - i += 1 - stars += '*' + message.channel.send(`${name} <${censoredEmail}> is checked in!`) + } catch (err) { + if(err.response.status === 404) { + message.channel.send(`Attendee with email ${censorEmail(email)} does not exist, please make sure you are registered with us or contact an organizer`) + } else { + message.channel.send(`Error checking in ${censorEmail(email)}, please try again later or contact an organizer`) } - let censor = ptEmail.slice(1,i-2) - stars = stars.substr(1,i-3) - message.edit(ptEmail.replace(censor, stars)); - message.delete({timeout: 3000}) - } - else { - console.log('invalid email') - message.delete({timeout: 3000}) } - // registrant with this email does not exist - // server error somewhere - - // return with a success prompt + message.delete({ timeout: 2000 }) + } else { + const censored = censorEmail(email); + message.channel.send(`${censored} is not a valid email`) + message.delete({timeout: 3000}) + } } \ No newline at end of file diff --git a/index.js b/index.js index 81c3b93..22f8d66 100644 --- a/index.js +++ b/index.js @@ -1,7 +1,7 @@ +require('dotenv').config(); const Discord = require('discord.js') const emailValidator = require('email-validator') -const token = require("./token") const random = require('random'); const help = require("./help") @@ -12,6 +12,9 @@ const checkin = require('./checkin') const client = new Discord.Client() +const DISCORD_TOKEN = process.env.DISCORD_TOKEN +const CHECKIN_CHANNEL_ID = process.env.CHECKIN_CHANNEL_ID + var stats = {} client.once('ready', () => { @@ -19,13 +22,13 @@ client.once('ready', () => { client.user.setActivity('with Javascript', {type: "PLAYING"}) //list all servers the bot is connected to - console.log('\nServers:') + // console.log('\nServers:') client.guilds.cache.forEach((guild) => { - console.log(' - '+guild.name) + // console.log(' - '+guild.name) //list all channels in the server guild.channels.cache.forEach((channel) => { - console.log(` -- ${channel.name} (${channel.type}) - ${channel.id}`) + // console.log(` -- ${channel.name} (${channel.type}) - ${channel.id}`) }) }) @@ -59,13 +62,14 @@ client.on('message', async (receivedMessage) => { return } - if(receivedMessage.channel.name === process.env.CHECK_IN_CHANNEL_NAME) { - // if receivedMessage is an email - if(emailValidator.validate(receivedMessage)) { - // run the checkIn function - await checkin(receivedMessage) - } - } + if(receivedMessage.channel.id == CHECKIN_CHANNEL_ID) { + // run the checkIn function + console.log(`Checking in!`); + await checkin(receivedMessage) + return; + } + + console.log(`Not checking in`); if (receivedMessage.guild.id in stats === false) { stats[receivedMessage.guild.id] = {}; @@ -116,11 +120,8 @@ function processCommand(receivedMessage) { case 'countdown': countdown(arguments, receivedMessage) break - case 'checkin': - checkin(arguments, receivedMessage) - break } } -client.login(token) \ No newline at end of file +client.login(DISCORD_TOKEN) \ No newline at end of file From 6d553b5d80e221e4a1546135792a2c77d064f868 Mon Sep 17 00:00:00 2001 From: Dev Agrawal Date: Sun, 7 Feb 2021 20:34:52 -0500 Subject: [PATCH 09/55] added prod script --- Procfile | 1 + package.json | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 Procfile diff --git a/Procfile b/Procfile new file mode 100644 index 0000000..1565882 --- /dev/null +++ b/Procfile @@ -0,0 +1 @@ +bot: npm run start:prod \ No newline at end of file diff --git a/package.json b/package.json index 9c0549f..7996aea 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,8 @@ "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", - "start": "nodemon index.js" + "start": "nodemon index.js", + "start:prod": "node index.js" }, "repository": { "type": "git", From 4c3618065b099da976f84a038941257e3740b58b Mon Sep 17 00:00:00 2001 From: Dev Agrawal Date: Sun, 7 Feb 2021 23:37:23 -0500 Subject: [PATCH 10/55] claim participation points --- Procfile | 1 - database.js | 54 ++++++++ index.js | 14 ++- package-lock.json | 315 ++++++++++++++++++++++++++++++++++++++++++++++ package.json | 6 +- score.js | 74 +++++++++++ 6 files changed, 457 insertions(+), 7 deletions(-) delete mode 100644 Procfile create mode 100644 database.js create mode 100644 score.js diff --git a/Procfile b/Procfile deleted file mode 100644 index 1565882..0000000 --- a/Procfile +++ /dev/null @@ -1 +0,0 @@ -bot: npm run start:prod \ No newline at end of file diff --git a/database.js b/database.js new file mode 100644 index 0000000..c4a366f --- /dev/null +++ b/database.js @@ -0,0 +1,54 @@ +const { Sequelize, DataTypes } = require(`sequelize`); + +const sequelize = new Sequelize(process.env.DATABASE_URL, { dialect: 'postgres', dialectOptions: { ssl: { require: true, rejectUnauthorized: false } } }) +exports.sequelize = sequelize + +exports.User = sequelize.define(`discord-user`, { + userID: { + type: DataTypes.STRING, + unique: true, + allowNull: false, + primaryKey: true, + }, + score: { + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: 0 + } +}) + +exports.Event = sequelize.define(`event`, { + code: { + type: DataTypes.STRING, + allowNull: false, + unique: true, + primaryKey: true + }, + name: { + type: DataTypes.STRING, + allowNull: false + }, + points: { + type: DataTypes.INTEGER, + allowNull: false + } +}); + +exports.Claim = sequelize.define('claim', { + userID: { + type: DataTypes.STRING, + allowNull: false + }, + + claimID: { + type: DataTypes.INTEGER, + allowNull: false, + unique: true, + primaryKey: true + }, + + eventCode: { + type: DataTypes.STRING, + allowNull: false + } +}) \ No newline at end of file diff --git a/index.js b/index.js index 22f8d66..1bb1529 100644 --- a/index.js +++ b/index.js @@ -9,6 +9,7 @@ const multiply = require("./multiply") const react = require("./react") const countdown = require("./countdown") const checkin = require('./checkin') +const { score, top } = require('./score') const client = new Discord.Client() @@ -64,13 +65,10 @@ client.on('message', async (receivedMessage) => { if(receivedMessage.channel.id == CHECKIN_CHANNEL_ID) { // run the checkIn function - console.log(`Checking in!`); await checkin(receivedMessage) return; } - - console.log(`Not checking in`); - +/* if (receivedMessage.guild.id in stats === false) { stats[receivedMessage.guild.id] = {}; } @@ -91,7 +89,7 @@ client.on('message', async (receivedMessage) => { } }) - console.log(receivedMessage.author.username + ' now has ' + userStats.xp) + console.log(receivedMessage.author.username + ' now has ' + userStats.xp) */ if(receivedMessage.content.startsWith('!')) { processCommand(receivedMessage) @@ -120,6 +118,12 @@ function processCommand(receivedMessage) { case 'countdown': countdown(arguments, receivedMessage) break + case 'claim': + claim(arguments, receivedMessage) + break + case 'top': + top(arguments, receivedMessage) + break } } diff --git a/package-lock.json b/package-lock.json index 3439e63..626c483 100644 --- a/package-lock.json +++ b/package-lock.json @@ -34,6 +34,50 @@ "defer-to-connect": "^1.0.1" } }, + "@types/bluebird": { + "version": "3.5.33", + "resolved": "https://registry.npmjs.org/@types/bluebird/-/bluebird-3.5.33.tgz", + "integrity": "sha512-ndEo1xvnYeHxm7I/5sF6tBvnsA4Tdi3zj1keRKRs12SP+2ye2A27NDJ1B6PqkfMbGAcT+mqQVqbZRIrhfOp5PQ==", + "dev": true + }, + "@types/continuation-local-storage": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/@types/continuation-local-storage/-/continuation-local-storage-3.2.2.tgz", + "integrity": "sha512-aItm+aYPJ4rT1cHmAxO+OdWjSviQ9iB5UKb5f0Uvgln0N4hS2mcDodHtPiqicYBXViUYhqyBjhA5uyOcT+S34Q==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "@types/lodash": { + "version": "4.14.168", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.168.tgz", + "integrity": "sha512-oVfRvqHV/V6D1yifJbVRU3TMp8OT6o6BG+U9MkwuJ3U8/CsDHvalRpsxBqivn71ztOFZBTfJMvETbqHiaNSj7Q==", + "dev": true + }, + "@types/node": { + "version": "14.14.25", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.25.tgz", + "integrity": "sha512-EPpXLOVqDvisVxtlbvzfyqSsFeQxltFbluZNRndIb8tr9KiBnYNLzrc1N3pyKUCww2RNrfHDViqDWWE1LCJQtQ==" + }, + "@types/sequelize": { + "version": "4.28.9", + "resolved": "https://registry.npmjs.org/@types/sequelize/-/sequelize-4.28.9.tgz", + "integrity": "sha512-QqYgkw/2fEc0FyEQejnxM7cHKB8XBV3Y69k7GSFOToQBOXos0PJVqNpgROXZddXIkl2d6zicYssHuy75ws84sw==", + "dev": true, + "requires": { + "@types/bluebird": "*", + "@types/continuation-local-storage": "*", + "@types/lodash": "*", + "@types/validator": "*" + } + }, + "@types/validator": { + "version": "13.1.3", + "resolved": "https://registry.npmjs.org/@types/validator/-/validator-13.1.3.tgz", + "integrity": "sha512-DaOWN1zf7j+8nHhqXhIgNmS+ltAC53NXqGxYuBhWqWgqolRhddKzfZU814lkHQSTG0IUfQxU7Cg0gb8fFWo2mA==", + "dev": true + }, "abbrev": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", @@ -85,6 +129,11 @@ "color-convert": "^2.0.1" } }, + "any-promise": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", + "integrity": "sha1-q8av7tzqUugJzcA3au0845Y10X8=" + }, "anymatch": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", @@ -164,6 +213,11 @@ "fill-range": "^7.0.1" } }, + "buffer-writer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/buffer-writer/-/buffer-writer-2.0.0.tgz", + "integrity": "sha512-a7ZpuTZU1TRtnwyCNW3I5dc0wWNC3VR9S++Ewyk2HHZdrO3CQJqSpd+95Us590V6AL7JqUAH2IwZ/398PmNFgw==" + }, "cacheable-request": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-6.1.0.tgz", @@ -384,6 +438,11 @@ "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.2.0.tgz", "integrity": "sha512-8sJ78ElpbDJBHNeBzUbUVLsqKdccaa/BXF1uPTw3GrvQTBgrQrtObr2mUrE38vzYd8cEv+m/JBfDLioYcfXoaw==" }, + "dottie": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/dottie/-/dottie-2.0.2.tgz", + "integrity": "sha512-fmrwR04lsniq/uSr8yikThDTrM7epXHBAAjH9TbeH3rEA8tdCO7mRzB9hdmdGyJCxF8KERo9CITcm3kGuoyMhg==" + }, "duplexer3": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", @@ -530,6 +589,16 @@ "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", "dev": true }, + "inflection": { + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/inflection/-/inflection-1.12.0.tgz", + "integrity": "sha1-ogCTVlbW9fa8TcdQLhrstwMihBY=" + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, "ini": { "version": "1.3.7", "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.7.tgz", @@ -645,12 +714,25 @@ "package-json": "^6.3.0" } }, + "lodash": { + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==" + }, "lowercase-keys": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==", "dev": true }, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "requires": { + "yallist": "^4.0.0" + } + }, "make-dir": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", @@ -702,6 +784,19 @@ "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", "dev": true }, + "moment": { + "version": "2.29.1", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.1.tgz", + "integrity": "sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ==" + }, + "moment-timezone": { + "version": "0.5.33", + "resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.33.tgz", + "integrity": "sha512-PTc2vcT8K9J5/9rDEPe5czSIKgLoGsH8UNpA4qZTVw0Vd/Uz19geE9abbIOQKaAQFcnQ3v5YEXrbSc5BpshH+w==", + "requires": { + "moment": ">= 2.9.0" + } + }, "ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -797,12 +892,102 @@ } } }, + "packet-reader": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/packet-reader/-/packet-reader-1.0.0.tgz", + "integrity": "sha512-HAKu/fG3HpHFO0AA8WE8q2g+gBJaZ9MG7fcKk+IJPLTGAD6Psw4443l+9DGRbOIh3/aXr7Phy0TjilYivJo5XQ==" + }, + "pg": { + "version": "8.5.1", + "resolved": "https://registry.npmjs.org/pg/-/pg-8.5.1.tgz", + "integrity": "sha512-9wm3yX9lCfjvA98ybCyw2pADUivyNWT/yIP4ZcDVpMN0og70BUWYEGXPCTAQdGTAqnytfRADb7NERrY1qxhIqw==", + "requires": { + "buffer-writer": "2.0.0", + "packet-reader": "1.0.0", + "pg-connection-string": "^2.4.0", + "pg-pool": "^3.2.2", + "pg-protocol": "^1.4.0", + "pg-types": "^2.1.0", + "pgpass": "1.x" + } + }, + "pg-connection-string": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.4.0.tgz", + "integrity": "sha512-3iBXuv7XKvxeMrIgym7njT+HlZkwZqqGX4Bu9cci8xHZNT+Um1gWKqCsAzcC0d95rcKMU5WBg6YRUcHyV0HZKQ==" + }, + "pg-hstore": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/pg-hstore/-/pg-hstore-2.3.3.tgz", + "integrity": "sha512-qpeTpdkguFgfdoidtfeTho1Q1zPVPbtMHgs8eQ+Aan05iLmIs3Z3oo5DOZRclPGoQ4i68I1kCtQSJSa7i0ZVYg==", + "requires": { + "underscore": "^1.7.0" + } + }, + "pg-int8": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/pg-int8/-/pg-int8-1.0.1.tgz", + "integrity": "sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==" + }, + "pg-pool": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.2.2.tgz", + "integrity": "sha512-ORJoFxAlmmros8igi608iVEbQNNZlp89diFVx6yV5v+ehmpMY9sK6QgpmgoXbmkNaBAx8cOOZh9g80kJv1ooyA==" + }, + "pg-protocol": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.4.0.tgz", + "integrity": "sha512-El+aXWcwG/8wuFICMQjM5ZSAm6OWiJicFdNYo+VY3QP+8vI4SvLIWVe51PppTzMhikUJR+PsyIFKqfdXPz/yxA==" + }, + "pg-types": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/pg-types/-/pg-types-2.2.0.tgz", + "integrity": "sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==", + "requires": { + "pg-int8": "1.0.1", + "postgres-array": "~2.0.0", + "postgres-bytea": "~1.0.0", + "postgres-date": "~1.0.4", + "postgres-interval": "^1.1.0" + } + }, + "pgpass": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/pgpass/-/pgpass-1.0.4.tgz", + "integrity": "sha512-YmuA56alyBq7M59vxVBfPJrGSozru8QAdoNlWuW3cz8l+UX3cWge0vTvjKhsSHSJpo3Bom8/Mm6hf0TR5GY0+w==", + "requires": { + "split2": "^3.1.1" + } + }, "picomatch": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", "dev": true }, + "postgres-array": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz", + "integrity": "sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==" + }, + "postgres-bytea": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-1.0.0.tgz", + "integrity": "sha1-AntTPAqokOJtFy1Hz5zOzFIazTU=" + }, + "postgres-date": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.7.tgz", + "integrity": "sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==" + }, + "postgres-interval": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-1.2.0.tgz", + "integrity": "sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==", + "requires": { + "xtend": "^4.0.0" + } + }, "prepend-http": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", @@ -862,6 +1047,16 @@ "strip-json-comments": "~2.0.1" } }, + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, "readdirp": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.5.0.tgz", @@ -903,6 +1098,19 @@ "lowercase-keys": "^1.0.0" } }, + "retry-as-promised": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/retry-as-promised/-/retry-as-promised-3.2.0.tgz", + "integrity": "sha512-CybGs60B7oYU/qSQ6kuaFmRd9sTZ6oXSc0toqePvV74Ac6/IFZSI1ReFQmtCN+uvW1Mtqdwpvt/LGOiCBAY2Mg==", + "requires": { + "any-promise": "^1.3.0" + } + }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" + }, "seedrandom": { "version": "3.0.5", "resolved": "https://registry.npmjs.org/seedrandom/-/seedrandom-3.0.5.tgz", @@ -931,6 +1139,54 @@ } } }, + "sequelize": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/sequelize/-/sequelize-6.5.0.tgz", + "integrity": "sha512-owBt8fnzVy8E1OvyCyfCdVk7OOLyPVrBCMEf+CvRReC5oCyo+UqeXCtwaex9L6LM9ifZ1i3TG3sFeM5MgLK0CQ==", + "requires": { + "debug": "^4.1.1", + "dottie": "^2.0.0", + "inflection": "1.12.0", + "lodash": "^4.17.20", + "moment": "^2.26.0", + "moment-timezone": "^0.5.31", + "retry-as-promised": "^3.2.0", + "semver": "^7.3.2", + "sequelize-pool": "^6.0.0", + "toposort-class": "^1.0.1", + "uuid": "^8.1.0", + "validator": "^10.11.0", + "wkx": "^0.5.0" + }, + "dependencies": { + "debug": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "semver": { + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz", + "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==", + "requires": { + "lru-cache": "^6.0.0" + } + } + } + }, + "sequelize-pool": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/sequelize-pool/-/sequelize-pool-6.1.0.tgz", + "integrity": "sha512-4YwEw3ZgK/tY/so+GfnSgXkdwIJJ1I32uZJztIEgZeAO6HMgj64OzySbWLgxj+tXhZCJnzRfkY9gINw8Ft8ZMg==" + }, "setimmediate": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", @@ -942,6 +1198,14 @@ "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", "dev": true }, + "split2": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/split2/-/split2-3.2.2.tgz", + "integrity": "sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg==", + "requires": { + "readable-stream": "^3.0.0" + } + }, "string-width": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", @@ -982,6 +1246,14 @@ } } }, + "string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "requires": { + "safe-buffer": "~5.2.0" + } + }, "strip-ansi": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", @@ -1027,6 +1299,11 @@ "is-number": "^7.0.0" } }, + "toposort-class": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toposort-class/-/toposort-class-1.0.1.tgz", + "integrity": "sha1-f/0feMi+KMO6Rc1OGj9e4ZO9mYg=" + }, "touch": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.0.tgz", @@ -1082,6 +1359,11 @@ } } }, + "underscore": { + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.12.0.tgz", + "integrity": "sha512-21rQzss/XPMjolTiIezSu3JAjgagXKROtNrYFEOWK109qY1Uv2tVjPTZ1ci2HgvQDA16gHYSthQIJfB+XId/rQ==" + }, "unique-string": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-2.0.0.tgz", @@ -1121,6 +1403,21 @@ "prepend-http": "^2.0.0" } }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + }, + "uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" + }, + "validator": { + "version": "10.11.0", + "resolved": "https://registry.npmjs.org/validator/-/validator-10.11.0.tgz", + "integrity": "sha512-X/p3UZerAIsbBfN/IwahhYaBbY68EN/UQBWHtsbXGT5bfrH/p4NQzUCG1kF/rtKaNpnJ7jAu6NGTdSNtyNIXMw==" + }, "widest-line": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz", @@ -1130,6 +1427,14 @@ "string-width": "^4.0.0" } }, + "wkx": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/wkx/-/wkx-0.5.0.tgz", + "integrity": "sha512-Xng/d4Ichh8uN4l0FToV/258EjMGU9MGcA0HV2d9B/ZpZB3lqQm7nkOdZdm5GhKtLLhAE7PiVQwN4eN+2YJJUg==", + "requires": { + "@types/node": "*" + } + }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", @@ -1158,6 +1463,16 @@ "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-4.0.0.tgz", "integrity": "sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q==", "dev": true + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" } } } diff --git a/package.json b/package.json index 7996aea..7051352 100644 --- a/package.json +++ b/package.json @@ -23,9 +23,13 @@ "discord.js": "^12.3.1", "dotenv": "^8.2.0", "email-validator": "^2.0.4", - "random": "^2.2.0" + "pg": "^8.5.1", + "pg-hstore": "^2.3.3", + "random": "^2.2.0", + "sequelize": "^6.5.0" }, "devDependencies": { + "@types/sequelize": "^4.28.9", "nodemon": "^2.0.7" } } diff --git a/score.js b/score.js new file mode 100644 index 0000000..46bec3b --- /dev/null +++ b/score.js @@ -0,0 +1,74 @@ +const Discord = require('discord.js') +const { User, Event, sequelize, Claim } = require('./database'); +const random = require('random'); + +// const ParticipationCodes = ['REVUC2021OC', 'NICETOMEETYALL', 'HACKINGINTENSIFIES', 'W1SOFUN', 'SUPERCOOLW2', 'YOUMEANDW3', 'W4RULES', 'SPIDERWEBS', 'SIOTPLAYER', 'CHITCHATSH', 'FRIENDLYTREES', 'GOTOSLEEP', 'QOTHISLIT', 'NOMORESITTING', 'UNTILNEXTYEAR'] +const CLAIM_CHANNEL_ID = process.env.CLAIM_CHANNEL_ID; +// sequelize.sync() +/** + * + * @param {string[]} args + * @param {Discord.Message} receivedMessage + */ +async function score(args, receivedMessage) { + if(receivedMessage.channel.id != CLAIM_CHANNEL_ID) { + return; + } + + let user = await User.findByPk(receivedMessage.author.id); + + if (!user) { + user = await User.create({ userID: receivedMessage.author.id }); + } + + const code = args[0]; + + const event = await Event.findByPk(code); + + if(event) { + const claim = await Claim.findOne({where:{userID: receivedMessage.author.id, eventCode: code}}) + if (claim) { + receivedMessage.channel.send('Code already claimed') + return + } + const currentScore = user.score; + const newScore = currentScore + event.points; + user.set(`score`, newScore); + await user.save(); + await Claim.create({userID: receivedMessage.author.id, eventCode: code, claimID: random.int(1, 2000)}); + + receivedMessage.channel.send(`Hey ${receivedMessage.author.username}, thank you for attending ${event.name}, you now have ${newScore} points`); + } else { + receivedMessage.channel.send('Nice try'); + } + +} + +/** + * + * @param {string[]} args + * @param {Discord.Message} receivedMessage + */ +async function top(args, receivedMessage) { + /* const users = await User.findAll({ order: [['score', 'DESC']], limit: parseInt(args[0]) }); + let list = `\`\`\`\n`; + // console.log({ users }); + const guildUsers = await receivedMessage.guild.members.fetch(); + console.log({ guildUsers: guildUsers.map(g => g.user) }); + + users.forEach((user, i) => { + const gu = guildUsers.find(u => u.user.id === user.userID); + // console.log({ id: user.userID, gu }); + const { user: { username } } = gu; + list += `${i + 1} ${username} - score: ${user.score}\n`;`` + }); + + list += `\`\`\``; + console.log(list); + receivedMessage.channel.send(list); */ + + receivedMessage.channel.send(`Under construction!`); +} + +exports.score = score; +exports.top = top; \ No newline at end of file From 5788eecdd4ccc2223b49f3dc5ffe6f67054ed2ff Mon Sep 17 00:00:00 2001 From: Dev Agrawal Date: Mon, 8 Feb 2021 00:30:01 -0500 Subject: [PATCH 11/55] checkin attendee role --- checkin.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/checkin.js b/checkin.js index fada92e..6ba6cc0 100644 --- a/checkin.js +++ b/checkin.js @@ -6,6 +6,7 @@ const API_TOKEN = process.env.API_TOKEN const HACKER_ROLE = process.env.HACKER_ROLE const JUDGE_ROLE = process.env.JUDGE_ROLE const CHECKIN_CHANNEL_ID = process.env.CHECKIN_CHANNEL_ID +const ATTENDEE_ROLE = process.env.ATTENDEE_ROLE /** * @@ -63,14 +64,14 @@ module.exports = async function(message) { // grant the hacker role const member = message.guild.members.cache.find(member => member.id === user) const testRole = message.guild.roles.cache.find(role => role.id === roleToBeAdded) - member.roles.add(testRole) + member.roles.add([testRole, ATTENDEE_ROLE]) const censoredEmail = censorEmail(email); - console.log({ censoredEmail }) message.channel.send(`${name} <${censoredEmail}> is checked in!`) } catch (err) { - if(err.response.status === 404) { + console.error(err) + if(err.response?.status === 404) { message.channel.send(`Attendee with email ${censorEmail(email)} does not exist, please make sure you are registered with us or contact an organizer`) } else { message.channel.send(`Error checking in ${censorEmail(email)}, please try again later or contact an organizer`) From e4dd7f3e5fa66a2034a328f3f2f41d6b1e056079 Mon Sep 17 00:00:00 2001 From: Dev Agrawal Date: Tue, 9 Feb 2021 16:57:03 -0500 Subject: [PATCH 12/55] updates --- checkin.js | 2 +- index.js | 2 +- score.js | 18 +++++++++--------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/checkin.js b/checkin.js index 6ba6cc0..0baf608 100644 --- a/checkin.js +++ b/checkin.js @@ -37,7 +37,7 @@ module.exports = async function(message) { if(emailValidator.validate(email) && message.channel.id == CHECKIN_CHANNEL_ID) { // send a request to revuc api to check in the email try { - const res = await Axios.post(`http://192.168.0.102/api/v2/attendee/checkin`, { email }, { + const res = await Axios.post(`https://revolutionuc-api.herokuapp.com/api/v2/attendee/checkin`, { email }, { headers: { Authorization: `Bearer ${API_TOKEN}` } diff --git a/index.js b/index.js index 1bb1529..f5b87fd 100644 --- a/index.js +++ b/index.js @@ -119,7 +119,7 @@ function processCommand(receivedMessage) { countdown(arguments, receivedMessage) break case 'claim': - claim(arguments, receivedMessage) + score(arguments, receivedMessage) break case 'top': top(arguments, receivedMessage) diff --git a/score.js b/score.js index 46bec3b..3d0a782 100644 --- a/score.js +++ b/score.js @@ -2,7 +2,6 @@ const Discord = require('discord.js') const { User, Event, sequelize, Claim } = require('./database'); const random = require('random'); -// const ParticipationCodes = ['REVUC2021OC', 'NICETOMEETYALL', 'HACKINGINTENSIFIES', 'W1SOFUN', 'SUPERCOOLW2', 'YOUMEANDW3', 'W4RULES', 'SPIDERWEBS', 'SIOTPLAYER', 'CHITCHATSH', 'FRIENDLYTREES', 'GOTOSLEEP', 'QOTHISLIT', 'NOMORESITTING', 'UNTILNEXTYEAR'] const CLAIM_CHANNEL_ID = process.env.CLAIM_CHANNEL_ID; // sequelize.sync() /** @@ -29,18 +28,19 @@ async function score(args, receivedMessage) { const claim = await Claim.findOne({where:{userID: receivedMessage.author.id, eventCode: code}}) if (claim) { receivedMessage.channel.send('Code already claimed') - return + } else { + const currentScore = user.score; + const newScore = currentScore + event.points; + user.set(`score`, newScore); + await user.save(); + await Claim.create({userID: receivedMessage.author.id, eventCode: code, claimID: random.int(1, 2000)}) + receivedMessage.channel.send(`Hey ${receivedMessage.author.username}, thank you for attending ${event.name}, you now have ${newScore} points`) } - const currentScore = user.score; - const newScore = currentScore + event.points; - user.set(`score`, newScore); - await user.save(); - await Claim.create({userID: receivedMessage.author.id, eventCode: code, claimID: random.int(1, 2000)}); - receivedMessage.channel.send(`Hey ${receivedMessage.author.username}, thank you for attending ${event.name}, you now have ${newScore} points`); } else { - receivedMessage.channel.send('Nice try'); + receivedMessage.channel.send('Nice try') } + receivedMessage.delete() } From 6855e7cd1b1cc0b700ece573d572dd256226080d Mon Sep 17 00:00:00 2001 From: Dev Agrawal Date: Tue, 9 Feb 2021 18:25:06 -0500 Subject: [PATCH 13/55] kicked out atendees --- checkin.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/checkin.js b/checkin.js index 0baf608..4103e91 100644 --- a/checkin.js +++ b/checkin.js @@ -6,7 +6,6 @@ const API_TOKEN = process.env.API_TOKEN const HACKER_ROLE = process.env.HACKER_ROLE const JUDGE_ROLE = process.env.JUDGE_ROLE const CHECKIN_CHANNEL_ID = process.env.CHECKIN_CHANNEL_ID -const ATTENDEE_ROLE = process.env.ATTENDEE_ROLE /** * @@ -64,7 +63,7 @@ module.exports = async function(message) { // grant the hacker role const member = message.guild.members.cache.find(member => member.id === user) const testRole = message.guild.roles.cache.find(role => role.id === roleToBeAdded) - member.roles.add([testRole, ATTENDEE_ROLE]) + member.roles.add(testRole) const censoredEmail = censorEmail(email); From 9a56beb1cab0896f5395b5324524634557965ff5 Mon Sep 17 00:00:00 2001 From: Dev Agrawal Date: Tue, 9 Feb 2021 18:37:23 -0500 Subject: [PATCH 14/55] leaderboard working now --- database.js | 16 ++++------- index.js | 7 ----- score.js | 83 ++++++++++++++++++++++++++--------------------------- 3 files changed, 47 insertions(+), 59 deletions(-) diff --git a/database.js b/database.js index c4a366f..304ab6e 100644 --- a/database.js +++ b/database.js @@ -1,4 +1,4 @@ -const { Sequelize, DataTypes } = require(`sequelize`); +const { Sequelize, DataTypes } = require(`sequelize`) const sequelize = new Sequelize(process.env.DATABASE_URL, { dialect: 'postgres', dialectOptions: { ssl: { require: true, rejectUnauthorized: false } } }) exports.sequelize = sequelize @@ -10,6 +10,10 @@ exports.User = sequelize.define(`discord-user`, { allowNull: false, primaryKey: true, }, + username: { + type: DataTypes.STRING, + allowNull: false + }, score: { type: DataTypes.INTEGER, allowNull: false, @@ -32,21 +36,13 @@ exports.Event = sequelize.define(`event`, { type: DataTypes.INTEGER, allowNull: false } -}); +}) exports.Claim = sequelize.define('claim', { userID: { type: DataTypes.STRING, allowNull: false }, - - claimID: { - type: DataTypes.INTEGER, - allowNull: false, - unique: true, - primaryKey: true - }, - eventCode: { type: DataTypes.STRING, allowNull: false diff --git a/index.js b/index.js index f5b87fd..409d48a 100644 --- a/index.js +++ b/index.js @@ -1,8 +1,5 @@ require('dotenv').config(); const Discord = require('discord.js') -const emailValidator = require('email-validator') - -const random = require('random'); const help = require("./help") const multiply = require("./multiply") @@ -16,8 +13,6 @@ const client = new Discord.Client() const DISCORD_TOKEN = process.env.DISCORD_TOKEN const CHECKIN_CHANNEL_ID = process.env.CHECKIN_CHANNEL_ID -var stats = {} - client.once('ready', () => { console.log('the bot is online!') client.user.setActivity('with Javascript', {type: "PLAYING"}) @@ -56,8 +51,6 @@ client.once('ready', () => { }) -const ParticipationCodes = ['REVUC2021OC', 'NICETOMEETYALL', 'HACKINGINTENSIFIES', 'W1SOFUN', 'SUPERCOOLW2', 'YOUMEANDW3', 'W4RULES', 'SPIDERWEBS', 'SIOTPLAYER', 'CHITCHATSH', 'FRIENDLYTREES', 'GOTOSLEEP', 'QOTHISLIT', 'NOMORESITTING', 'UNTILNEXTYEAR'] - client.on('message', async (receivedMessage) => { if(receivedMessage.author == client.user) { return diff --git a/score.js b/score.js index 3d0a782..3067ba9 100644 --- a/score.js +++ b/score.js @@ -1,9 +1,10 @@ const Discord = require('discord.js') -const { User, Event, sequelize, Claim } = require('./database'); -const random = require('random'); +const { User, Event, sequelize, Claim } = require('./database') -const CLAIM_CHANNEL_ID = process.env.CLAIM_CHANNEL_ID; +const CLAIM_CHANNEL_ID = process.env.CLAIM_CHANNEL_ID +const TOP_CHANNEL_ID = process.env.TOP_CHANNEL_ID // sequelize.sync() + /** * * @param {string[]} args @@ -11,37 +12,42 @@ const CLAIM_CHANNEL_ID = process.env.CLAIM_CHANNEL_ID; */ async function score(args, receivedMessage) { if(receivedMessage.channel.id != CLAIM_CHANNEL_ID) { - return; + return } - let user = await User.findByPk(receivedMessage.author.id); + try { + let user = await User.findByPk(receivedMessage.author.id) - if (!user) { - user = await User.create({ userID: receivedMessage.author.id }); - } + if (!user) { + user = await User.create({ userID: receivedMessage.author.id, username: receivedMessage.author.username }) + } + + const code = args[0] - const code = args[0]; + const event = await Event.findByPk(code) - const event = await Event.findByPk(code); + if(event) { + const claim = await Claim.findOne({ where: { userID: receivedMessage.author.id, eventCode: code } }) - if(event) { - const claim = await Claim.findOne({where:{userID: receivedMessage.author.id, eventCode: code}}) - if (claim) { - receivedMessage.channel.send('Code already claimed') + if (claim) { + receivedMessage.channel.send('Code already claimed') + } else { + const currentScore = user.score + const newScore = currentScore + event.points + user.set(`score`, newScore) + await user.save() + await Claim.create({ userID: receivedMessage.author.id, eventCode: code }) + receivedMessage.channel.send(`Hey ${receivedMessage.author.username}, thank you for attending ${event.name}, you now have ${newScore} points`) + } } else { - const currentScore = user.score; - const newScore = currentScore + event.points; - user.set(`score`, newScore); - await user.save(); - await Claim.create({userID: receivedMessage.author.id, eventCode: code, claimID: random.int(1, 2000)}) - receivedMessage.channel.send(`Hey ${receivedMessage.author.username}, thank you for attending ${event.name}, you now have ${newScore} points`) + receivedMessage.channel.send('Nice try') } - - } else { - receivedMessage.channel.send('Nice try') + } catch(err) { + console.error(err); + receivedMessage.channel.send(`Hey ${receivedMessage.author.username}, there was an error while trying to grant you score, please contact an organizer!`) + } finally { + receivedMessage.delete() } - receivedMessage.delete() - } /** @@ -50,25 +56,18 @@ async function score(args, receivedMessage) { * @param {Discord.Message} receivedMessage */ async function top(args, receivedMessage) { - /* const users = await User.findAll({ order: [['score', 'DESC']], limit: parseInt(args[0]) }); - let list = `\`\`\`\n`; - // console.log({ users }); - const guildUsers = await receivedMessage.guild.members.fetch(); - console.log({ guildUsers: guildUsers.map(g => g.user) }); + if(receivedMessage.channel.id != TOP_CHANNEL_ID) { + return + } - users.forEach((user, i) => { - const gu = guildUsers.find(u => u.user.id === user.userID); - // console.log({ id: user.userID, gu }); - const { user: { username } } = gu; - list += `${i + 1} ${username} - score: ${user.score}\n`;`` - }); + const users = await User.findAll({ order: [['score', 'DESC']], limit: parseInt(args[0]) }) + let list = `\`\`\`\n` - list += `\`\`\``; - console.log(list); - receivedMessage.channel.send(list); */ + users.forEach((user, i) => list += `${i + 1} @${user.username} - score: ${user.score}\n`) - receivedMessage.channel.send(`Under construction!`); + list += `\`\`\`` + receivedMessage.channel.send(list) } -exports.score = score; -exports.top = top; \ No newline at end of file +exports.score = score +exports.top = top \ No newline at end of file From bbc7e0cd299da5afe51139cd9e4f337890fbf06b Mon Sep 17 00:00:00 2001 From: sahupr Date: Wed, 10 Feb 2021 21:45:24 -0500 Subject: [PATCH 15/55] minor role access + multiple checkins blocked --- checkin.js | 23 +++++++++++++++++++---- level.js | 0 revvit.pem | 27 +++++++++++++++++++++++++++ 3 files changed, 46 insertions(+), 4 deletions(-) delete mode 100644 level.js create mode 100644 revvit.pem diff --git a/checkin.js b/checkin.js index 4103e91..1daca14 100644 --- a/checkin.js +++ b/checkin.js @@ -6,6 +6,7 @@ const API_TOKEN = process.env.API_TOKEN const HACKER_ROLE = process.env.HACKER_ROLE const JUDGE_ROLE = process.env.JUDGE_ROLE const CHECKIN_CHANNEL_ID = process.env.CHECKIN_CHANNEL_ID +const MINOR_ROLE = process.env.MINOR_ROLE /** * @@ -42,7 +43,7 @@ module.exports = async function(message) { } }) - const { name, role } = res.data + const { name, role, isMinor } = res.data let roleToBeAdded; @@ -53,6 +54,12 @@ module.exports = async function(message) { case `JUDGE`: roleToBeAdded = JUDGE_ROLE; break; + case `SPONSOR`: + roleToBeAdded = SPONSOR_ROLE; + break; + case `MENTOR`: + roleToBeAdded = MENTOR_ROLE; + break; default: throw new Error(`Invalid role`); } @@ -62,9 +69,14 @@ module.exports = async function(message) { // grant the hacker role const member = message.guild.members.cache.find(member => member.id === user) - const testRole = message.guild.roles.cache.find(role => role.id === roleToBeAdded) - member.roles.add(testRole) + const Role = message.guild.roles.cache.find(role => role.id === roleToBeAdded) + member.roles.add(Role) + if (isMinor == true) { + const minorRole = message.guild.roles.cache.find(role => role.id == MINOR_ROLE) + member.roles.add(minorRole) + } + const censoredEmail = censorEmail(email); message.channel.send(`${name} <${censoredEmail}> is checked in!`) @@ -72,7 +84,10 @@ module.exports = async function(message) { console.error(err) if(err.response?.status === 404) { message.channel.send(`Attendee with email ${censorEmail(email)} does not exist, please make sure you are registered with us or contact an organizer`) - } else { + } else if (err.response?.status === 403) { + message.channel.send(`Attendee with email ${censorEmail(email)} is already checked in, are you clone?`) + } + else { message.channel.send(`Error checking in ${censorEmail(email)}, please try again later or contact an organizer`) } } diff --git a/level.js b/level.js deleted file mode 100644 index e69de29..0000000 diff --git a/revvit.pem b/revvit.pem new file mode 100644 index 0000000..6b7583c --- /dev/null +++ b/revvit.pem @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEowIBAAKCAQEAtitKTbSeT0C3ArtPgcnTSEZBp1FmG6m+HsoFnPYB3ZDAYHbJ +E22XgEaL9fB1XhaQtw1TMrJC1FxctLQAKxaJ25HUeULUczHTFuSTyi1hbS0vPAr2 +JYvg1igOfpFNlAkFORCeqqcCJljPB7bi2wnSammXTe8959vd5MVJkMg2KlEGfS4V +YRj9nJRS/H9ZaCs24E6YMKi6LQB1KH1+IKJJD/X2AieCMEQ5J3aVYWJd7670YULr +lzz1iWMHzcW8a6xehFVq4UFwsggS4D7TC2AGpRmDBkcdVaDt4EWxu/dKthy0Z2Wi +XkldkW/Ne+bEdl1wN6z/OIF7mYliysnG7u3sSwIDAQABAoIBABEb0beojfGth0KX +aukqllBEYOgg6fERKQzlNk++fwBbFuY4YbwUX9UpSv3HHo6+mcrHUpgBS+t73S0P +drCVRk87y/OzhhZniIau4v5q8qp5QuVltiZik7QpQOs8JEgR7M6mM/CdDMOjNZZo +47dkncFmt1IXdP3wlU9mA/m4A/ZHSw7icwZdeREiglwRdAZSe/y48iGETnvfHgGt +KJJTwZ0f1VS26hyZcJU1Z3vvdE37RBTVQZDDUnPvuLpGU5xOpTU3nD16UNtEeYUw ++7LWLctyFziYIQkxxh/L9fKWq5uJKOCjy7zTTmmi8ynu097cE2FJb/n+OvCBWHeS +wYvgs4ECgYEA7eAd9pFuaI6muGnI3U81zi9J4pKTjzYAw72T6dkoxA4qY3a1xYie +qtEsJfvNWULPCEkDvykIwyAl8louYvfTFxmrZzhuBC4rLfgb9VC1xa8+HlbvOPpu ++7qVFdgXEdTEa35U4z8jw7ei5Svquhrxc2NFJaklqPsU2sDLzt1+pEECgYEAxAyX +lwU3ZT1cYoY+Mj00swy7Y3QjuZ5h5bUly15g25tgaXhtK0TM+lM2pmi+5EHARJlL +GAysw4P5op2Y2fzXwp5URhQcUjRdzBcSplX5tc75Gp9Q1jOQzfAy4ugiWHtUMQt5 +yvMZUkXiK10rbBH45FvBGIM/KyNfPMKxmcs3fYsCgYA5v1zGzQuGqori3ht7To17 +XpOLQ5Y7ABszacSM0sFIxz+XIeyC5eXPBjS3i+eQMd3c3wzfzXBpHlbX/Pih4hQG +2Z540oQy05p78G2pIkzejup/pw8wP+vNhMBIq0r+cy60AdlNybg+/Ue4Zu72+y9+ +mazhtayE1196s69GqxLhgQKBgG17tsBQ2nHARbKD04IM6jw/lPpiZn0HdRZqBlQ/ +PYoGiF3+McEjJ/F3vSJLhqdEDNKCZQxmL6j0L9nfdvftmrSF5PxJyNMjiWorTG/1 +vYEJt9VlOSiWHXzUciaDioKtRQQqq3ZqMi7e9gJPgqtUkhE9KGW/DezSUSJGfBYu +BawnAoGBAN5zwrajAioJ1F4BIBa+vdMkpwbRuH8z792iYlKinl5a+tjLZ5oQTeU+ +r7Dgk2Dxhh0uDLZe8q/R7ZVVOwMm5wNhSP0I+cSaYZMM36WPVUhpdClEsbSPfCKA +IFEY7rv3Q4NotWc+533940ApV/cTBq68KF24QK4mpx06ENQdmc47 +-----END RSA PRIVATE KEY----- \ No newline at end of file From c06657299fa95385a74feda938043b3f4a0c362b Mon Sep 17 00:00:00 2001 From: Piyush Sahu <59833480+sahupr@users.noreply.github.com> Date: Wed, 10 Feb 2021 21:47:22 -0500 Subject: [PATCH 16/55] Delete revvit.pem --- revvit.pem | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 revvit.pem diff --git a/revvit.pem b/revvit.pem deleted file mode 100644 index 6b7583c..0000000 --- a/revvit.pem +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEowIBAAKCAQEAtitKTbSeT0C3ArtPgcnTSEZBp1FmG6m+HsoFnPYB3ZDAYHbJ -E22XgEaL9fB1XhaQtw1TMrJC1FxctLQAKxaJ25HUeULUczHTFuSTyi1hbS0vPAr2 -JYvg1igOfpFNlAkFORCeqqcCJljPB7bi2wnSammXTe8959vd5MVJkMg2KlEGfS4V -YRj9nJRS/H9ZaCs24E6YMKi6LQB1KH1+IKJJD/X2AieCMEQ5J3aVYWJd7670YULr -lzz1iWMHzcW8a6xehFVq4UFwsggS4D7TC2AGpRmDBkcdVaDt4EWxu/dKthy0Z2Wi -XkldkW/Ne+bEdl1wN6z/OIF7mYliysnG7u3sSwIDAQABAoIBABEb0beojfGth0KX -aukqllBEYOgg6fERKQzlNk++fwBbFuY4YbwUX9UpSv3HHo6+mcrHUpgBS+t73S0P -drCVRk87y/OzhhZniIau4v5q8qp5QuVltiZik7QpQOs8JEgR7M6mM/CdDMOjNZZo -47dkncFmt1IXdP3wlU9mA/m4A/ZHSw7icwZdeREiglwRdAZSe/y48iGETnvfHgGt -KJJTwZ0f1VS26hyZcJU1Z3vvdE37RBTVQZDDUnPvuLpGU5xOpTU3nD16UNtEeYUw -+7LWLctyFziYIQkxxh/L9fKWq5uJKOCjy7zTTmmi8ynu097cE2FJb/n+OvCBWHeS -wYvgs4ECgYEA7eAd9pFuaI6muGnI3U81zi9J4pKTjzYAw72T6dkoxA4qY3a1xYie -qtEsJfvNWULPCEkDvykIwyAl8louYvfTFxmrZzhuBC4rLfgb9VC1xa8+HlbvOPpu -+7qVFdgXEdTEa35U4z8jw7ei5Svquhrxc2NFJaklqPsU2sDLzt1+pEECgYEAxAyX -lwU3ZT1cYoY+Mj00swy7Y3QjuZ5h5bUly15g25tgaXhtK0TM+lM2pmi+5EHARJlL -GAysw4P5op2Y2fzXwp5URhQcUjRdzBcSplX5tc75Gp9Q1jOQzfAy4ugiWHtUMQt5 -yvMZUkXiK10rbBH45FvBGIM/KyNfPMKxmcs3fYsCgYA5v1zGzQuGqori3ht7To17 -XpOLQ5Y7ABszacSM0sFIxz+XIeyC5eXPBjS3i+eQMd3c3wzfzXBpHlbX/Pih4hQG -2Z540oQy05p78G2pIkzejup/pw8wP+vNhMBIq0r+cy60AdlNybg+/Ue4Zu72+y9+ -mazhtayE1196s69GqxLhgQKBgG17tsBQ2nHARbKD04IM6jw/lPpiZn0HdRZqBlQ/ -PYoGiF3+McEjJ/F3vSJLhqdEDNKCZQxmL6j0L9nfdvftmrSF5PxJyNMjiWorTG/1 -vYEJt9VlOSiWHXzUciaDioKtRQQqq3ZqMi7e9gJPgqtUkhE9KGW/DezSUSJGfBYu -BawnAoGBAN5zwrajAioJ1F4BIBa+vdMkpwbRuH8z792iYlKinl5a+tjLZ5oQTeU+ -r7Dgk2Dxhh0uDLZe8q/R7ZVVOwMm5wNhSP0I+cSaYZMM36WPVUhpdClEsbSPfCKA -IFEY7rv3Q4NotWc+533940ApV/cTBq68KF24QK4mpx06ENQdmc47 ------END RSA PRIVATE KEY----- \ No newline at end of file From a31d3524b555c72ddf146686698292405dbfdf8f Mon Sep 17 00:00:00 2001 From: sahupr Date: Thu, 11 Feb 2021 03:50:58 -0500 Subject: [PATCH 17/55] help update --- .gitignore | 3 ++- help.js | 22 ++++++++++++++++++---- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 3dc8509..2452e3e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ token.js node_modules/ -.env \ No newline at end of file +.env +.pem \ No newline at end of file diff --git a/help.js b/help.js index 69c3aa9..e952953 100644 --- a/help.js +++ b/help.js @@ -1,9 +1,23 @@ -function helpCommand(arguments, receivedMessage) { - if(arguments.length > 0){ - receivedMessage.channel.send('add time in minutes - `!countdown 5`') +function helpCommand(args, receivedMessage) { + if(args.length < 1){ + console.log('in if') + receivedMessage.channel.send('specify what you need help for: \n `!help checkin` \n `!help codes`') } else{ - receivedMessage.channel.send('invalid input, try being more specific: something like `!help [topic]` ') + const topic = args[0] + console.log('in else') + switch(topic) { + case 'checkin': + console.log('checkin prompt') + receivedMessage.channel.send('Type the email you registered with out on the checkin channel to check in to RevolutionUC. Ex: `foo@bar.com`') + break + case 'codes': + receivedMessage.channel.send('Use the bot command `!claim CODE` to claim your participation points') + break + default: + receivedMessage.channel.send('Invalid bot command') + throw new Error(`Invalid command`) + } } } From f60a70d6937905b1a3056f2dc00448fcca19b8f1 Mon Sep 17 00:00:00 2001 From: Dev Agrawal Date: Thu, 11 Feb 2021 10:29:22 -0500 Subject: [PATCH 18/55] now reading from env --- checkin.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/checkin.js b/checkin.js index 1daca14..7a4351a 100644 --- a/checkin.js +++ b/checkin.js @@ -5,6 +5,8 @@ const Axios = require('axios').default const API_TOKEN = process.env.API_TOKEN const HACKER_ROLE = process.env.HACKER_ROLE const JUDGE_ROLE = process.env.JUDGE_ROLE +const MENTOR_ROLE = process.env.MENTOR_ROLE +const SPONSOR_ROLE = process.env.SPONSOR_ROLE const CHECKIN_CHANNEL_ID = process.env.CHECKIN_CHANNEL_ID const MINOR_ROLE = process.env.MINOR_ROLE From 66477daa3853aadee380f8272708588bc13e59ca Mon Sep 17 00:00:00 2001 From: sahupr Date: Thu, 11 Feb 2021 11:34:47 -0500 Subject: [PATCH 19/55] typo --- checkin.js | 2 +- revvit.pem | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 revvit.pem diff --git a/checkin.js b/checkin.js index 1daca14..e1a1e70 100644 --- a/checkin.js +++ b/checkin.js @@ -85,7 +85,7 @@ module.exports = async function(message) { if(err.response?.status === 404) { message.channel.send(`Attendee with email ${censorEmail(email)} does not exist, please make sure you are registered with us or contact an organizer`) } else if (err.response?.status === 403) { - message.channel.send(`Attendee with email ${censorEmail(email)} is already checked in, are you clone?`) + message.channel.send(`Attendee with email ${censorEmail(email)} is already checked in, are you a clone?`) } else { message.channel.send(`Error checking in ${censorEmail(email)}, please try again later or contact an organizer`) diff --git a/revvit.pem b/revvit.pem new file mode 100644 index 0000000..6b7583c --- /dev/null +++ b/revvit.pem @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEowIBAAKCAQEAtitKTbSeT0C3ArtPgcnTSEZBp1FmG6m+HsoFnPYB3ZDAYHbJ +E22XgEaL9fB1XhaQtw1TMrJC1FxctLQAKxaJ25HUeULUczHTFuSTyi1hbS0vPAr2 +JYvg1igOfpFNlAkFORCeqqcCJljPB7bi2wnSammXTe8959vd5MVJkMg2KlEGfS4V +YRj9nJRS/H9ZaCs24E6YMKi6LQB1KH1+IKJJD/X2AieCMEQ5J3aVYWJd7670YULr +lzz1iWMHzcW8a6xehFVq4UFwsggS4D7TC2AGpRmDBkcdVaDt4EWxu/dKthy0Z2Wi +XkldkW/Ne+bEdl1wN6z/OIF7mYliysnG7u3sSwIDAQABAoIBABEb0beojfGth0KX +aukqllBEYOgg6fERKQzlNk++fwBbFuY4YbwUX9UpSv3HHo6+mcrHUpgBS+t73S0P +drCVRk87y/OzhhZniIau4v5q8qp5QuVltiZik7QpQOs8JEgR7M6mM/CdDMOjNZZo +47dkncFmt1IXdP3wlU9mA/m4A/ZHSw7icwZdeREiglwRdAZSe/y48iGETnvfHgGt +KJJTwZ0f1VS26hyZcJU1Z3vvdE37RBTVQZDDUnPvuLpGU5xOpTU3nD16UNtEeYUw ++7LWLctyFziYIQkxxh/L9fKWq5uJKOCjy7zTTmmi8ynu097cE2FJb/n+OvCBWHeS +wYvgs4ECgYEA7eAd9pFuaI6muGnI3U81zi9J4pKTjzYAw72T6dkoxA4qY3a1xYie +qtEsJfvNWULPCEkDvykIwyAl8louYvfTFxmrZzhuBC4rLfgb9VC1xa8+HlbvOPpu ++7qVFdgXEdTEa35U4z8jw7ei5Svquhrxc2NFJaklqPsU2sDLzt1+pEECgYEAxAyX +lwU3ZT1cYoY+Mj00swy7Y3QjuZ5h5bUly15g25tgaXhtK0TM+lM2pmi+5EHARJlL +GAysw4P5op2Y2fzXwp5URhQcUjRdzBcSplX5tc75Gp9Q1jOQzfAy4ugiWHtUMQt5 +yvMZUkXiK10rbBH45FvBGIM/KyNfPMKxmcs3fYsCgYA5v1zGzQuGqori3ht7To17 +XpOLQ5Y7ABszacSM0sFIxz+XIeyC5eXPBjS3i+eQMd3c3wzfzXBpHlbX/Pih4hQG +2Z540oQy05p78G2pIkzejup/pw8wP+vNhMBIq0r+cy60AdlNybg+/Ue4Zu72+y9+ +mazhtayE1196s69GqxLhgQKBgG17tsBQ2nHARbKD04IM6jw/lPpiZn0HdRZqBlQ/ +PYoGiF3+McEjJ/F3vSJLhqdEDNKCZQxmL6j0L9nfdvftmrSF5PxJyNMjiWorTG/1 +vYEJt9VlOSiWHXzUciaDioKtRQQqq3ZqMi7e9gJPgqtUkhE9KGW/DezSUSJGfBYu +BawnAoGBAN5zwrajAioJ1F4BIBa+vdMkpwbRuH8z792iYlKinl5a+tjLZ5oQTeU+ +r7Dgk2Dxhh0uDLZe8q/R7ZVVOwMm5wNhSP0I+cSaYZMM36WPVUhpdClEsbSPfCKA +IFEY7rv3Q4NotWc+533940ApV/cTBq68KF24QK4mpx06ENQdmc47 +-----END RSA PRIVATE KEY----- \ No newline at end of file From fa9617ab651f4f074dd10709b49284f4db60277c Mon Sep 17 00:00:00 2001 From: Piyush Sahu <59833480+sahupr@users.noreply.github.com> Date: Thu, 11 Feb 2021 11:39:39 -0500 Subject: [PATCH 20/55] Delete revvit.pem --- revvit.pem | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 revvit.pem diff --git a/revvit.pem b/revvit.pem deleted file mode 100644 index 6b7583c..0000000 --- a/revvit.pem +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEowIBAAKCAQEAtitKTbSeT0C3ArtPgcnTSEZBp1FmG6m+HsoFnPYB3ZDAYHbJ -E22XgEaL9fB1XhaQtw1TMrJC1FxctLQAKxaJ25HUeULUczHTFuSTyi1hbS0vPAr2 -JYvg1igOfpFNlAkFORCeqqcCJljPB7bi2wnSammXTe8959vd5MVJkMg2KlEGfS4V -YRj9nJRS/H9ZaCs24E6YMKi6LQB1KH1+IKJJD/X2AieCMEQ5J3aVYWJd7670YULr -lzz1iWMHzcW8a6xehFVq4UFwsggS4D7TC2AGpRmDBkcdVaDt4EWxu/dKthy0Z2Wi -XkldkW/Ne+bEdl1wN6z/OIF7mYliysnG7u3sSwIDAQABAoIBABEb0beojfGth0KX -aukqllBEYOgg6fERKQzlNk++fwBbFuY4YbwUX9UpSv3HHo6+mcrHUpgBS+t73S0P -drCVRk87y/OzhhZniIau4v5q8qp5QuVltiZik7QpQOs8JEgR7M6mM/CdDMOjNZZo -47dkncFmt1IXdP3wlU9mA/m4A/ZHSw7icwZdeREiglwRdAZSe/y48iGETnvfHgGt -KJJTwZ0f1VS26hyZcJU1Z3vvdE37RBTVQZDDUnPvuLpGU5xOpTU3nD16UNtEeYUw -+7LWLctyFziYIQkxxh/L9fKWq5uJKOCjy7zTTmmi8ynu097cE2FJb/n+OvCBWHeS -wYvgs4ECgYEA7eAd9pFuaI6muGnI3U81zi9J4pKTjzYAw72T6dkoxA4qY3a1xYie -qtEsJfvNWULPCEkDvykIwyAl8louYvfTFxmrZzhuBC4rLfgb9VC1xa8+HlbvOPpu -+7qVFdgXEdTEa35U4z8jw7ei5Svquhrxc2NFJaklqPsU2sDLzt1+pEECgYEAxAyX -lwU3ZT1cYoY+Mj00swy7Y3QjuZ5h5bUly15g25tgaXhtK0TM+lM2pmi+5EHARJlL -GAysw4P5op2Y2fzXwp5URhQcUjRdzBcSplX5tc75Gp9Q1jOQzfAy4ugiWHtUMQt5 -yvMZUkXiK10rbBH45FvBGIM/KyNfPMKxmcs3fYsCgYA5v1zGzQuGqori3ht7To17 -XpOLQ5Y7ABszacSM0sFIxz+XIeyC5eXPBjS3i+eQMd3c3wzfzXBpHlbX/Pih4hQG -2Z540oQy05p78G2pIkzejup/pw8wP+vNhMBIq0r+cy60AdlNybg+/Ue4Zu72+y9+ -mazhtayE1196s69GqxLhgQKBgG17tsBQ2nHARbKD04IM6jw/lPpiZn0HdRZqBlQ/ -PYoGiF3+McEjJ/F3vSJLhqdEDNKCZQxmL6j0L9nfdvftmrSF5PxJyNMjiWorTG/1 -vYEJt9VlOSiWHXzUciaDioKtRQQqq3ZqMi7e9gJPgqtUkhE9KGW/DezSUSJGfBYu -BawnAoGBAN5zwrajAioJ1F4BIBa+vdMkpwbRuH8z792iYlKinl5a+tjLZ5oQTeU+ -r7Dgk2Dxhh0uDLZe8q/R7ZVVOwMm5wNhSP0I+cSaYZMM36WPVUhpdClEsbSPfCKA -IFEY7rv3Q4NotWc+533940ApV/cTBq68KF24QK4mpx06ENQdmc47 ------END RSA PRIVATE KEY----- \ No newline at end of file From 444d15b2ac2ce4248d1113c65f594c28c387e7e8 Mon Sep 17 00:00:00 2001 From: sahupr Date: Thu, 11 Feb 2021 12:09:35 -0500 Subject: [PATCH 21/55] phrase change --- .gitignore | 3 +-- checkin.js | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 2452e3e..3dc8509 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ token.js node_modules/ -.env -.pem \ No newline at end of file +.env \ No newline at end of file diff --git a/checkin.js b/checkin.js index 0f1e228..9927a67 100644 --- a/checkin.js +++ b/checkin.js @@ -87,7 +87,7 @@ module.exports = async function(message) { if(err.response?.status === 404) { message.channel.send(`Attendee with email ${censorEmail(email)} does not exist, please make sure you are registered with us or contact an organizer`) } else if (err.response?.status === 403) { - message.channel.send(`Attendee with email ${censorEmail(email)} is already checked in, are you a clone?`) + message.channel.send(`Attendee with email ${censorEmail(email)} is already checked in.`) } else { message.channel.send(`Error checking in ${censorEmail(email)}, please try again later or contact an organizer`) From 3ec951181510cbccf0a98f4e6d7cb4c63f2c9fee Mon Sep 17 00:00:00 2001 From: sahupr Date: Mon, 15 Feb 2021 12:26:55 -0500 Subject: [PATCH 22/55] checkin responses --- checkin.js | 37 ++++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/checkin.js b/checkin.js index 9927a67..118e998 100644 --- a/checkin.js +++ b/checkin.js @@ -29,10 +29,35 @@ const censorEmail = email => { return ptEmail.replace(censor, stars) } +const getRandomInt = max => { + return Math.floor(Math.random() * Math.floor(max)); +} + /** * * @param {Discord.Message} message */ + +const responses_success = [ + 'is checked in!', + ', welcome to the main event!', + 'is here!', + 'welcome onboard!', + 'has arrived!' +] + +const responses_404 = [ + 'does not exist', + 'cannot be found', + ', are you using the right email?' +] + +const responses_403 = [ + "you're already checked in.", + 'already exists, is this a clone?', + "you've already signed up!", +] + module.exports = async function(message) { const email = message.toString(); @@ -81,13 +106,19 @@ module.exports = async function(message) { const censoredEmail = censorEmail(email); - message.channel.send(`${name} <${censoredEmail}> is checked in!`) + let max_success = responses_success.length + var max_404 = responses_404.length + var max_403 = responses_403.length + + message.channel.send(`${name} <${censoredEmail}> ${responses_success[random.int(0, max_success-1)]}`) } catch (err) { console.error(err) if(err.response?.status === 404) { - message.channel.send(`Attendee with email ${censorEmail(email)} does not exist, please make sure you are registered with us or contact an organizer`) + // message.channel.send(`${censorEmail(email)} ${responses_404[random.int(0, max_404-1)]}, please make sure you are registered with us or contact an organizer`) + console.log(max_404, getRandomInt(max_404)) } else if (err.response?.status === 403) { - message.channel.send(`Attendee with email ${censorEmail(email)} is already checked in.`) + // message.channel.send(`${censorEmail(email)} ${responses_403[random.int(0, max_403-1)]}`) + console.log(max_403, getRandomInt(max_403)) } else { message.channel.send(`Error checking in ${censorEmail(email)}, please try again later or contact an organizer`) From c20ed54ab7c5c9ffc3d12d76df5e5459132c294c Mon Sep 17 00:00:00 2001 From: sahupr Date: Mon, 15 Feb 2021 12:41:25 -0500 Subject: [PATCH 23/55] checkin responses resolved --- checkin.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/checkin.js b/checkin.js index 118e998..30d22ce 100644 --- a/checkin.js +++ b/checkin.js @@ -61,6 +61,10 @@ const responses_403 = [ module.exports = async function(message) { const email = message.toString(); + const max_success = responses_success.length + const max_404 = responses_404.length + const max_403 = responses_403.length + if(emailValidator.validate(email) && message.channel.id == CHECKIN_CHANNEL_ID) { // send a request to revuc api to check in the email try { @@ -106,19 +110,13 @@ module.exports = async function(message) { const censoredEmail = censorEmail(email); - let max_success = responses_success.length - var max_404 = responses_404.length - var max_403 = responses_403.length - message.channel.send(`${name} <${censoredEmail}> ${responses_success[random.int(0, max_success-1)]}`) } catch (err) { console.error(err) if(err.response?.status === 404) { - // message.channel.send(`${censorEmail(email)} ${responses_404[random.int(0, max_404-1)]}, please make sure you are registered with us or contact an organizer`) - console.log(max_404, getRandomInt(max_404)) + message.channel.send(`${censorEmail(email)} ${responses_404[getRandomInt(max_404)]}, please make sure you are registered with us or contact an organizer`) } else if (err.response?.status === 403) { - // message.channel.send(`${censorEmail(email)} ${responses_403[random.int(0, max_403-1)]}`) - console.log(max_403, getRandomInt(max_403)) + message.channel.send(`${censorEmail(email)} ${responses_403[getRandomInt(max_403)]}`) } else { message.channel.send(`Error checking in ${censorEmail(email)}, please try again later or contact an organizer`) From ac3ccd242a0a5d8928c65704b49dbb04e9714399 Mon Sep 17 00:00:00 2001 From: sahupr Date: Mon, 15 Feb 2021 12:49:03 -0500 Subject: [PATCH 24/55] responses added --- checkin.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/checkin.js b/checkin.js index 30d22ce..5dd5f41 100644 --- a/checkin.js +++ b/checkin.js @@ -129,4 +129,6 @@ module.exports = async function(message) { message.channel.send(`${censored} is not a valid email`) message.delete({timeout: 3000}) } -} \ No newline at end of file +} + +//more responses can be added at any time \ No newline at end of file From a9ad44a98ee80acf7bdbea2250626e047023e0fc Mon Sep 17 00:00:00 2001 From: sahupr Date: Mon, 15 Feb 2021 12:54:41 -0500 Subject: [PATCH 25/55] responses added --- checkin.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/checkin.js b/checkin.js index 5dd5f41..30d22ce 100644 --- a/checkin.js +++ b/checkin.js @@ -129,6 +129,4 @@ module.exports = async function(message) { message.channel.send(`${censored} is not a valid email`) message.delete({timeout: 3000}) } -} - -//more responses can be added at any time \ No newline at end of file +} \ No newline at end of file From c23cb856127a956f8ed1d7a569a2c1bfcf0f99ea Mon Sep 17 00:00:00 2001 From: Dev Agrawal Date: Wed, 17 Feb 2021 12:30:05 -0500 Subject: [PATCH 26/55] fixed random int issue --- checkin.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/checkin.js b/checkin.js index 30d22ce..3bcca1f 100644 --- a/checkin.js +++ b/checkin.js @@ -110,7 +110,7 @@ module.exports = async function(message) { const censoredEmail = censorEmail(email); - message.channel.send(`${name} <${censoredEmail}> ${responses_success[random.int(0, max_success-1)]}`) + message.channel.send(`${name} <${censoredEmail}> ${responses_success[getRandomInt(max_success)]}`) } catch (err) { console.error(err) if(err.response?.status === 404) { From e59f944aadd481e559806c8329084b0cc7ab3008 Mon Sep 17 00:00:00 2001 From: sahupr Date: Wed, 17 Feb 2021 15:54:04 -0500 Subject: [PATCH 27/55] claim points custom responses --- score.js | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 51 insertions(+), 6 deletions(-) diff --git a/score.js b/score.js index 3067ba9..07d7da4 100644 --- a/score.js +++ b/score.js @@ -1,4 +1,5 @@ const Discord = require('discord.js') +const { NONE } = require('sequelize') const { User, Event, sequelize, Claim } = require('./database') const CLAIM_CHANNEL_ID = process.env.CLAIM_CHANNEL_ID @@ -10,8 +11,45 @@ const TOP_CHANNEL_ID = process.env.TOP_CHANNEL_ID * @param {string[]} args * @param {Discord.Message} receivedMessage */ + +function generateResponse(name, event, score, r_id) { + + const getRandomInt = max => { + return Math.floor(Math.random() * Math.floor(max)); + } + + const claim_success = [ + `Good job attending ${event.name}, you now have ${score} points. Now go attend another one.`, + `Ayy nice job ${name}. Hope you enjoyed ${event.name}! You now have ${score} points.` + ] + + const code_wrong = [ //Doesn't take points for now + `Stop cheating ${name}!`, + `Nice try!`, + `I’m sorry ${name}, but we never gave you that code. Please try a code that works.`, + `${name} Did you just make that up? Because I sure don’t know this code.` + ] + + const code_claimed = [ //Doesn't take points for now + `Oops, sorry that code has already been claimed`, + `You’ve already attended ${event.name}, good job!`, + `Unless you invented time travel, you can’t attend ${event.name} twice` + ] + + if(r_id == 1){ + return claim_success[getRandomInt(claim_success.length)] + } + else if(r_id == 2){ + return code_wrong[getRandomInt(code_wrong.length)] + } + else if(r_id == 3){ + return code_claimed[getRandomInt(code_claimed.length)] + } +} + async function score(args, receivedMessage) { if(receivedMessage.channel.id != CLAIM_CHANNEL_ID) { + console.log('wrong channel') return } @@ -30,21 +68,28 @@ async function score(args, receivedMessage) { const claim = await Claim.findOne({ where: { userID: receivedMessage.author.id, eventCode: code } }) if (claim) { - receivedMessage.channel.send('Code already claimed') - } else { + var claimedResponse = generateResponse(receivedMessage.author.username, event, NONE, 3) + receivedMessage.channel.send(claimedResponse) + } + else { const currentScore = user.score const newScore = currentScore + event.points user.set(`score`, newScore) await user.save() await Claim.create({ userID: receivedMessage.author.id, eventCode: code }) - receivedMessage.channel.send(`Hey ${receivedMessage.author.username}, thank you for attending ${event.name}, you now have ${newScore} points`) + var successResponse = generateResponse(receivedMessage.author.username, event, newScore, 1) + receivedMessage.channel.send(successResponse) + // receivedMessage.channel.send(`Hey ${receivedMessage.author.username}, thank you for attending ${event.name}, you now have ${newScore} points`) //correct code } - } else { - receivedMessage.channel.send('Nice try') + } + else { + var wrongResponse = generateResponse(receivedMessage.author.username, NONE, NONE, 2) + receivedMessage.channel.send(wrongResponse) + // receivedMessage.channel.send('Nice try') //wrong code } } catch(err) { console.error(err); - receivedMessage.channel.send(`Hey ${receivedMessage.author.username}, there was an error while trying to grant you score, please contact an organizer!`) + receivedMessage.channel.send(`Hey ${receivedMessage.author.username}, there was an error while trying to grant you score, please contact an organizer!`) //invalid code } finally { receivedMessage.delete() } From 894e17585114987e3abfedbec6e6b4df8f807f0e Mon Sep 17 00:00:00 2001 From: Dev Agrawal Date: Wed, 17 Feb 2021 19:25:58 -0500 Subject: [PATCH 28/55] fixed the .name issue --- score.js | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/score.js b/score.js index 07d7da4..e326ae6 100644 --- a/score.js +++ b/score.js @@ -1,10 +1,8 @@ const Discord = require('discord.js') -const { NONE } = require('sequelize') -const { User, Event, sequelize, Claim } = require('./database') +const { User, Event, Claim } = require('./database') const CLAIM_CHANNEL_ID = process.env.CLAIM_CHANNEL_ID const TOP_CHANNEL_ID = process.env.TOP_CHANNEL_ID -// sequelize.sync() /** * @@ -19,8 +17,8 @@ function generateResponse(name, event, score, r_id) { } const claim_success = [ - `Good job attending ${event.name}, you now have ${score} points. Now go attend another one.`, - `Ayy nice job ${name}. Hope you enjoyed ${event.name}! You now have ${score} points.` + `Good job attending ${event?.name}, you now have ${score} points. Now go attend another one.`, + `Ayy nice job ${name}. Hope you enjoyed ${event?.name}! You now have ${score} points.` ] const code_wrong = [ //Doesn't take points for now @@ -32,17 +30,17 @@ function generateResponse(name, event, score, r_id) { const code_claimed = [ //Doesn't take points for now `Oops, sorry that code has already been claimed`, - `You’ve already attended ${event.name}, good job!`, - `Unless you invented time travel, you can’t attend ${event.name} twice` + `You’ve already attended ${event?.name}, good job!`, + `Unless you invented time travel, you can’t attend ${event?.name} twice` ] if(r_id == 1){ return claim_success[getRandomInt(claim_success.length)] } - else if(r_id == 2){ + if(r_id == 2){ return code_wrong[getRandomInt(code_wrong.length)] } - else if(r_id == 3){ + if(r_id == 3){ return code_claimed[getRandomInt(code_claimed.length)] } } @@ -68,7 +66,7 @@ async function score(args, receivedMessage) { const claim = await Claim.findOne({ where: { userID: receivedMessage.author.id, eventCode: code } }) if (claim) { - var claimedResponse = generateResponse(receivedMessage.author.username, event, NONE, 3) + const claimedResponse = generateResponse(receivedMessage.author.username, event, null, 3) receivedMessage.channel.send(claimedResponse) } else { @@ -77,13 +75,13 @@ async function score(args, receivedMessage) { user.set(`score`, newScore) await user.save() await Claim.create({ userID: receivedMessage.author.id, eventCode: code }) - var successResponse = generateResponse(receivedMessage.author.username, event, newScore, 1) + const successResponse = generateResponse(receivedMessage.author.username, event, newScore, 1) receivedMessage.channel.send(successResponse) // receivedMessage.channel.send(`Hey ${receivedMessage.author.username}, thank you for attending ${event.name}, you now have ${newScore} points`) //correct code } } else { - var wrongResponse = generateResponse(receivedMessage.author.username, NONE, NONE, 2) + const wrongResponse = generateResponse(receivedMessage.author.username, null, null, 2) receivedMessage.channel.send(wrongResponse) // receivedMessage.channel.send('Nice try') //wrong code } From a493cf2b7ebdf3a8437dec79c51a34a6f2af51dc Mon Sep 17 00:00:00 2001 From: sahupr Date: Thu, 18 Feb 2021 13:48:50 -0500 Subject: [PATCH 29/55] intro added --- help.js | 4 +--- index.js | 4 ++++ revvit.js | 7 +++++++ 3 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 revvit.js diff --git a/help.js b/help.js index e952953..8b05ece 100644 --- a/help.js +++ b/help.js @@ -1,11 +1,9 @@ function helpCommand(args, receivedMessage) { if(args.length < 1){ - console.log('in if') - receivedMessage.channel.send('specify what you need help for: \n `!help checkin` \n `!help codes`') + receivedMessage.channel.send('specify what you need help for:\n `!revvit` \n `!help checkin` \n `!help codes`') } else{ const topic = args[0] - console.log('in else') switch(topic) { case 'checkin': console.log('checkin prompt') diff --git a/index.js b/index.js index 409d48a..e50c4c4 100644 --- a/index.js +++ b/index.js @@ -7,6 +7,7 @@ const react = require("./react") const countdown = require("./countdown") const checkin = require('./checkin') const { score, top } = require('./score') +const revvit = require("./revvit") const client = new Discord.Client() @@ -117,6 +118,9 @@ function processCommand(receivedMessage) { case 'top': top(arguments, receivedMessage) break + case 'hi': + revvit(arguments, receivedMessage) + break } } diff --git a/revvit.js b/revvit.js new file mode 100644 index 0000000..6a385cb --- /dev/null +++ b/revvit.js @@ -0,0 +1,7 @@ +function revvitCommand(arguments, receivedMessage){ + + const intro = "Hi! I am the official bot for RevolutionUC 2021! \nI can assist you check in to the event, and keep track of your participation scores. Just say `!help` to list all the things that I can do! \nGood luck and have fun hacking!" + receivedMessage.channel.send(intro) +} + +module.exports=revvitCommand \ No newline at end of file From 2819b4ca54bda18700a2896a180a4e41a074c8d2 Mon Sep 17 00:00:00 2001 From: sahupr Date: Thu, 18 Feb 2021 15:17:18 -0500 Subject: [PATCH 30/55] private checkin --- checkin_prv.js | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++ index.js | 4 +++ 2 files changed, 76 insertions(+) create mode 100644 checkin_prv.js diff --git a/checkin_prv.js b/checkin_prv.js new file mode 100644 index 0000000..b88f16f --- /dev/null +++ b/checkin_prv.js @@ -0,0 +1,72 @@ +const Discord = require('discord.js') +const emailValidator = require('email-validator') +const Axios = require('axios').default + + +module.exports = async function(args, message) { + + if(args.length < 1){ + receivedMessage.channel.send('email not specified\n'+`!${message} email@domain.com`) + } + else { + var email = args[0].toString() + var name = (args[1]+' '+args[2]).toString() + + if(emailValidator.validate(email) && message.channel.id == TOP_CHANNEL_ID) { + try { + await Axios.post(`https://revolutionuc-api.herokuapp.com/api/v2/attendee`, { name, email, role }, { + headers: { + Authorization: `Bearer ${API_TOKEN}` + } + }) + + let roleToBeAdded; + + switch(message) { + case `JUDGE`: + roleToBeAdded = JUDGE_ROLE; + break; + case `SPONSOR`: + roleToBeAdded = SPONSOR_ROLE; + break; + case `MENTOR`: + roleToBeAdded = MENTOR_ROLE; + break; + default: + throw new Error(`Invalid role`); + } + + //changes from here + + // check in succeeded + const user = message.author.id + + // grant the hacker role + const member = message.guild.members.cache.find(member => member.id === user) + const Role = message.guild.roles.cache.find(role => role.id === roleToBeAdded) + member.roles.add(Role) + + const censoredEmail = censorEmail(email); + + message.channel.send(`${name} <${censoredEmail}> ${responses_success[getRandomInt(max_success)]}`) + } catch (err) { + console.error(err) + if(err.response?.status === 404) { + message.channel.send(`${censorEmail(email)} ${responses_404[getRandomInt(max_404)]}, please make sure you are registered with us or contact an organizer`) + } else if (err.response?.status === 403) { + message.channel.send(`${censorEmail(email)} ${responses_403[getRandomInt(max_403)]}`) + } + else { + message.channel.send(`Error checking in ${censorEmail(email)}, please try again later or contact an organizer`) + } + } + + message.delete({ timeout: 2000 }) + } else { + const censored = censorEmail(email); + message.channel.send(`${censored} is not a valid email`) + message.delete({timeout: 3000}) + } + } + } + \ No newline at end of file diff --git a/index.js b/index.js index e50c4c4..52065fc 100644 --- a/index.js +++ b/index.js @@ -8,6 +8,7 @@ const countdown = require("./countdown") const checkin = require('./checkin') const { score, top } = require('./score') const revvit = require("./revvit") +const checkin_prv = require("./checkin_prv") const client = new Discord.Client() @@ -121,6 +122,9 @@ function processCommand(receivedMessage) { case 'hi': revvit(arguments, receivedMessage) break + case 'sponsor' || 'mentor' || 'judge': + checkin_prv(argumnets, receivedMessage) + } } From 78a3afe3ab326d0c4c806a51c49cfb4883ae39e8 Mon Sep 17 00:00:00 2001 From: Dev Agrawal Date: Thu, 18 Feb 2021 16:09:50 -0500 Subject: [PATCH 31/55] updates --- background.js | 6 ++++ checkin_prv.js | 96 +++++++++++++++++--------------------------------- help.js | 17 +++++++-- index.js | 25 +++++++++---- revvit.js | 1 - 5 files changed, 71 insertions(+), 74 deletions(-) create mode 100644 background.js diff --git a/background.js b/background.js new file mode 100644 index 0000000..0025895 --- /dev/null +++ b/background.js @@ -0,0 +1,6 @@ +function background(arguments, receivedMessage){ + const intro = "Oh you wanna know about my background... okay, here goes.\nI was conceived by one Super User Dev Olpowerful (SUDO), and I was brought to life by one Piyush Rap!d Sahu (PRS)." + receivedMessage.channel.send(intro) +} + +module.exports=background \ No newline at end of file diff --git a/checkin_prv.js b/checkin_prv.js index b88f16f..a2ab05e 100644 --- a/checkin_prv.js +++ b/checkin_prv.js @@ -1,72 +1,40 @@ const Discord = require('discord.js') -const emailValidator = require('email-validator') const Axios = require('axios').default +const API_TOKEN = process.env.API_TOKEN +const TOP_CHANNEL_ID = process.env.TOP_CHANNEL_ID -module.exports = async function(args, message) { +/** + * + * @param {string[]} args + * @param {Discord.Message} message + * @param {'sponsor' | 'mentor' | 'judge'} primaryCommand + */ +module.exports = async function (args, message, primaryCommand) { + if (args.length < 2) { + message.channel.send(`Invalid command format! Please specify role, email and name.`) + } else { + const email = args.shift() + const name = args.join(` `) + const role = primaryCommand.toUpperCase() - if(args.length < 1){ - receivedMessage.channel.send('email not specified\n'+`!${message} email@domain.com`) - } - else { - var email = args[0].toString() - var name = (args[1]+' '+args[2]).toString() - - if(emailValidator.validate(email) && message.channel.id == TOP_CHANNEL_ID) { - try { - await Axios.post(`https://revolutionuc-api.herokuapp.com/api/v2/attendee`, { name, email, role }, { - headers: { - Authorization: `Bearer ${API_TOKEN}` - } - }) - - let roleToBeAdded; - - switch(message) { - case `JUDGE`: - roleToBeAdded = JUDGE_ROLE; - break; - case `SPONSOR`: - roleToBeAdded = SPONSOR_ROLE; - break; - case `MENTOR`: - roleToBeAdded = MENTOR_ROLE; - break; - default: - throw new Error(`Invalid role`); - } - - //changes from here + if (message.channel.id == TOP_CHANNEL_ID) { + try { + await Axios.post( + `https://revolutionuc-api.herokuapp.com/api/v2/attendee`, + { email, name, role }, + { headers: { Authorization: `Bearer ${API_TOKEN}` } } + ) - // check in succeeded - const user = message.author.id - - // grant the hacker role - const member = message.guild.members.cache.find(member => member.id === user) - const Role = message.guild.roles.cache.find(role => role.id === roleToBeAdded) - member.roles.add(Role) - - const censoredEmail = censorEmail(email); - - message.channel.send(`${name} <${censoredEmail}> ${responses_success[getRandomInt(max_success)]}`) - } catch (err) { - console.error(err) - if(err.response?.status === 404) { - message.channel.send(`${censorEmail(email)} ${responses_404[getRandomInt(max_404)]}, please make sure you are registered with us or contact an organizer`) - } else if (err.response?.status === 403) { - message.channel.send(`${censorEmail(email)} ${responses_403[getRandomInt(max_403)]}`) - } - else { - message.channel.send(`Error checking in ${censorEmail(email)}, please try again later or contact an organizer`) - } - } - - message.delete({ timeout: 2000 }) - } else { - const censored = censorEmail(email); - message.channel.send(`${censored} is not a valid email`) - message.delete({timeout: 3000}) - } + message.channel.send(`Created ${role} ${name} <${email}>`) + } catch (err) { + console.error(err) + if (err.response?.status === 400) { + message.channel.send(`Attendee with email ${email} already exists!`) + } else { + message.channel.send(`Error creating attendee ${email}, please try again later or contact the Super User Dev Olpowerful (SUDO).`) } + } } - \ No newline at end of file + } +} diff --git a/help.js b/help.js index 8b05ece..c212865 100644 --- a/help.js +++ b/help.js @@ -1,8 +1,14 @@ +const TOP_CHANNEL_ID = process.env.TOP_CHANNEL_ID + function helpCommand(args, receivedMessage) { + const isAdminChannel = receivedMessage.channel.id == TOP_CHANNEL_ID; + if(args.length < 1){ - receivedMessage.channel.send('specify what you need help for:\n `!revvit` \n `!help checkin` \n `!help codes`') + isAdminChannel ? + receivedMessage.channel.send('specify what you need help for:\n `!revvit` \n `!help checkin` \n `!help codes` \n `!help sponsor` \n `!help judge` \n `!help mentor` \nor `!background` to know more about me! ') : + receivedMessage.channel.send('specify what you need help for:\n `!revvit` \n `!help checkin` \n `!help codes` \nor `!background` to know more about me! ') } - else{ + else { const topic = args[0] switch(topic) { case 'checkin': @@ -12,6 +18,13 @@ function helpCommand(args, receivedMessage) { case 'codes': receivedMessage.channel.send('Use the bot command `!claim CODE` to claim your participation points') break + case 'sponsor': + case 'mentor': + case 'judge': + if(isAdminChannel) { + receivedMessage.channel.send(`Use the bot command \`!${topic} \` to add an attendee to the database and allow them to check in to the discord server`) + break + } default: receivedMessage.channel.send('Invalid bot command') throw new Error(`Invalid command`) diff --git a/index.js b/index.js index 52065fc..7b86d86 100644 --- a/index.js +++ b/index.js @@ -8,6 +8,7 @@ const countdown = require("./countdown") const checkin = require('./checkin') const { score, top } = require('./score') const revvit = require("./revvit") +const background = require("./background") const checkin_prv = require("./checkin_prv") const client = new Discord.Client() @@ -91,11 +92,15 @@ client.on('message', async (receivedMessage) => { } }) +/** + * + * @param {Discord.Message} receivedMessage + */ function processCommand(receivedMessage) { - let fullCommand = receivedMessage.content.substr(1) //remove the leading/bot identifying character - let splitCommand = fullCommand.split(" ") //split the message up into pieces for each space - let primaryCommand = splitCommand[0] //take the first string from the split - let arguments = splitCommand.slice(1) //all other words are arguments/parameters for the primaryCommand + const fullCommand = receivedMessage.content.substr(1) //remove the leading/bot identifying character + const splitCommand = fullCommand.split(" ") //split the message up into pieces for each space + const primaryCommand = splitCommand[0] //take the first string from the split + const arguments = splitCommand.slice(1) //all other words are arguments/parameters for the primaryCommand console.log('command received: ' + primaryCommand) console.log('Arguments: ' + arguments) @@ -120,11 +125,17 @@ function processCommand(receivedMessage) { top(arguments, receivedMessage) break case 'hi': + case 'revvit': revvit(arguments, receivedMessage) break - case 'sponsor' || 'mentor' || 'judge': - checkin_prv(argumnets, receivedMessage) - + case 'background': + background(arguments, receivedMessage) + break + case 'sponsor': + case 'mentor': + case 'judge': + checkin_prv(arguments, receivedMessage, primaryCommand) + break; } } diff --git a/revvit.js b/revvit.js index 6a385cb..709b0b8 100644 --- a/revvit.js +++ b/revvit.js @@ -1,5 +1,4 @@ function revvitCommand(arguments, receivedMessage){ - const intro = "Hi! I am the official bot for RevolutionUC 2021! \nI can assist you check in to the event, and keep track of your participation scores. Just say `!help` to list all the things that I can do! \nGood luck and have fun hacking!" receivedMessage.channel.send(intro) } From 9ad1dc0cc7e8914a64139e76f4300615cdce99ef Mon Sep 17 00:00:00 2001 From: Dev Agrawal Date: Fri, 19 Feb 2021 14:06:59 -0500 Subject: [PATCH 32/55] added minor create attendee capability --- checkin_prv.js | 14 ++++++++++---- help.js | 3 ++- index.js | 1 + 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/checkin_prv.js b/checkin_prv.js index a2ab05e..1ca9a9c 100644 --- a/checkin_prv.js +++ b/checkin_prv.js @@ -8,7 +8,7 @@ const TOP_CHANNEL_ID = process.env.TOP_CHANNEL_ID * * @param {string[]} args * @param {Discord.Message} message - * @param {'sponsor' | 'mentor' | 'judge'} primaryCommand + * @param {'sponsor' | 'mentor' | 'judge' | 'minor'} primaryCommand */ module.exports = async function (args, message, primaryCommand) { if (args.length < 2) { @@ -16,17 +16,23 @@ module.exports = async function (args, message, primaryCommand) { } else { const email = args.shift() const name = args.join(` `) - const role = primaryCommand.toUpperCase() + let role = primaryCommand.toUpperCase() + let isMinor = false + + if(primaryCommand === 'minor') { + role = `HACKER` + isMinor = true + } if (message.channel.id == TOP_CHANNEL_ID) { try { await Axios.post( `https://revolutionuc-api.herokuapp.com/api/v2/attendee`, - { email, name, role }, + { email, name, role, isMinor }, { headers: { Authorization: `Bearer ${API_TOKEN}` } } ) - message.channel.send(`Created ${role} ${name} <${email}>`) + message.channel.send(`Created ${primaryCommand} ${name} <${email}>`) } catch (err) { console.error(err) if (err.response?.status === 400) { diff --git a/help.js b/help.js index c212865..a1b753a 100644 --- a/help.js +++ b/help.js @@ -5,7 +5,7 @@ function helpCommand(args, receivedMessage) { if(args.length < 1){ isAdminChannel ? - receivedMessage.channel.send('specify what you need help for:\n `!revvit` \n `!help checkin` \n `!help codes` \n `!help sponsor` \n `!help judge` \n `!help mentor` \nor `!background` to know more about me! ') : + receivedMessage.channel.send('specify what you need help for:\n `!revvit` \n `!help checkin` \n `!help codes` \n `!help sponsor` \n `!help mentor` \n `!help judge` \n `!help minor` \nor `!background` to know more about me! ') : receivedMessage.channel.send('specify what you need help for:\n `!revvit` \n `!help checkin` \n `!help codes` \nor `!background` to know more about me! ') } else { @@ -21,6 +21,7 @@ function helpCommand(args, receivedMessage) { case 'sponsor': case 'mentor': case 'judge': + case 'minor': if(isAdminChannel) { receivedMessage.channel.send(`Use the bot command \`!${topic} \` to add an attendee to the database and allow them to check in to the discord server`) break diff --git a/index.js b/index.js index 7b86d86..820fd98 100644 --- a/index.js +++ b/index.js @@ -134,6 +134,7 @@ function processCommand(receivedMessage) { case 'sponsor': case 'mentor': case 'judge': + case 'minor': checkin_prv(arguments, receivedMessage, primaryCommand) break; } From 57e8ebb30acb9fdf55606ed72a0892a37f7ca915 Mon Sep 17 00:00:00 2001 From: Dev Agrawal Date: Tue, 28 Dec 2021 11:45:07 -0500 Subject: [PATCH 33/55] modular, added daily update --- background.js => discord/background.js | 0 checkin.js => discord/checkin.js | 0 checkin_prv.js => discord/checkin_prv.js | 0 discord/client.js | 9 ++ countdown.js => discord/countdown.js | 0 discord/daily-update.js | 37 ++++++ database.js => discord/database.js | 0 help.js => discord/help.js | 0 discord/index.js | 140 ++++++++++++++++++++++ multiply.js => discord/multiply.js | 0 react.js => discord/react.js | 0 revvit.js => discord/revvit.js | 0 score.js => discord/score.js | 0 index.js | 146 +---------------------- server/auth.js | 22 ++++ server/index.js | 22 ++++ server/routes.js | 11 ++ 17 files changed, 243 insertions(+), 144 deletions(-) rename background.js => discord/background.js (100%) rename checkin.js => discord/checkin.js (100%) rename checkin_prv.js => discord/checkin_prv.js (100%) create mode 100644 discord/client.js rename countdown.js => discord/countdown.js (100%) create mode 100644 discord/daily-update.js rename database.js => discord/database.js (100%) rename help.js => discord/help.js (100%) create mode 100644 discord/index.js rename multiply.js => discord/multiply.js (100%) rename react.js => discord/react.js (100%) rename revvit.js => discord/revvit.js (100%) rename score.js => discord/score.js (100%) create mode 100644 server/auth.js create mode 100644 server/index.js create mode 100644 server/routes.js diff --git a/background.js b/discord/background.js similarity index 100% rename from background.js rename to discord/background.js diff --git a/checkin.js b/discord/checkin.js similarity index 100% rename from checkin.js rename to discord/checkin.js diff --git a/checkin_prv.js b/discord/checkin_prv.js similarity index 100% rename from checkin_prv.js rename to discord/checkin_prv.js diff --git a/discord/client.js b/discord/client.js new file mode 100644 index 0000000..9f9520a --- /dev/null +++ b/discord/client.js @@ -0,0 +1,9 @@ +const Discord = require('discord.js') + +const DISCORD_TOKEN = process.env.DISCORD_TOKEN + +const client = new Discord.Client() + +client.login(DISCORD_TOKEN) + +module.exports = client diff --git a/countdown.js b/discord/countdown.js similarity index 100% rename from countdown.js rename to discord/countdown.js diff --git a/discord/daily-update.js b/discord/daily-update.js new file mode 100644 index 0000000..ec67e88 --- /dev/null +++ b/discord/daily-update.js @@ -0,0 +1,37 @@ +const Discord = require('discord.js') +const client = require('./client') + +const ADMIN_CHANNEL_ID = process.env.ADMIN_CHANNEL_ID + +module.exports = async (data) => { + const adminChannel = await client.channels.fetch(ADMIN_CHANNEL_ID) + + const update = new Discord.MessageEmbed() + .setTitle('Daily Regstration Update') + .setURL(`https://stats.revolutionuc.com/`) + .addFields([ + { + name: 'Total Registrants', + value: data.total.registrants, + inline: true + }, + { + name: 'Registered in last 24hrs', + value: data.last24hrs.registrants, + inline: true + }, + { + name: 'Total Confirmed', + value: data.total.confirmed, + inline: true + }, + { + name: 'Confirmed in last 24hrs', + value: data.last24hrs.confirmed, + inline: true + } + ]) + .setTimestamp() + + await adminChannel.send({ embeds: [update] }) +} \ No newline at end of file diff --git a/database.js b/discord/database.js similarity index 100% rename from database.js rename to discord/database.js diff --git a/help.js b/discord/help.js similarity index 100% rename from help.js rename to discord/help.js diff --git a/discord/index.js b/discord/index.js new file mode 100644 index 0000000..6cd60f7 --- /dev/null +++ b/discord/index.js @@ -0,0 +1,140 @@ +require('dotenv').config(); +const Discord = require('discord.js') + +const client = require('./client') +const help = require("./help") +const multiply = require("./multiply") +const react = require("./react") +const countdown = require("./countdown") +const checkin = require('./checkin') +const { score, top } = require('./score') +const revvit = require("./revvit") +const background = require("./background") +const checkin_prv = require("./checkin_prv") + +const CHECKIN_CHANNEL_ID = process.env.CHECKIN_CHANNEL_ID + +client.once('ready', () => { + console.log('the bot is online!') + client.user.setActivity('with Javascript', {type: "PLAYING"}) + + //list all servers the bot is connected to + // console.log('\nServers:') + client.guilds.cache.forEach((guild) => { + // console.log(' - '+guild.name) + + //list all channels in the server + guild.channels.cache.forEach((channel) => { + // console.log(` -- ${channel.name} (${channel.type}) - ${channel.id}`) + }) + }) + + +// //send a message to a specific channel +// var generalChannel = client.channels.cache.get('750373912738791567') +// generalChannel.send('hello world') + +// }) + +// client.on('message', (receivedMessage) => { +// //prevent bot from responding to its own message +// if(receivedMessage.author == client.user) { +// return +// } + +// //bot responds to all messages in ALL channels in the server +// receivedMessage.channel.send("Message received from " + receivedMessage.author.toString() + ": " + receivedMessage.content) + +// //bot responds to all messages in ALL channels it has been tagged in +// if(receivedMessage.content.includes(client.user.toString())) { +// receivedMessage.channel.send("Message received from " + receivedMessage.author.toString() + ": " + receivedMessage.content) +// } + +}) + +client.on('message', async (receivedMessage) => { + if(receivedMessage.author == client.user) { + return + } + + if(receivedMessage.channel.id == CHECKIN_CHANNEL_ID) { + // run the checkIn function + await checkin(receivedMessage) + return; + } +/* + if (receivedMessage.guild.id in stats === false) { + stats[receivedMessage.guild.id] = {}; + } + + const guildStats = stats[receivedMessage.guild.id] + if (receivedMessage.author.id in guildStats === false){ + guildStats[receivedMessage.author.id] = { + xp: 0, + level: 0, + lastMessage: 0 + } + } + const userStats = guildStats[receivedMessage.author.id] + ParticipationCodes.forEach((code) => { + if (receivedMessage.content == code) { + console.log(code) + userStats.xp += random.int(15,25) + } + }) + + console.log(receivedMessage.author.username + ' now has ' + userStats.xp) */ + + if(receivedMessage.content.startsWith('!')) { + processCommand(receivedMessage) + } +}) + +/** + * + * @param {Discord.Message} receivedMessage + */ +function processCommand(receivedMessage) { + const fullCommand = receivedMessage.content.substr(1) //remove the leading/bot identifying character + const splitCommand = fullCommand.split(" ") //split the message up into pieces for each space + const primaryCommand = splitCommand[0] //take the first string from the split + const arguments = splitCommand.slice(1) //all other words are arguments/parameters for the primaryCommand + + console.log('command received: ' + primaryCommand) + console.log('Arguments: ' + arguments) + + switch(primaryCommand) { + case 'help': + help(arguments, receivedMessage) + break + case 'multiply': + multiply(arguments, receivedMessage) + break + case 'react': + react(arguments, receivedMessage) + break + case 'countdown': + countdown(arguments, receivedMessage) + break + case 'claim': + score(arguments, receivedMessage) + break + case 'top': + top(arguments, receivedMessage) + break + case 'hi': + case 'revvit': + revvit(arguments, receivedMessage) + break + case 'background': + background(arguments, receivedMessage) + break + case 'sponsor': + case 'mentor': + case 'judge': + case 'minor': + checkin_prv(arguments, receivedMessage, primaryCommand) + break; + } + +} \ No newline at end of file diff --git a/multiply.js b/discord/multiply.js similarity index 100% rename from multiply.js rename to discord/multiply.js diff --git a/react.js b/discord/react.js similarity index 100% rename from react.js rename to discord/react.js diff --git a/revvit.js b/discord/revvit.js similarity index 100% rename from revvit.js rename to discord/revvit.js diff --git a/score.js b/discord/score.js similarity index 100% rename from score.js rename to discord/score.js diff --git a/index.js b/index.js index 820fd98..69676e9 100644 --- a/index.js +++ b/index.js @@ -1,144 +1,2 @@ -require('dotenv').config(); -const Discord = require('discord.js') - -const help = require("./help") -const multiply = require("./multiply") -const react = require("./react") -const countdown = require("./countdown") -const checkin = require('./checkin') -const { score, top } = require('./score') -const revvit = require("./revvit") -const background = require("./background") -const checkin_prv = require("./checkin_prv") - -const client = new Discord.Client() - -const DISCORD_TOKEN = process.env.DISCORD_TOKEN -const CHECKIN_CHANNEL_ID = process.env.CHECKIN_CHANNEL_ID - -client.once('ready', () => { - console.log('the bot is online!') - client.user.setActivity('with Javascript', {type: "PLAYING"}) - - //list all servers the bot is connected to - // console.log('\nServers:') - client.guilds.cache.forEach((guild) => { - // console.log(' - '+guild.name) - - //list all channels in the server - guild.channels.cache.forEach((channel) => { - // console.log(` -- ${channel.name} (${channel.type}) - ${channel.id}`) - }) - }) - - -// //send a message to a specific channel -// var generalChannel = client.channels.cache.get('750373912738791567') -// generalChannel.send('hello world') - -// }) - -// client.on('message', (receivedMessage) => { -// //prevent bot from responding to its own message -// if(receivedMessage.author == client.user) { -// return -// } - -// //bot responds to all messages in ALL channels in the server -// receivedMessage.channel.send("Message received from " + receivedMessage.author.toString() + ": " + receivedMessage.content) - -// //bot responds to all messages in ALL channels it has been tagged in -// if(receivedMessage.content.includes(client.user.toString())) { -// receivedMessage.channel.send("Message received from " + receivedMessage.author.toString() + ": " + receivedMessage.content) -// } - -}) - -client.on('message', async (receivedMessage) => { - if(receivedMessage.author == client.user) { - return - } - - if(receivedMessage.channel.id == CHECKIN_CHANNEL_ID) { - // run the checkIn function - await checkin(receivedMessage) - return; - } -/* - if (receivedMessage.guild.id in stats === false) { - stats[receivedMessage.guild.id] = {}; - } - - const guildStats = stats[receivedMessage.guild.id] - if (receivedMessage.author.id in guildStats === false){ - guildStats[receivedMessage.author.id] = { - xp: 0, - level: 0, - lastMessage: 0 - } - } - const userStats = guildStats[receivedMessage.author.id] - ParticipationCodes.forEach((code) => { - if (receivedMessage.content == code) { - console.log(code) - userStats.xp += random.int(15,25) - } - }) - - console.log(receivedMessage.author.username + ' now has ' + userStats.xp) */ - - if(receivedMessage.content.startsWith('!')) { - processCommand(receivedMessage) - } -}) - -/** - * - * @param {Discord.Message} receivedMessage - */ -function processCommand(receivedMessage) { - const fullCommand = receivedMessage.content.substr(1) //remove the leading/bot identifying character - const splitCommand = fullCommand.split(" ") //split the message up into pieces for each space - const primaryCommand = splitCommand[0] //take the first string from the split - const arguments = splitCommand.slice(1) //all other words are arguments/parameters for the primaryCommand - - console.log('command received: ' + primaryCommand) - console.log('Arguments: ' + arguments) - - switch(primaryCommand) { - case 'help': - help(arguments, receivedMessage) - break - case 'multiply': - multiply(arguments, receivedMessage) - break - case 'react': - react(arguments, receivedMessage) - break - case 'countdown': - countdown(arguments, receivedMessage) - break - case 'claim': - score(arguments, receivedMessage) - break - case 'top': - top(arguments, receivedMessage) - break - case 'hi': - case 'revvit': - revvit(arguments, receivedMessage) - break - case 'background': - background(arguments, receivedMessage) - break - case 'sponsor': - case 'mentor': - case 'judge': - case 'minor': - checkin_prv(arguments, receivedMessage, primaryCommand) - break; - } - -} - -client.login(DISCORD_TOKEN) \ No newline at end of file +require('./discord') +require('./server') diff --git a/server/auth.js b/server/auth.js new file mode 100644 index 0000000..29509ae --- /dev/null +++ b/server/auth.js @@ -0,0 +1,22 @@ +const express = require('express') +const SERVER_KEY = process.env.SERVER_KEY + +/** + * + * @param {express.Request} req + * @param {express.Response} res + * @param {express.NextFunction} next + */ +const auth = (req, res, next) => { + try { + const token = req.headers.authorization.split(' ')[1] + if (token !== SERVER_KEY) { + throw 401; + } + next() + } catch (err) { + res.sendStatus(401); + } +} + +module.exports = auth diff --git a/server/index.js b/server/index.js new file mode 100644 index 0000000..e5a6d2a --- /dev/null +++ b/server/index.js @@ -0,0 +1,22 @@ +const express = require('express') +const cors = require('cors') +const auth = require('./auth') +const router = require('./routes') + +const PORT = process.env.PORT + +const app = express() + +app.use(express.json()) +app.use(cors({ origin: `*` })) + +app.get(`/ping`, async (req, res, next) => { + res.send(`pong`) +}) + +app.use(auth) +app.use(router) + +app.listen(PORT, () => { + console.log(`HTTP server running on port ${PORT}`) +}) diff --git a/server/routes.js b/server/routes.js new file mode 100644 index 0000000..caa6e49 --- /dev/null +++ b/server/routes.js @@ -0,0 +1,11 @@ +const express = require('express') +const sendUpdate = require('../discord/daily-update') + +const router = express.Router() + +router.post(`/dailyUpdate`, async (req) => { + const data = req.body + await sendUpdate(data) +}) + +module.exports = router From 3f6797fd2146af3c117099e18746e610bc298ca9 Mon Sep 17 00:00:00 2001 From: Dev Agrawal Date: Tue, 28 Dec 2021 14:21:09 -0500 Subject: [PATCH 34/55] moved database into folder --- discord/database.js => database/index.js | 0 discord/index.js | 1 - discord/score.js | 2 +- index.js | 1 + package-lock.json | 404 ++++++++++++++++++++++- package.json | 4 +- server/index.js | 2 +- 7 files changed, 407 insertions(+), 7 deletions(-) rename discord/database.js => database/index.js (100%) diff --git a/discord/database.js b/database/index.js similarity index 100% rename from discord/database.js rename to database/index.js diff --git a/discord/index.js b/discord/index.js index 6cd60f7..f155c32 100644 --- a/discord/index.js +++ b/discord/index.js @@ -1,4 +1,3 @@ -require('dotenv').config(); const Discord = require('discord.js') const client = require('./client') diff --git a/discord/score.js b/discord/score.js index e326ae6..7c31387 100644 --- a/discord/score.js +++ b/discord/score.js @@ -1,5 +1,5 @@ const Discord = require('discord.js') -const { User, Event, Claim } = require('./database') +const { User, Event, Claim } = require('../database') const CLAIM_CHANNEL_ID = process.env.CLAIM_CHANNEL_ID const TOP_CHANNEL_ID = process.env.TOP_CHANNEL_ID diff --git a/index.js b/index.js index 69676e9..46b62e7 100644 --- a/index.js +++ b/index.js @@ -1,2 +1,3 @@ +require('dotenv').config(); require('./discord') require('./server') diff --git a/package-lock.json b/package-lock.json index 626c483..2126a74 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "discordbot", - "version": "1.0.0", + "version": "2.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -92,6 +92,15 @@ "event-target-shim": "^5.0.0" } }, + "accepts": { + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", + "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", + "requires": { + "mime-types": "~2.1.24", + "negotiator": "0.6.2" + } + }, "ansi-align": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.0.tgz", @@ -144,6 +153,11 @@ "picomatch": "^2.0.4" } }, + "array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" + }, "asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", @@ -178,6 +192,38 @@ "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", "dev": true }, + "body-parser": { + "version": "1.19.1", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.1.tgz", + "integrity": "sha512-8ljfQi5eBk8EJfECMrgqNGWPEY5jWP+1IzkzkGdFFEwFQZZyaZ21UqdaHktgiMlH0xLHqIFtE/u2OYE5dOtViA==", + "requires": { + "bytes": "3.1.1", + "content-type": "~1.0.4", + "debug": "2.6.9", + "depd": "~1.1.2", + "http-errors": "1.8.1", + "iconv-lite": "0.4.24", + "on-finished": "~2.3.0", + "qs": "6.9.6", + "raw-body": "2.4.2", + "type-is": "~1.6.18" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + } + } + }, "boxen": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/boxen/-/boxen-4.2.0.tgz", @@ -218,6 +264,11 @@ "resolved": "https://registry.npmjs.org/buffer-writer/-/buffer-writer-2.0.0.tgz", "integrity": "sha512-a7ZpuTZU1TRtnwyCNW3I5dc0wWNC3VR9S++Ewyk2HHZdrO3CQJqSpd+95Us590V6AL7JqUAH2IwZ/398PmNFgw==" }, + "bytes": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.1.tgz", + "integrity": "sha512-dWe4nWO/ruEOY7HkUJ5gFt1DCFV9zPRoJr8pV0/ASQermOZjtq8jMjOprC0Kd10GLN+l7xaUPvxzJFWtxGu8Fg==" + }, "cacheable-request": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-6.1.0.tgz", @@ -363,11 +414,43 @@ "xdg-basedir": "^4.0.0" } }, + "content-disposition": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", + "requires": { + "safe-buffer": "5.2.1" + } + }, + "content-type": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", + "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==" + }, + "cookie": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.1.tgz", + "integrity": "sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA==" + }, + "cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" + }, "core-js": { "version": "2.6.12", "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz", "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==" }, + "cors": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "requires": { + "object-assign": "^4", + "vary": "^1" + } + }, "crypto-random-string": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-2.0.0.tgz", @@ -409,6 +492,16 @@ "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" }, + "depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" + }, + "destroy": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", + "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" + }, "discord.js": { "version": "12.3.1", "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-12.3.1.tgz", @@ -449,6 +542,11 @@ "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=", "dev": true }, + "ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" + }, "email-validator": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/email-validator/-/email-validator-2.0.4.tgz", @@ -460,6 +558,11 @@ "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", "dev": true }, + "encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=" + }, "end-of-stream": { "version": "1.4.4", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", @@ -475,11 +578,73 @@ "integrity": "sha512-8/uIhbG12Csjy2JEW7D9pHbreaVaS/OpN3ycnyvElTdwM5n6GY6W6e2IPemfvGZeUMqZ9A/3GqIZMgKnBhAw/Q==", "dev": true }, + "escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" + }, + "etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" + }, "event-target-shim": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==" }, + "express": { + "version": "4.17.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.17.2.tgz", + "integrity": "sha512-oxlxJxcQlYwqPWKVJJtvQiwHgosH/LrLSPA+H4UxpyvSS6jC5aH+5MoHFM+KABgTOt0APue4w66Ha8jCUo9QGg==", + "requires": { + "accepts": "~1.3.7", + "array-flatten": "1.1.1", + "body-parser": "1.19.1", + "content-disposition": "0.5.4", + "content-type": "~1.0.4", + "cookie": "0.4.1", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "~1.1.2", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "~1.1.2", + "fresh": "0.5.2", + "merge-descriptors": "1.0.1", + "methods": "~1.1.2", + "on-finished": "~2.3.0", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.7", + "proxy-addr": "~2.0.7", + "qs": "6.9.6", + "range-parser": "~1.2.1", + "safe-buffer": "5.2.1", + "send": "0.17.2", + "serve-static": "1.14.2", + "setprototypeof": "1.2.0", + "statuses": "~1.5.0", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + } + } + }, "fill-range": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", @@ -489,11 +654,50 @@ "to-regex-range": "^5.0.1" } }, + "finalhandler": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", + "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", + "requires": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "~2.3.0", + "parseurl": "~1.3.3", + "statuses": "~1.5.0", + "unpipe": "~1.0.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + } + } + }, "follow-redirects": { "version": "1.13.1", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.1.tgz", "integrity": "sha512-SSG5xmZh1mkPGyKzjZP8zLjltIfpW32Y5QpdNJyjcfGxK3qo3NDDkZOZSFiGn1A6SclQxY9GzEwAHQ3dmYRWpg==" }, + "forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==" + }, + "fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" + }, "fsevents": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", @@ -571,6 +775,26 @@ "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==", "dev": true }, + "http-errors": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz", + "integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==", + "requires": { + "depd": "~1.1.2", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": ">= 1.5.0 < 2", + "toidentifier": "1.0.1" + } + }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, "ignore-by-default": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", @@ -605,6 +829,11 @@ "integrity": "sha512-iKpRpXP+CrP2jyrxvg1kMUpXDyRUFDWurxbnVT1vQPx+Wz9uCYsMIqYuSBLV+PAaZG/d7kRLKRFc9oDMsH+mFQ==", "dev": true }, + "ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==" + }, "is-binary-path": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", @@ -750,6 +979,26 @@ } } }, + "media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" + }, + "merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" + }, + "methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" + }, + "mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" + }, "mime-db": { "version": "1.45.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.45.0.tgz", @@ -800,8 +1049,12 @@ "ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "negotiator": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", + "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==" }, "node-fetch": { "version": "2.6.1", @@ -847,6 +1100,19 @@ "integrity": "sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ==", "dev": true }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" + }, + "on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "requires": { + "ee-first": "1.1.1" + } + }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -897,6 +1163,16 @@ "resolved": "https://registry.npmjs.org/packet-reader/-/packet-reader-1.0.0.tgz", "integrity": "sha512-HAKu/fG3HpHFO0AA8WE8q2g+gBJaZ9MG7fcKk+IJPLTGAD6Psw4443l+9DGRbOIh3/aXr7Phy0TjilYivJo5XQ==" }, + "parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" + }, + "path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" + }, "pg": { "version": "8.5.1", "resolved": "https://registry.npmjs.org/pg/-/pg-8.5.1.tgz", @@ -999,6 +1275,15 @@ "resolved": "https://registry.npmjs.org/prism-media/-/prism-media-1.2.3.tgz", "integrity": "sha512-fSrR66n0l6roW9Rx4rSLMyTPTjRTiXy5RVqDOurACQ6si1rKHHKDU5gwBJoCsIV0R3o9gi+K50akl/qyw1C74A==" }, + "proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "requires": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + } + }, "pstree.remy": { "version": "1.1.8", "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", @@ -1024,6 +1309,11 @@ "escape-goat": "^2.0.0" } }, + "qs": { + "version": "6.9.6", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.6.tgz", + "integrity": "sha512-TIRk4aqYLNoJUbd+g2lEdz5kLWIuTMRagAXxl78Q0RiVjAOugHmeKNGdd3cwo/ktpf9aL9epCfFqWDEKysUlLQ==" + }, "random": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/random/-/random-2.2.0.tgz", @@ -1035,6 +1325,22 @@ "seedrandom": "^3.0.5" } }, + "range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==" + }, + "raw-body": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.2.tgz", + "integrity": "sha512-RPMAFUJP19WIet/99ngh6Iv8fzAbqum4Li7AD6DtGaW2RpMB/11xDoalPiJMTbu6I3hkbMVkATvZrqb9EEqeeQ==", + "requires": { + "bytes": "3.1.1", + "http-errors": "1.8.1", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + } + }, "rc": { "version": "1.2.8", "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", @@ -1111,6 +1417,11 @@ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, "seedrandom": { "version": "3.0.5", "resolved": "https://registry.npmjs.org/seedrandom/-/seedrandom-3.0.5.tgz", @@ -1139,6 +1450,43 @@ } } }, + "send": { + "version": "0.17.2", + "resolved": "https://registry.npmjs.org/send/-/send-0.17.2.tgz", + "integrity": "sha512-UJYB6wFSJE3G00nEivR5rgWp8c2xXvJ3OPWPhmuteU0IKj8nKbG3DrjiOmLwpnHGYWAVwA69zmTm++YG0Hmwww==", + "requires": { + "debug": "2.6.9", + "depd": "~1.1.2", + "destroy": "~1.0.4", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "1.8.1", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "~2.3.0", + "range-parser": "~1.2.1", + "statuses": "~1.5.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + }, + "dependencies": { + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + } + } + } + } + }, "sequelize": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/sequelize/-/sequelize-6.5.0.tgz", @@ -1187,11 +1535,27 @@ "resolved": "https://registry.npmjs.org/sequelize-pool/-/sequelize-pool-6.1.0.tgz", "integrity": "sha512-4YwEw3ZgK/tY/so+GfnSgXkdwIJJ1I32uZJztIEgZeAO6HMgj64OzySbWLgxj+tXhZCJnzRfkY9gINw8Ft8ZMg==" }, + "serve-static": { + "version": "1.14.2", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.2.tgz", + "integrity": "sha512-+TMNA9AFxUEGuC0z2mevogSnn9MXKb4fa7ngeRMJaaGv8vTwnIEkKi+QGvPt33HSnf8pRS+WGM0EbMtCJLKMBQ==", + "requires": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.17.2" + } + }, "setimmediate": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=" }, + "setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" + }, "signal-exit": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", @@ -1206,6 +1570,11 @@ "readable-stream": "^3.0.0" } }, + "statuses": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=" + }, "string-width": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", @@ -1299,6 +1668,11 @@ "is-number": "^7.0.0" } }, + "toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==" + }, "toposort-class": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/toposort-class/-/toposort-class-1.0.1.tgz", @@ -1324,6 +1698,15 @@ "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", "dev": true }, + "type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "requires": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + } + }, "typedarray-to-buffer": { "version": "3.1.5", "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", @@ -1373,6 +1756,11 @@ "crypto-random-string": "^2.0.0" } }, + "unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" + }, "update-notifier": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-4.1.3.tgz", @@ -1408,6 +1796,11 @@ "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" }, + "utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" + }, "uuid": { "version": "8.3.2", "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", @@ -1418,6 +1811,11 @@ "resolved": "https://registry.npmjs.org/validator/-/validator-10.11.0.tgz", "integrity": "sha512-X/p3UZerAIsbBfN/IwahhYaBbY68EN/UQBWHtsbXGT5bfrH/p4NQzUCG1kF/rtKaNpnJ7jAu6NGTdSNtyNIXMw==" }, + "vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" + }, "widest-line": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz", diff --git a/package.json b/package.json index 7051352..8a34d5c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "discordbot", - "version": "1.0.0", + "version": "2.0.0", "description": "its a discord bot eh", "main": "index.js", "scripts": { @@ -20,9 +20,11 @@ "homepage": "https://github.com/sahupr/cathacks#readme", "dependencies": { "axios": "^0.21.1", + "cors": "^2.8.5", "discord.js": "^12.3.1", "dotenv": "^8.2.0", "email-validator": "^2.0.4", + "express": "^4.17.2", "pg": "^8.5.1", "pg-hstore": "^2.3.3", "random": "^2.2.0", diff --git a/server/index.js b/server/index.js index e5a6d2a..c4f7dfb 100644 --- a/server/index.js +++ b/server/index.js @@ -10,7 +10,7 @@ const app = express() app.use(express.json()) app.use(cors({ origin: `*` })) -app.get(`/ping`, async (req, res, next) => { +app.get(`/ping`, async (_req, res) => { res.send(`pong`) }) From e4c1fc615244c6f2def2bc6d1aa79f5dc8836d22 Mon Sep 17 00:00:00 2001 From: Dev Agrawal Date: Tue, 28 Dec 2021 15:33:15 -0500 Subject: [PATCH 35/55] fixed embed send --- discord/daily-update.js | 7 ++----- server/index.js | 2 +- server/routes.js | 12 +++++++++--- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/discord/daily-update.js b/discord/daily-update.js index ec67e88..f3491c9 100644 --- a/discord/daily-update.js +++ b/discord/daily-update.js @@ -1,4 +1,5 @@ const Discord = require('discord.js') +const { TextChannel } = require('discord.js') const client = require('./client') const ADMIN_CHANNEL_ID = process.env.ADMIN_CHANNEL_ID @@ -13,25 +14,21 @@ module.exports = async (data) => { { name: 'Total Registrants', value: data.total.registrants, - inline: true }, { name: 'Registered in last 24hrs', value: data.last24hrs.registrants, - inline: true }, { name: 'Total Confirmed', value: data.total.confirmed, - inline: true }, { name: 'Confirmed in last 24hrs', value: data.last24hrs.confirmed, - inline: true } ]) .setTimestamp() - await adminChannel.send({ embeds: [update] }) + await adminChannel.send(update) } \ No newline at end of file diff --git a/server/index.js b/server/index.js index c4f7dfb..8e281c3 100644 --- a/server/index.js +++ b/server/index.js @@ -14,7 +14,7 @@ app.get(`/ping`, async (_req, res) => { res.send(`pong`) }) -app.use(auth) +// app.use(auth) app.use(router) app.listen(PORT, () => { diff --git a/server/routes.js b/server/routes.js index caa6e49..5d89bb0 100644 --- a/server/routes.js +++ b/server/routes.js @@ -3,9 +3,15 @@ const sendUpdate = require('../discord/daily-update') const router = express.Router() -router.post(`/dailyUpdate`, async (req) => { - const data = req.body - await sendUpdate(data) +router.post(`/dailyUpdate`, async (req, res) => { + try { + const data = req.body + await sendUpdate(data) + res.send(`Daily update sent to discord!`) + } catch(err) { + console.error(err) + res.status(500).send(`Error sending daily update to discord`) + } }) module.exports = router From cc711cbd92922a82a1e82ffcb59dad88602b8f14 Mon Sep 17 00:00:00 2001 From: Dev Agrawal Date: Tue, 28 Dec 2021 16:07:11 -0500 Subject: [PATCH 36/55] rich presence --- discord/index.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/discord/index.js b/discord/index.js index f155c32..d738bd6 100644 --- a/discord/index.js +++ b/discord/index.js @@ -15,7 +15,13 @@ const CHECKIN_CHANNEL_ID = process.env.CHECKIN_CHANNEL_ID client.once('ready', () => { console.log('the bot is online!') - client.user.setActivity('with Javascript', {type: "PLAYING"}) + client.user.setPresence({ + status: 'online', + activity: { + name: `NodeJS and Postgres`, + type: 'PLAYING' + } + }) //list all servers the bot is connected to // console.log('\nServers:') From 77fc88a60734de6f199a05c21b1712347d0b0cce Mon Sep 17 00:00:00 2001 From: Dev Agrawal Date: Sun, 30 Jan 2022 01:47:39 -0500 Subject: [PATCH 37/55] creating participant entry at checkin, prettier --- database/index.js | 43 ++++++----- discord/checkin.js | 184 ++++++++++++++++++++++++++------------------- discord/score.js | 183 +++++++++++++++++++++++++------------------- 3 files changed, 239 insertions(+), 171 deletions(-) diff --git a/database/index.js b/database/index.js index 304ab6e..fed3a39 100644 --- a/database/index.js +++ b/database/index.js @@ -1,9 +1,12 @@ -const { Sequelize, DataTypes } = require(`sequelize`) +const { Sequelize } = require(`sequelize`); -const sequelize = new Sequelize(process.env.DATABASE_URL, { dialect: 'postgres', dialectOptions: { ssl: { require: true, rejectUnauthorized: false } } }) -exports.sequelize = sequelize +const sequelize = new Sequelize(process.env.DATABASE_URL, { + dialect: "postgres", + dialectOptions: { ssl: { require: true, rejectUnauthorized: false } }, +}); +exports.sequelize = sequelize; -exports.User = sequelize.define(`discord-user`, { +exports.User = sequelize.define(`participants`, { userID: { type: DataTypes.STRING, unique: true, @@ -12,39 +15,43 @@ exports.User = sequelize.define(`discord-user`, { }, username: { type: DataTypes.STRING, - allowNull: false + allowNull: false, + }, + email: { + type: DataTypes.STRING, + allowNull: false, }, score: { type: DataTypes.INTEGER, allowNull: false, - defaultValue: 0 - } -}) + defaultValue: 0, + }, +}); exports.Event = sequelize.define(`event`, { code: { type: DataTypes.STRING, allowNull: false, unique: true, - primaryKey: true + primaryKey: true, }, name: { type: DataTypes.STRING, - allowNull: false + allowNull: false, }, points: { type: DataTypes.INTEGER, - allowNull: false - } -}) + allowNull: false, + }, +}); -exports.Claim = sequelize.define('claim', { +exports.Claim = sequelize.define("claim", { userID: { type: DataTypes.STRING, - allowNull: false + allowNull: false, }, eventCode: { type: DataTypes.STRING, - allowNull: false - } -}) \ No newline at end of file + allowNull: false, + }, +}); diff --git a/discord/checkin.js b/discord/checkin.js index 3bcca1f..969e62b 100644 --- a/discord/checkin.js +++ b/discord/checkin.js @@ -1,91 +1,101 @@ -const Discord = require('discord.js') -const emailValidator = require('email-validator') -const Axios = require('axios').default - -const API_TOKEN = process.env.API_TOKEN -const HACKER_ROLE = process.env.HACKER_ROLE -const JUDGE_ROLE = process.env.JUDGE_ROLE -const MENTOR_ROLE = process.env.MENTOR_ROLE -const SPONSOR_ROLE = process.env.SPONSOR_ROLE -const CHECKIN_CHANNEL_ID = process.env.CHECKIN_CHANNEL_ID -const MINOR_ROLE = process.env.MINOR_ROLE +const Discord = require("discord.js"); +const emailValidator = require("email-validator"); +const Axios = require("axios").default; +const { User } = require("../database"); + +const API_TOKEN = process.env.API_TOKEN; +const HACKER_ROLE = process.env.HACKER_ROLE; +const JUDGE_ROLE = process.env.JUDGE_ROLE; +const MENTOR_ROLE = process.env.MENTOR_ROLE; +const SPONSOR_ROLE = process.env.SPONSOR_ROLE; +const CHECKIN_CHANNEL_ID = process.env.CHECKIN_CHANNEL_ID; +const MINOR_ROLE = process.env.MINOR_ROLE; /** - * + * * @param {string} email */ -const censorEmail = email => { - const ptEmail = email - let letter = '' - let stars = '' - let i=0 - while(letter != '@' && i < email.length){ - letter = ptEmail[i] - i += 1 - stars += '*' +const censorEmail = (email) => { + const ptEmail = email; + let letter = ""; + let stars = ""; + let i = 0; + while (letter != "@" && i < email.length) { + letter = ptEmail[i]; + i += 1; + stars += "*"; } - let censor = ptEmail.slice(1,i-2) - stars = stars.substr(1,i-3) - return ptEmail.replace(censor, stars) -} + let censor = ptEmail.slice(1, i - 2); + stars = stars.substr(1, i - 3); + return ptEmail.replace(censor, stars); +}; -const getRandomInt = max => { +const getRandomInt = (max) => { return Math.floor(Math.random() * Math.floor(max)); -} +}; /** - * - * @param {Discord.Message} message + * + * @param {Discord.Message} message */ const responses_success = [ - 'is checked in!', - ', welcome to the main event!', - 'is here!', - 'welcome onboard!', - 'has arrived!' -] + "is checked in!", + ", welcome to the main event!", + "is here!", + "welcome onboard!", + "has arrived!", +]; const responses_404 = [ - 'does not exist', - 'cannot be found', - ', are you using the right email?' -] + "does not exist", + "cannot be found", + ", are you using the right email?", +]; const responses_403 = [ "you're already checked in.", - 'already exists, is this a clone?', + "already exists, is this a clone?", "you've already signed up!", -] +]; -module.exports = async function(message) { +module.exports = async function (message) { const email = message.toString(); - const max_success = responses_success.length - const max_404 = responses_404.length - const max_403 = responses_403.length + const max_success = responses_success.length; + const max_404 = responses_404.length; + const max_403 = responses_403.length; - if(emailValidator.validate(email) && message.channel.id == CHECKIN_CHANNEL_ID) { - // send a request to revuc api to check in the email + const censoredEmail = censorEmail(email); + + if ( + emailValidator.validate(email) && + message.channel.id == CHECKIN_CHANNEL_ID + ) { try { - const res = await Axios.post(`https://revolutionuc-api.herokuapp.com/api/v2/attendee/checkin`, { email }, { - headers: { - Authorization: `Bearer ${API_TOKEN}` + // send a request to revuc api to check in the email + const res = await Axios.post( + `https://revolutionuc-api.herokuapp.com/api/v2/attendee/checkin`, + { email }, + { + headers: { + Authorization: `Bearer ${API_TOKEN}`, + }, } - }) + ); - const { name, role, isMinor } = res.data + const { name, role, isMinor } = res.data; let roleToBeAdded; - switch(role) { + switch (role) { case `HACKER`: roleToBeAdded = HACKER_ROLE; break; case `JUDGE`: roleToBeAdded = JUDGE_ROLE; break; - case `SPONSOR`: + case `SPONSOR`: roleToBeAdded = SPONSOR_ROLE; break; case `MENTOR`: @@ -96,37 +106,59 @@ module.exports = async function(message) { } // check in succeeded - const user = message.author.id - + const user = message.author.id; + // grant the hacker role - const member = message.guild.members.cache.find(member => member.id === user) - const Role = message.guild.roles.cache.find(role => role.id === roleToBeAdded) - member.roles.add(Role) + const member = message.guild.members.cache.find( + (member) => member.id === user + ); + const Role = message.guild.roles.cache.find( + (role) => role.id === roleToBeAdded + ); + member.roles.add(Role); if (isMinor == true) { - const minorRole = message.guild.roles.cache.find(role => role.id == MINOR_ROLE) - member.roles.add(minorRole) + const minorRole = message.guild.roles.cache.find( + (role) => role.id == MINOR_ROLE + ); + member.roles.add(minorRole); } - - const censoredEmail = censorEmail(email); - message.channel.send(`${name} <${censoredEmail}> ${responses_success[getRandomInt(max_success)]}`) + if (role === `HACKER`) { + await User.create({ + userID: message.author.id, + username: message.author.username, + email + }); + } + + message.channel.send( + `${name} <${censoredEmail}> ${ + responses_success[getRandomInt(max_success)] + }` + ); } catch (err) { - console.error(err) - if(err.response?.status === 404) { - message.channel.send(`${censorEmail(email)} ${responses_404[getRandomInt(max_404)]}, please make sure you are registered with us or contact an organizer`) + console.error(err); + if (err.response?.status === 404) { + message.channel.send( + `${censoredEmail} ${ + responses_404[getRandomInt(max_404)] + }, please make sure you are registered with us or contact an organizer` + ); } else if (err.response?.status === 403) { - message.channel.send(`${censorEmail(email)} ${responses_403[getRandomInt(max_403)]}`) - } - else { - message.channel.send(`Error checking in ${censorEmail(email)}, please try again later or contact an organizer`) + message.channel.send( + `${censoredEmail} ${responses_403[getRandomInt(max_403)]}` + ); + } else { + message.channel.send( + `Error checking in ${censoredEmail}, please try again later or contact an organizer` + ); } } - message.delete({ timeout: 2000 }) + message.delete({ timeout: 2000 }); } else { - const censored = censorEmail(email); - message.channel.send(`${censored} is not a valid email`) - message.delete({timeout: 3000}) + message.channel.send(`${censoredEmail} is not a valid email`); + message.delete({ timeout: 3000 }); } -} \ No newline at end of file +}; diff --git a/discord/score.js b/discord/score.js index 7c31387..339628f 100644 --- a/discord/score.js +++ b/discord/score.js @@ -1,116 +1,145 @@ -const Discord = require('discord.js') -const { User, Event, Claim } = require('../database') +const Discord = require("discord.js"); +const { User, Event, Claim } = require("../database"); -const CLAIM_CHANNEL_ID = process.env.CLAIM_CHANNEL_ID -const TOP_CHANNEL_ID = process.env.TOP_CHANNEL_ID +const CLAIM_CHANNEL_ID = process.env.CLAIM_CHANNEL_ID; +const TOP_CHANNEL_ID = process.env.TOP_CHANNEL_ID; -/** - * - * @param {string[]} args - * @param {Discord.Message} receivedMessage - */ +const RESPONSE = { + SUCCESS: 1, + WRONG: 2, + CLAIMED: 3, +}; -function generateResponse(name, event, score, r_id) { - - const getRandomInt = max => { - return Math.floor(Math.random() * Math.floor(max)); - } +const getRandomInt = (max) => Math.floor(Math.random() * Math.floor(max)); +function generateResponse(name, event, score, responseType) { const claim_success = [ `Good job attending ${event?.name}, you now have ${score} points. Now go attend another one.`, - `Ayy nice job ${name}. Hope you enjoyed ${event?.name}! You now have ${score} points.` - ] - - const code_wrong = [ //Doesn't take points for now + `Ayy nice job ${name}. Hope you enjoyed ${event?.name}! You now have ${score} points.`, + ]; + + const code_wrong = [ + //Doesn't take points for now `Stop cheating ${name}!`, `Nice try!`, `I’m sorry ${name}, but we never gave you that code. Please try a code that works.`, - `${name} Did you just make that up? Because I sure don’t know this code.` - ] - - const code_claimed = [ //Doesn't take points for now + `${name} Did you just make that up? Because I sure don’t know this code.`, + ]; + + const code_claimed = [ + //Doesn't take points for now `Oops, sorry that code has already been claimed`, `You’ve already attended ${event?.name}, good job!`, - `Unless you invented time travel, you can’t attend ${event?.name} twice` - ] + `Unless you invented time travel, you can’t attend ${event?.name} twice`, + ]; - if(r_id == 1){ - return claim_success[getRandomInt(claim_success.length)] + if (responseType === RESPONSE.SUCCESS) { + return claim_success[getRandomInt(claim_success.length)]; } - if(r_id == 2){ - return code_wrong[getRandomInt(code_wrong.length)] + if (responseType === RESPONSE.WRONG) { + return code_wrong[getRandomInt(code_wrong.length)]; } - if(r_id == 3){ - return code_claimed[getRandomInt(code_claimed.length)] + if (responseType === RESPONSE.CLAIMED) { + return code_claimed[getRandomInt(code_claimed.length)]; } } +/** + * + * @param {string[]} args + * @param {Discord.Message} receivedMessage + */ async function score(args, receivedMessage) { - if(receivedMessage.channel.id != CLAIM_CHANNEL_ID) { - console.log('wrong channel') - return + if (receivedMessage.channel.id != CLAIM_CHANNEL_ID) { + console.log("wrong channel"); + return; } try { - let user = await User.findByPk(receivedMessage.author.id) + let user = await User.findByPk(receivedMessage.author.id); if (!user) { - user = await User.create({ userID: receivedMessage.author.id, username: receivedMessage.author.username }) - } - - const code = args[0] - - const event = await Event.findByPk(code) - - if(event) { - const claim = await Claim.findOne({ where: { userID: receivedMessage.author.id, eventCode: code } }) - - if (claim) { - const claimedResponse = generateResponse(receivedMessage.author.username, event, null, 3) - receivedMessage.channel.send(claimedResponse) - } - else { - const currentScore = user.score - const newScore = currentScore + event.points - user.set(`score`, newScore) - await user.save() - await Claim.create({ userID: receivedMessage.author.id, eventCode: code }) - const successResponse = generateResponse(receivedMessage.author.username, event, newScore, 1) - receivedMessage.channel.send(successResponse) - // receivedMessage.channel.send(`Hey ${receivedMessage.author.username}, thank you for attending ${event.name}, you now have ${newScore} points`) //correct code + receivedMessage.channel.send( + `Hey ${receivedMessage.author.username}, you are not checked in to RevUC, so either you hacked into the server, in which case you will be banned shortly, or you are an organizer, in which case, stop smurfing!` + ); + } else { + const code = args[0]; + + const event = await Event.findByPk(code); + + if (event) { + const claim = await Claim.findOne({ + where: { userID: receivedMessage.author.id, eventCode: code }, + }); + + if (claim) { + const claimedResponse = generateResponse( + receivedMessage.author.username, + event, + null, + RESPONSE.CLAIMED + ); + receivedMessage.channel.send(claimedResponse); + } else { + const currentScore = user.score; + const newScore = currentScore + event.points; + user.set(`score`, newScore); + await user.save(); + await Claim.create({ + userID: receivedMessage.author.id, + eventCode: code, + }); + const successResponse = generateResponse( + receivedMessage.author.username, + event, + newScore, + RESPONSE.SUCCESS + ); + receivedMessage.channel.send(successResponse); + } + } else { + const wrongResponse = generateResponse( + receivedMessage.author.username, + null, + null, + RESPONSE.WRONG + ); + receivedMessage.channel.send(wrongResponse); } - } - else { - const wrongResponse = generateResponse(receivedMessage.author.username, null, null, 2) - receivedMessage.channel.send(wrongResponse) - // receivedMessage.channel.send('Nice try') //wrong code } - } catch(err) { + } catch (err) { console.error(err); - receivedMessage.channel.send(`Hey ${receivedMessage.author.username}, there was an error while trying to grant you score, please contact an organizer!`) //invalid code + receivedMessage.channel.send( + `Hey ${receivedMessage.author.username}, there was an error while trying to grant you score, please contact an organizer!` + ); } finally { - receivedMessage.delete() + receivedMessage.delete(); } } /** - * - * @param {string[]} args - * @param {Discord.Message} receivedMessage + * + * @param {string[]} args + * @param {Discord.Message} receivedMessage */ async function top(args, receivedMessage) { - if(receivedMessage.channel.id != TOP_CHANNEL_ID) { - return + if (receivedMessage.channel.id != TOP_CHANNEL_ID) { + return; } - const users = await User.findAll({ order: [['score', 'DESC']], limit: parseInt(args[0]) }) - let list = `\`\`\`\n` + const users = await User.findAll({ + order: [["score", "DESC"]], + limit: parseInt(args[0]), + }); + let list = `\`\`\`\n`; - users.forEach((user, i) => list += `${i + 1} @${user.username} - score: ${user.score}\n`) + users.forEach( + (user, i) => (list += `${i + 1} @${user.username} - score: ${user.score}\n`) + ); - list += `\`\`\`` - receivedMessage.channel.send(list) + list += `\`\`\``; + receivedMessage.channel.send(list); } -exports.score = score -exports.top = top \ No newline at end of file +exports.score = score; +exports.top = top; From 82bf041bc2e11f18886e5530d4107e8c5ab740b5 Mon Sep 17 00:00:00 2001 From: Dev Agrawal Date: Mon, 7 Feb 2022 00:59:24 -0500 Subject: [PATCH 38/55] added lattice command --- discord/checkin.js | 9 +- discord/index.js | 239 ++--- discord/lattice.js | 45 + package-lock.json | 2516 +++++++++++++++++++++++++++++++++++++++++++- 4 files changed, 2673 insertions(+), 136 deletions(-) create mode 100644 discord/lattice.js diff --git a/discord/checkin.js b/discord/checkin.js index 969e62b..58c1c51 100644 --- a/discord/checkin.js +++ b/discord/checkin.js @@ -34,11 +34,6 @@ const getRandomInt = (max) => { return Math.floor(Math.random() * Math.floor(max)); }; -/** - * - * @param {Discord.Message} message - */ - const responses_success = [ "is checked in!", ", welcome to the main event!", @@ -59,6 +54,10 @@ const responses_403 = [ "you've already signed up!", ]; +/** + * + * @param {Discord.Message} message + */ module.exports = async function (message) { const email = message.toString(); diff --git a/discord/index.js b/discord/index.js index d738bd6..1f8078b 100644 --- a/discord/index.js +++ b/discord/index.js @@ -1,73 +1,72 @@ -const Discord = require('discord.js') - -const client = require('./client') -const help = require("./help") -const multiply = require("./multiply") -const react = require("./react") -const countdown = require("./countdown") -const checkin = require('./checkin') -const { score, top } = require('./score') -const revvit = require("./revvit") -const background = require("./background") -const checkin_prv = require("./checkin_prv") - -const CHECKIN_CHANNEL_ID = process.env.CHECKIN_CHANNEL_ID - -client.once('ready', () => { - console.log('the bot is online!') - client.user.setPresence({ - status: 'online', - activity: { - name: `NodeJS and Postgres`, - type: 'PLAYING' - } - }) - - //list all servers the bot is connected to - // console.log('\nServers:') - client.guilds.cache.forEach((guild) => { - // console.log(' - '+guild.name) - - //list all channels in the server - guild.channels.cache.forEach((channel) => { - // console.log(` -- ${channel.name} (${channel.type}) - ${channel.id}`) - }) - }) - - -// //send a message to a specific channel -// var generalChannel = client.channels.cache.get('750373912738791567') -// generalChannel.send('hello world') - -// }) - -// client.on('message', (receivedMessage) => { -// //prevent bot from responding to its own message -// if(receivedMessage.author == client.user) { -// return -// } - -// //bot responds to all messages in ALL channels in the server -// receivedMessage.channel.send("Message received from " + receivedMessage.author.toString() + ": " + receivedMessage.content) - -// //bot responds to all messages in ALL channels it has been tagged in -// if(receivedMessage.content.includes(client.user.toString())) { -// receivedMessage.channel.send("Message received from " + receivedMessage.author.toString() + ": " + receivedMessage.content) -// } - -}) - -client.on('message', async (receivedMessage) => { - if(receivedMessage.author == client.user) { - return - } - - if(receivedMessage.channel.id == CHECKIN_CHANNEL_ID) { - // run the checkIn function - await checkin(receivedMessage) - return; - } -/* +const Discord = require("discord.js"); + +const client = require("./client"); +const help = require("./help"); +const multiply = require("./multiply"); +const react = require("./react"); +const countdown = require("./countdown"); +const checkin = require("./checkin"); +const { score, top } = require("./score"); +const revvit = require("./revvit"); +const background = require("./background"); +const lattice = require("./lattice"); +const checkin_prv = require("./checkin_prv"); + +const CHECKIN_CHANNEL_ID = process.env.CHECKIN_CHANNEL_ID; + +client.once("ready", () => { + console.log("the bot is online!"); + client.user.setPresence({ + status: "online", + activity: { + name: `NodeJS and Postgres`, + type: "PLAYING", + }, + }); + + //list all servers the bot is connected to + // console.log('\nServers:') + client.guilds.cache.forEach((guild) => { + // console.log(' - '+guild.name) + + //list all channels in the server + guild.channels.cache.forEach((channel) => { + // console.log(` -- ${channel.name} (${channel.type}) - ${channel.id}`) + }); + }); + + // //send a message to a specific channel + // var generalChannel = client.channels.cache.get('750373912738791567') + // generalChannel.send('hello world') + + // }) + + // client.on('message', (receivedMessage) => { + // //prevent bot from responding to its own message + // if(receivedMessage.author == client.user) { + // return + // } + + // //bot responds to all messages in ALL channels in the server + // receivedMessage.channel.send("Message received from " + receivedMessage.author.toString() + ": " + receivedMessage.content) + + // //bot responds to all messages in ALL channels it has been tagged in + // if(receivedMessage.content.includes(client.user.toString())) { + // receivedMessage.channel.send("Message received from " + receivedMessage.author.toString() + ": " + receivedMessage.content) + // } +}); + +client.on("message", async (receivedMessage) => { + if (receivedMessage.author == client.user) { + return; + } + + if (receivedMessage.channel.id == CHECKIN_CHANNEL_ID) { + // run the checkIn function + await checkin(receivedMessage); + return; + } + /* if (receivedMessage.guild.id in stats === false) { stats[receivedMessage.guild.id] = {}; } @@ -90,56 +89,58 @@ client.on('message', async (receivedMessage) => { console.log(receivedMessage.author.username + ' now has ' + userStats.xp) */ - if(receivedMessage.content.startsWith('!')) { - processCommand(receivedMessage) - } -}) + if (receivedMessage.content.startsWith("!")) { + processCommand(receivedMessage); + } +}); /** - * - * @param {Discord.Message} receivedMessage + * + * @param {Discord.Message} receivedMessage */ function processCommand(receivedMessage) { - const fullCommand = receivedMessage.content.substr(1) //remove the leading/bot identifying character - const splitCommand = fullCommand.split(" ") //split the message up into pieces for each space - const primaryCommand = splitCommand[0] //take the first string from the split - const arguments = splitCommand.slice(1) //all other words are arguments/parameters for the primaryCommand - - console.log('command received: ' + primaryCommand) - console.log('Arguments: ' + arguments) - - switch(primaryCommand) { - case 'help': - help(arguments, receivedMessage) - break - case 'multiply': - multiply(arguments, receivedMessage) - break - case 'react': - react(arguments, receivedMessage) - break - case 'countdown': - countdown(arguments, receivedMessage) - break - case 'claim': - score(arguments, receivedMessage) - break - case 'top': - top(arguments, receivedMessage) - break - case 'hi': - case 'revvit': - revvit(arguments, receivedMessage) - break - case 'background': - background(arguments, receivedMessage) - break - case 'sponsor': - case 'mentor': - case 'judge': - case 'minor': - checkin_prv(arguments, receivedMessage, primaryCommand) - break; - } - -} \ No newline at end of file + const fullCommand = receivedMessage.content.substr(1); //remove the leading/bot identifying character + const splitCommand = fullCommand.split(" "); //split the message up into pieces for each space + const primaryCommand = splitCommand[0]; //take the first string from the split + const arguments = splitCommand.slice(1); //all other words are arguments/parameters for the primaryCommand + + console.log("command received: " + primaryCommand); + console.log("Arguments: " + arguments); + + switch (primaryCommand) { + case "help": + help(arguments, receivedMessage); + break; + case "multiply": + multiply(arguments, receivedMessage); + break; + case "react": + react(arguments, receivedMessage); + break; + case "countdown": + countdown(arguments, receivedMessage); + break; + case "claim": + score(arguments, receivedMessage); + break; + case "top": + top(arguments, receivedMessage); + break; + case "hi": + case "revvit": + revvit(arguments, receivedMessage); + break; + case "background": + background(arguments, receivedMessage); + break; + case "lattice": + lattice(receivedMessage); + break; + case "sponsor": + case "mentor": + case "judge": + case "minor": + checkin_prv(arguments, receivedMessage, primaryCommand); + break; + } +} diff --git a/discord/lattice.js b/discord/lattice.js new file mode 100644 index 0000000..136199c --- /dev/null +++ b/discord/lattice.js @@ -0,0 +1,45 @@ +const Discord = require("discord.js"); +const Axios = require("axios").default; +const { User } = require("../database"); + +const API_TOKEN = process.env.API_TOKEN; + +const latticeSkills = []; + +Axios.get(`https://revolutionuc-api.herokuapp.com/api/v2/lattice/skills`) + .then(res => latticeSkills = res.data); + +/** + * + * @param {Discord.Message} receivedMessage + */ +function latticeCommand(receivedMessage) { + try { + let user = await User.findByPk(receivedMessage.author.id); + + if (!user) { + receivedMessage.channel.send( + `Hey ${receivedMessage.author.username}, you are not checked in to RevUC, so either you hacked into the server, in which case you will be banned shortly, or you are an organizer, in which case, stop smurfing!` + ); + } else { + const { data: profile } = await Axios.get( + `https://revolutionuc-api.herokuapp.com/api/v2/lattice/admin/profile?email=${email}`, + { + headers: { + Authorization: `Bearer ${API_TOKEN}`, + }, + } + ); + + // name and idea are strings, skills and lookingFor are arrays of strings + const { name, skills, idea, lookingFor } = profile; + } + } catch (err) { + console.error(err); + receivedMessage.channel.send( + `Hey ${receivedMessage.author.username}, there was an error contacting the server, please report to an organizer!` + ); + } +} + +module.exports = latticeCommand; diff --git a/package-lock.json b/package-lock.json index 2126a74..455c9a8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,8 +1,2497 @@ { "name": "discordbot", "version": "2.0.0", - "lockfileVersion": 1, + "lockfileVersion": 2, "requires": true, + "packages": { + "": { + "name": "discordbot", + "version": "2.0.0", + "license": "ISC", + "dependencies": { + "axios": "^0.21.1", + "cors": "^2.8.5", + "discord.js": "^12.3.1", + "dotenv": "^8.2.0", + "email-validator": "^2.0.4", + "express": "^4.17.2", + "pg": "^8.5.1", + "pg-hstore": "^2.3.3", + "random": "^2.2.0", + "sequelize": "^6.5.0" + }, + "devDependencies": { + "@types/sequelize": "^4.28.9", + "nodemon": "^2.0.7" + } + }, + "node_modules/@discordjs/collection": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.1.6.tgz", + "integrity": "sha512-utRNxnd9kSS2qhyivo9lMlt5qgAUasH2gb7BEOn6p0efFh24gjGomHzWKMAPn2hEReOPQZCJaRKoURwRotKucQ==" + }, + "node_modules/@discordjs/form-data": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@discordjs/form-data/-/form-data-3.0.1.tgz", + "integrity": "sha512-ZfFsbgEXW71Rw/6EtBdrP5VxBJy4dthyC0tpQKGKmYFImlmmrykO14Za+BiIVduwjte0jXEBlhSKf0MWbFp9Eg==", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/@sindresorhus/is": { + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz", + "integrity": "sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/@szmarczak/http-timer": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-1.1.2.tgz", + "integrity": "sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA==", + "dev": true, + "dependencies": { + "defer-to-connect": "^1.0.1" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@types/bluebird": { + "version": "3.5.33", + "resolved": "https://registry.npmjs.org/@types/bluebird/-/bluebird-3.5.33.tgz", + "integrity": "sha512-ndEo1xvnYeHxm7I/5sF6tBvnsA4Tdi3zj1keRKRs12SP+2ye2A27NDJ1B6PqkfMbGAcT+mqQVqbZRIrhfOp5PQ==", + "dev": true + }, + "node_modules/@types/continuation-local-storage": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/@types/continuation-local-storage/-/continuation-local-storage-3.2.2.tgz", + "integrity": "sha512-aItm+aYPJ4rT1cHmAxO+OdWjSviQ9iB5UKb5f0Uvgln0N4hS2mcDodHtPiqicYBXViUYhqyBjhA5uyOcT+S34Q==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/lodash": { + "version": "4.14.168", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.168.tgz", + "integrity": "sha512-oVfRvqHV/V6D1yifJbVRU3TMp8OT6o6BG+U9MkwuJ3U8/CsDHvalRpsxBqivn71ztOFZBTfJMvETbqHiaNSj7Q==", + "dev": true + }, + "node_modules/@types/node": { + "version": "14.14.25", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.25.tgz", + "integrity": "sha512-EPpXLOVqDvisVxtlbvzfyqSsFeQxltFbluZNRndIb8tr9KiBnYNLzrc1N3pyKUCww2RNrfHDViqDWWE1LCJQtQ==" + }, + "node_modules/@types/sequelize": { + "version": "4.28.9", + "resolved": "https://registry.npmjs.org/@types/sequelize/-/sequelize-4.28.9.tgz", + "integrity": "sha512-QqYgkw/2fEc0FyEQejnxM7cHKB8XBV3Y69k7GSFOToQBOXos0PJVqNpgROXZddXIkl2d6zicYssHuy75ws84sw==", + "dev": true, + "dependencies": { + "@types/bluebird": "*", + "@types/continuation-local-storage": "*", + "@types/lodash": "*", + "@types/validator": "*" + } + }, + "node_modules/@types/validator": { + "version": "13.1.3", + "resolved": "https://registry.npmjs.org/@types/validator/-/validator-13.1.3.tgz", + "integrity": "sha512-DaOWN1zf7j+8nHhqXhIgNmS+ltAC53NXqGxYuBhWqWgqolRhddKzfZU814lkHQSTG0IUfQxU7Cg0gb8fFWo2mA==", + "dev": true + }, + "node_modules/abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "dev": true + }, + "node_modules/abort-controller": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", + "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", + "dependencies": { + "event-target-shim": "^5.0.0" + }, + "engines": { + "node": ">=6.5" + } + }, + "node_modules/accepts": { + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", + "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", + "dependencies": { + "mime-types": "~2.1.24", + "negotiator": "0.6.2" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/ansi-align": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.0.tgz", + "integrity": "sha512-ZpClVKqXN3RGBmKibdfWzqCY4lnjEuoNzU5T0oEFpfd/z5qJHVarukridD4juLO2FXMiwUQxr9WqQtaYa8XRYw==", + "dev": true, + "dependencies": { + "string-width": "^3.0.0" + } + }, + "node_modules/ansi-align/node_modules/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, + "dependencies": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/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, + "engines": { + "node": ">=6" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/any-promise": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", + "integrity": "sha1-q8av7tzqUugJzcA3au0845Y10X8=" + }, + "node_modules/anymatch": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", + "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==", + "dev": true, + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + }, + "node_modules/axios": { + "version": "0.21.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz", + "integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==", + "dependencies": { + "follow-redirects": "^1.10.0" + } + }, + "node_modules/babel-runtime": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", + "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", + "dependencies": { + "core-js": "^2.4.0", + "regenerator-runtime": "^0.11.0" + } + }, + "node_modules/balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "node_modules/binary-extensions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/body-parser": { + "version": "1.19.1", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.1.tgz", + "integrity": "sha512-8ljfQi5eBk8EJfECMrgqNGWPEY5jWP+1IzkzkGdFFEwFQZZyaZ21UqdaHktgiMlH0xLHqIFtE/u2OYE5dOtViA==", + "dependencies": { + "bytes": "3.1.1", + "content-type": "~1.0.4", + "debug": "2.6.9", + "depd": "~1.1.2", + "http-errors": "1.8.1", + "iconv-lite": "0.4.24", + "on-finished": "~2.3.0", + "qs": "6.9.6", + "raw-body": "2.4.2", + "type-is": "~1.6.18" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/body-parser/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/body-parser/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, + "node_modules/boxen": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/boxen/-/boxen-4.2.0.tgz", + "integrity": "sha512-eB4uT9RGzg2odpER62bBwSLvUeGC+WbRjjyyFhGsKnc8wp/m0+hQsMUvUe3H2V0D5vw0nBdO1hCJoZo5mKeuIQ==", + "dev": true, + "dependencies": { + "ansi-align": "^3.0.0", + "camelcase": "^5.3.1", + "chalk": "^3.0.0", + "cli-boxes": "^2.2.0", + "string-width": "^4.1.0", + "term-size": "^2.1.0", + "type-fest": "^0.8.1", + "widest-line": "^3.1.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/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, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/buffer-writer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/buffer-writer/-/buffer-writer-2.0.0.tgz", + "integrity": "sha512-a7ZpuTZU1TRtnwyCNW3I5dc0wWNC3VR9S++Ewyk2HHZdrO3CQJqSpd+95Us590V6AL7JqUAH2IwZ/398PmNFgw==", + "engines": { + "node": ">=4" + } + }, + "node_modules/bytes": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.1.tgz", + "integrity": "sha512-dWe4nWO/ruEOY7HkUJ5gFt1DCFV9zPRoJr8pV0/ASQermOZjtq8jMjOprC0Kd10GLN+l7xaUPvxzJFWtxGu8Fg==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/cacheable-request": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-6.1.0.tgz", + "integrity": "sha512-Oj3cAGPCqOZX7Rz64Uny2GYAZNliQSqfbePrgAQ1wKAihYmCUnraBtJtKcGR4xz7wF+LoJC+ssFZvv5BgF9Igg==", + "dev": true, + "dependencies": { + "clone-response": "^1.0.2", + "get-stream": "^5.1.0", + "http-cache-semantics": "^4.0.0", + "keyv": "^3.0.0", + "lowercase-keys": "^2.0.0", + "normalize-url": "^4.1.0", + "responselike": "^1.0.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cacheable-request/node_modules/get-stream": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", + "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", + "dev": true, + "dependencies": { + "pump": "^3.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cacheable-request/node_modules/lowercase-keys": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", + "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/chalk": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", + "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/chalk/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/chalk/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/chokidar": { + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.1.tgz", + "integrity": "sha512-9+s+Od+W0VJJzawDma/gvBNQqkTiqYTWLuZoyAsivsI4AaWTCzHG06/TMjsf1cYe9Cb97UCEhjz7HvnPk2p/tw==", + "dev": true, + "dependencies": { + "anymatch": "~3.1.1", + "braces": "~3.0.2", + "glob-parent": "~5.1.0", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.5.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.1" + } + }, + "node_modules/ci-info": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", + "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", + "dev": true + }, + "node_modules/cli-boxes": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-2.2.1.tgz", + "integrity": "sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw==", + "dev": true, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/clone-response": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz", + "integrity": "sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws=", + "dev": true, + "dependencies": { + "mimic-response": "^1.0.0" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/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 + }, + "node_modules/configstore": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/configstore/-/configstore-5.0.1.tgz", + "integrity": "sha512-aMKprgk5YhBNyH25hj8wGt2+D52Sw1DRRIzqBwLp2Ya9mFmY8KPvvtvmna8SxVR9JMZ4kzMD68N22vlaRpkeFA==", + "dev": true, + "dependencies": { + "dot-prop": "^5.2.0", + "graceful-fs": "^4.1.2", + "make-dir": "^3.0.0", + "unique-string": "^2.0.0", + "write-file-atomic": "^3.0.0", + "xdg-basedir": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/content-disposition": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", + "dependencies": { + "safe-buffer": "5.2.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/content-type": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", + "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.1.tgz", + "integrity": "sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" + }, + "node_modules/core-js": { + "version": "2.6.12", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz", + "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==", + "deprecated": "core-js@<3.4 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.", + "hasInstallScript": true + }, + "node_modules/cors": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "dependencies": { + "object-assign": "^4", + "vary": "^1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/crypto-random-string": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-2.0.0.tgz", + "integrity": "sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/decompress-response": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", + "integrity": "sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=", + "dev": true, + "dependencies": { + "mimic-response": "^1.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "dev": true, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/defer-to-connect": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-1.1.3.tgz", + "integrity": "sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ==", + "dev": true + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/destroy": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", + "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" + }, + "node_modules/discord.js": { + "version": "12.3.1", + "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-12.3.1.tgz", + "integrity": "sha512-mSFyV/mbvzH12UXdS4zadmeUf8IMQOo/YdunubG1wWt1xjWvtaJz/s9CGsFD2B5pTw1W/LXxxUbrQjIZ/xlUdw==", + "deprecated": "no longer supported", + "dependencies": { + "@discordjs/collection": "^0.1.6", + "@discordjs/form-data": "^3.0.1", + "abort-controller": "^3.0.0", + "node-fetch": "^2.6.0", + "prism-media": "^1.2.2", + "setimmediate": "^1.0.5", + "tweetnacl": "^1.0.3", + "ws": "^7.3.1" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/dot-prop": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz", + "integrity": "sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==", + "dev": true, + "dependencies": { + "is-obj": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/dotenv": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.2.0.tgz", + "integrity": "sha512-8sJ78ElpbDJBHNeBzUbUVLsqKdccaa/BXF1uPTw3GrvQTBgrQrtObr2mUrE38vzYd8cEv+m/JBfDLioYcfXoaw==", + "engines": { + "node": ">=8" + } + }, + "node_modules/dottie": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/dottie/-/dottie-2.0.2.tgz", + "integrity": "sha512-fmrwR04lsniq/uSr8yikThDTrM7epXHBAAjH9TbeH3rEA8tdCO7mRzB9hdmdGyJCxF8KERo9CITcm3kGuoyMhg==" + }, + "node_modules/duplexer3": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", + "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=", + "dev": true + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" + }, + "node_modules/email-validator": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/email-validator/-/email-validator-2.0.4.tgz", + "integrity": "sha512-gYCwo7kh5S3IDyZPLZf6hSS0MnZT8QmJFqYvbqlDZSbwdZlY6QZWxJ4i/6UhITOJ4XzyI647Bm2MXKCLqnJ4nQ==", + "engines": { + "node": ">4.0" + } + }, + "node_modules/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 + }, + "node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "dev": true, + "dependencies": { + "once": "^1.4.0" + } + }, + "node_modules/escape-goat": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/escape-goat/-/escape-goat-2.1.1.tgz", + "integrity": "sha512-8/uIhbG12Csjy2JEW7D9pHbreaVaS/OpN3ycnyvElTdwM5n6GY6W6e2IPemfvGZeUMqZ9A/3GqIZMgKnBhAw/Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/event-target-shim": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", + "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", + "engines": { + "node": ">=6" + } + }, + "node_modules/express": { + "version": "4.17.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.17.2.tgz", + "integrity": "sha512-oxlxJxcQlYwqPWKVJJtvQiwHgosH/LrLSPA+H4UxpyvSS6jC5aH+5MoHFM+KABgTOt0APue4w66Ha8jCUo9QGg==", + "dependencies": { + "accepts": "~1.3.7", + "array-flatten": "1.1.1", + "body-parser": "1.19.1", + "content-disposition": "0.5.4", + "content-type": "~1.0.4", + "cookie": "0.4.1", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "~1.1.2", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "~1.1.2", + "fresh": "0.5.2", + "merge-descriptors": "1.0.1", + "methods": "~1.1.2", + "on-finished": "~2.3.0", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.7", + "proxy-addr": "~2.0.7", + "qs": "6.9.6", + "range-parser": "~1.2.1", + "safe-buffer": "5.2.1", + "send": "0.17.2", + "serve-static": "1.14.2", + "setprototypeof": "1.2.0", + "statuses": "~1.5.0", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/express/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/express/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/finalhandler": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", + "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", + "dependencies": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "~2.3.0", + "parseurl": "~1.3.3", + "statuses": "~1.5.0", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/finalhandler/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/finalhandler/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, + "node_modules/follow-redirects": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.1.tgz", + "integrity": "sha512-SSG5xmZh1mkPGyKzjZP8zLjltIfpW32Y5QpdNJyjcfGxK3qo3NDDkZOZSFiGn1A6SclQxY9GzEwAHQ3dmYRWpg==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/get-stream": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "dev": true, + "dependencies": { + "pump": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/glob-parent": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", + "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/global-dirs": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-2.1.0.tgz", + "integrity": "sha512-MG6kdOUh/xBnyo9cJFeIKkLEc1AyFq42QTU4XiX51i2NEdxLxLWXIjEjmqKeSuKR7pAZjTqUVoT2b2huxVLgYQ==", + "dev": true, + "dependencies": { + "ini": "1.3.7" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/got": { + "version": "9.6.0", + "resolved": "https://registry.npmjs.org/got/-/got-9.6.0.tgz", + "integrity": "sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q==", + "dev": true, + "dependencies": { + "@sindresorhus/is": "^0.14.0", + "@szmarczak/http-timer": "^1.1.2", + "cacheable-request": "^6.0.0", + "decompress-response": "^3.3.0", + "duplexer3": "^0.1.4", + "get-stream": "^4.1.0", + "lowercase-keys": "^1.0.1", + "mimic-response": "^1.0.1", + "p-cancelable": "^1.0.0", + "to-readable-stream": "^1.0.0", + "url-parse-lax": "^3.0.0" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.5.tgz", + "integrity": "sha512-kBBSQbz2K0Nyn+31j/w36fUfxkBW9/gfwRWdUY1ULReH3iokVJgddZAFcD1D0xlgTmFxJCbUkUclAlc6/IDJkw==", + "dev": true + }, + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/has-yarn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/has-yarn/-/has-yarn-2.1.0.tgz", + "integrity": "sha512-UqBRqi4ju7T+TqGNdqAO0PaSVGsDGJUBQvk9eUWNGRY1CFGDzYhLWoM7JQEemnlvVcv/YEmc2wNW8BC24EnUsw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/http-cache-semantics": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz", + "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==", + "dev": true + }, + "node_modules/http-errors": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz", + "integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==", + "dependencies": { + "depd": "~1.1.2", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": ">= 1.5.0 < 2", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ignore-by-default": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", + "integrity": "sha1-SMptcvbGo68Aqa1K5odr44ieKwk=", + "dev": true + }, + "node_modules/import-lazy": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-2.1.0.tgz", + "integrity": "sha1-BWmOPUXIjo1+nZLLBYTnfwlvPkM=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true, + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/inflection": { + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/inflection/-/inflection-1.12.0.tgz", + "integrity": "sha1-ogCTVlbW9fa8TcdQLhrstwMihBY=", + "engines": [ + "node >= 0.4.0" + ] + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/ini": { + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.7.tgz", + "integrity": "sha512-iKpRpXP+CrP2jyrxvg1kMUpXDyRUFDWurxbnVT1vQPx+Wz9uCYsMIqYuSBLV+PAaZG/d7kRLKRFc9oDMsH+mFQ==", + "dev": true + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-ci": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", + "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==", + "dev": true, + "dependencies": { + "ci-info": "^2.0.0" + }, + "bin": { + "is-ci": "bin.js" + } + }, + "node_modules/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, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/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, + "engines": { + "node": ">=4" + } + }, + "node_modules/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, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-installed-globally": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.3.2.tgz", + "integrity": "sha512-wZ8x1js7Ia0kecP/CHM/3ABkAmujX7WPvQk6uu3Fly/Mk44pySulQpnHG46OMjHGXApINnV4QhY3SWnECO2z5g==", + "dev": true, + "dependencies": { + "global-dirs": "^2.0.1", + "is-path-inside": "^3.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-npm": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-4.0.0.tgz", + "integrity": "sha512-96ECIfh9xtDDlPylNPXhzjsykHsMJZ18ASpaWzQyBr4YRTcVjUvzaHayDAES2oU/3KpljhHUjtSRNiDwi0F0ig==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-obj": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", + "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-path-inside": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.2.tgz", + "integrity": "sha512-/2UGPSgmtqwo1ktx8NDHjuPwZWmHhO+gj0f93EkhLB5RgW9RZevWYYlIkS6zePc6U2WpOdQYIwHe9YC4DWEBVg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true + }, + "node_modules/is-yarn-global": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/is-yarn-global/-/is-yarn-global-0.3.0.tgz", + "integrity": "sha512-VjSeb/lHmkoyd8ryPVIKvOCn4D1koMqY+vqyjjUfc3xyKtP4dYOxM44sZrnqQSzSds3xyOrUTLTC9LVCVgLngw==", + "dev": true + }, + "node_modules/json-buffer": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz", + "integrity": "sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg=", + "dev": true + }, + "node_modules/keyv": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-3.1.0.tgz", + "integrity": "sha512-9ykJ/46SN/9KPM/sichzQ7OvXyGDYKGTaDlKMGCAlg2UK8KRy4jb0d8sFc+0Tt0YYnThq8X2RZgCg74RPxgcVA==", + "dev": true, + "dependencies": { + "json-buffer": "3.0.0" + } + }, + "node_modules/latest-version": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-5.1.0.tgz", + "integrity": "sha512-weT+r0kTkRQdCdYCNtkMwWXQTMEswKrFBkm4ckQOMVhhqhIMI1UT2hMj+1iigIhgSZm5gTmrRXBNoGUgaTY1xA==", + "dev": true, + "dependencies": { + "package-json": "^6.3.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/lodash": { + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==" + }, + "node_modules/lowercase-keys": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", + "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "dependencies": { + "semver": "^6.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/make-dir/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" + }, + "node_modules/methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/mime-db": { + "version": "1.45.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.45.0.tgz", + "integrity": "sha512-CkqLUxUk15hofLoLyljJSrukZi8mAtgd+yE5uO4tqRZsdsAJKv0O+rFMhVDRJgozy+yG6md5KwuXhD4ocIoP+w==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.28", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.28.tgz", + "integrity": "sha512-0TO2yJ5YHYr7M2zzT7gDU1tbwHxEUWBCLt0lscSNpcdAfFyJOVEpRYNS7EXVcTLNj/25QO8gulHC5JtTzSE2UQ==", + "dependencies": { + "mime-db": "1.45.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mimic-response": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", + "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "node_modules/moment": { + "version": "2.29.1", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.1.tgz", + "integrity": "sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ==", + "engines": { + "node": "*" + } + }, + "node_modules/moment-timezone": { + "version": "0.5.33", + "resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.33.tgz", + "integrity": "sha512-PTc2vcT8K9J5/9rDEPe5czSIKgLoGsH8UNpA4qZTVw0Vd/Uz19geE9abbIOQKaAQFcnQ3v5YEXrbSc5BpshH+w==", + "dependencies": { + "moment": ">= 2.9.0" + }, + "engines": { + "node": "*" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/negotiator": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", + "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/node-fetch": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", + "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==", + "engines": { + "node": "4.x || >=6.0.0" + } + }, + "node_modules/nodemon": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.7.tgz", + "integrity": "sha512-XHzK69Awgnec9UzHr1kc8EomQh4sjTQ8oRf8TsGrSmHDx9/UmiGG9E/mM3BuTfNeFwdNBvrqQq/RHL0xIeyFOA==", + "dev": true, + "hasInstallScript": true, + "dependencies": { + "chokidar": "^3.2.2", + "debug": "^3.2.6", + "ignore-by-default": "^1.0.1", + "minimatch": "^3.0.4", + "pstree.remy": "^1.1.7", + "semver": "^5.7.1", + "supports-color": "^5.5.0", + "touch": "^3.1.0", + "undefsafe": "^2.0.3", + "update-notifier": "^4.1.0" + }, + "bin": { + "nodemon": "bin/nodemon.js" + }, + "engines": { + "node": ">=8.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/nodemon" + } + }, + "node_modules/nopt": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", + "integrity": "sha1-bd0hvSoxQXuScn3Vhfim83YI6+4=", + "dev": true, + "dependencies": { + "abbrev": "1" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "engines": { + "node": "*" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/normalize-url": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.0.tgz", + "integrity": "sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/ow": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/ow/-/ow-0.4.0.tgz", + "integrity": "sha512-kJNzxUgVd6EF5LoGs+s2/etJPwjfRDLXPTCfEgV8At77sRrV+PSFA8lcoW2HF15Qd455mIR2Stee/2MzDiFBDA==", + "engines": { + "node": ">=6" + } + }, + "node_modules/ow-lite": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/ow-lite/-/ow-lite-0.0.2.tgz", + "integrity": "sha1-359QDmdAtlkKHpqWVzDUmo61l9E=", + "engines": { + "node": ">=6" + } + }, + "node_modules/p-cancelable": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz", + "integrity": "sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/package-json": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/package-json/-/package-json-6.5.0.tgz", + "integrity": "sha512-k3bdm2n25tkyxcjSKzB5x8kfVxlMdgsbPr0GkZcwHsLpba6cBjqCt1KlcChKEvxHIcTB1FVMuwoijZ26xex5MQ==", + "dev": true, + "dependencies": { + "got": "^9.6.0", + "registry-auth-token": "^4.0.0", + "registry-url": "^5.0.0", + "semver": "^6.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/package-json/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/packet-reader": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/packet-reader/-/packet-reader-1.0.0.tgz", + "integrity": "sha512-HAKu/fG3HpHFO0AA8WE8q2g+gBJaZ9MG7fcKk+IJPLTGAD6Psw4443l+9DGRbOIh3/aXr7Phy0TjilYivJo5XQ==" + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" + }, + "node_modules/pg": { + "version": "8.5.1", + "resolved": "https://registry.npmjs.org/pg/-/pg-8.5.1.tgz", + "integrity": "sha512-9wm3yX9lCfjvA98ybCyw2pADUivyNWT/yIP4ZcDVpMN0og70BUWYEGXPCTAQdGTAqnytfRADb7NERrY1qxhIqw==", + "dependencies": { + "buffer-writer": "2.0.0", + "packet-reader": "1.0.0", + "pg-connection-string": "^2.4.0", + "pg-pool": "^3.2.2", + "pg-protocol": "^1.4.0", + "pg-types": "^2.1.0", + "pgpass": "1.x" + }, + "engines": { + "node": ">= 8.0.0" + }, + "peerDependencies": { + "pg-native": ">=2.0.0" + }, + "peerDependenciesMeta": { + "pg-native": { + "optional": true + } + } + }, + "node_modules/pg-connection-string": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.4.0.tgz", + "integrity": "sha512-3iBXuv7XKvxeMrIgym7njT+HlZkwZqqGX4Bu9cci8xHZNT+Um1gWKqCsAzcC0d95rcKMU5WBg6YRUcHyV0HZKQ==" + }, + "node_modules/pg-hstore": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/pg-hstore/-/pg-hstore-2.3.3.tgz", + "integrity": "sha512-qpeTpdkguFgfdoidtfeTho1Q1zPVPbtMHgs8eQ+Aan05iLmIs3Z3oo5DOZRclPGoQ4i68I1kCtQSJSa7i0ZVYg==", + "dependencies": { + "underscore": "^1.7.0" + }, + "engines": { + "node": ">= 0.8.x" + } + }, + "node_modules/pg-int8": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/pg-int8/-/pg-int8-1.0.1.tgz", + "integrity": "sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==", + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/pg-pool": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.2.2.tgz", + "integrity": "sha512-ORJoFxAlmmros8igi608iVEbQNNZlp89diFVx6yV5v+ehmpMY9sK6QgpmgoXbmkNaBAx8cOOZh9g80kJv1ooyA==", + "peerDependencies": { + "pg": ">=8.0" + } + }, + "node_modules/pg-protocol": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.4.0.tgz", + "integrity": "sha512-El+aXWcwG/8wuFICMQjM5ZSAm6OWiJicFdNYo+VY3QP+8vI4SvLIWVe51PppTzMhikUJR+PsyIFKqfdXPz/yxA==" + }, + "node_modules/pg-types": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/pg-types/-/pg-types-2.2.0.tgz", + "integrity": "sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==", + "dependencies": { + "pg-int8": "1.0.1", + "postgres-array": "~2.0.0", + "postgres-bytea": "~1.0.0", + "postgres-date": "~1.0.4", + "postgres-interval": "^1.1.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/pgpass": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/pgpass/-/pgpass-1.0.4.tgz", + "integrity": "sha512-YmuA56alyBq7M59vxVBfPJrGSozru8QAdoNlWuW3cz8l+UX3cWge0vTvjKhsSHSJpo3Bom8/Mm6hf0TR5GY0+w==", + "dependencies": { + "split2": "^3.1.1" + } + }, + "node_modules/picomatch": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", + "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/postgres-array": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz", + "integrity": "sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==", + "engines": { + "node": ">=4" + } + }, + "node_modules/postgres-bytea": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-1.0.0.tgz", + "integrity": "sha1-AntTPAqokOJtFy1Hz5zOzFIazTU=", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/postgres-date": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.7.tgz", + "integrity": "sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/postgres-interval": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-1.2.0.tgz", + "integrity": "sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==", + "dependencies": { + "xtend": "^4.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/prepend-http": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", + "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/prism-media": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/prism-media/-/prism-media-1.2.3.tgz", + "integrity": "sha512-fSrR66n0l6roW9Rx4rSLMyTPTjRTiXy5RVqDOurACQ6si1rKHHKDU5gwBJoCsIV0R3o9gi+K50akl/qyw1C74A==", + "peerDependencies": { + "@discordjs/opus": "^0.3.3", + "ffmpeg-static": "^4.2.7 || ^3.0.0 || ^2.4.0", + "node-opus": "^0.3.3", + "opusscript": "^0.0.7" + }, + "peerDependenciesMeta": { + "@discordjs/opus": { + "optional": true + }, + "ffmpeg-static": { + "optional": true + }, + "node-opus": { + "optional": true + }, + "opusscript": { + "optional": true + } + } + }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/pstree.remy": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", + "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==", + "dev": true + }, + "node_modules/pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "node_modules/pupa": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/pupa/-/pupa-2.1.1.tgz", + "integrity": "sha512-l1jNAspIBSFqbT+y+5FosojNpVpF94nlI+wDUpqP9enwOTfHx9f0gh5nB96vl+6yTpsJsypeNrwfzPrKuHB41A==", + "dev": true, + "dependencies": { + "escape-goat": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/qs": { + "version": "6.9.6", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.6.tgz", + "integrity": "sha512-TIRk4aqYLNoJUbd+g2lEdz5kLWIuTMRagAXxl78Q0RiVjAOugHmeKNGdd3cwo/ktpf9aL9epCfFqWDEKysUlLQ==", + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/random": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/random/-/random-2.2.0.tgz", + "integrity": "sha512-4HBR4Xye4jJ41QBi6RfIaO1yKQpxVUZafQtdE6NvvjzirNlwWgsk3tkGLTbQtWUarF4ofZsUVEmWqB1TDQlkwA==", + "dependencies": { + "babel-runtime": "^6.26.0", + "ow": "^0.4.0", + "ow-lite": "^0.0.2", + "seedrandom": "^3.0.5" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.2.tgz", + "integrity": "sha512-RPMAFUJP19WIet/99ngh6Iv8fzAbqum4Li7AD6DtGaW2RpMB/11xDoalPiJMTbu6I3hkbMVkATvZrqb9EEqeeQ==", + "dependencies": { + "bytes": "3.1.1", + "http-errors": "1.8.1", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "dev": true, + "dependencies": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "bin": { + "rc": "cli.js" + } + }, + "node_modules/readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/readdirp": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.5.0.tgz", + "integrity": "sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ==", + "dev": true, + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/regenerator-runtime": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", + "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==" + }, + "node_modules/registry-auth-token": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-4.2.1.tgz", + "integrity": "sha512-6gkSb4U6aWJB4SF2ZvLb76yCBjcvufXBqvvEx1HbmKPkutswjW1xNVRY0+daljIYRbogN7O0etYSlbiaEQyMyw==", + "dev": true, + "dependencies": { + "rc": "^1.2.8" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/registry-url": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-5.1.0.tgz", + "integrity": "sha512-8acYXXTI0AkQv6RAOjE3vOaIXZkT9wo4LOFbBKYQEEnnMNBpKqdUrI6S4NT0KPIo/WVvJ5tE/X5LF/TQUf0ekw==", + "dev": true, + "dependencies": { + "rc": "^1.2.8" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/responselike": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/responselike/-/responselike-1.0.2.tgz", + "integrity": "sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec=", + "dev": true, + "dependencies": { + "lowercase-keys": "^1.0.0" + } + }, + "node_modules/retry-as-promised": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/retry-as-promised/-/retry-as-promised-3.2.0.tgz", + "integrity": "sha512-CybGs60B7oYU/qSQ6kuaFmRd9sTZ6oXSc0toqePvV74Ac6/IFZSI1ReFQmtCN+uvW1Mtqdwpvt/LGOiCBAY2Mg==", + "dependencies": { + "any-promise": "^1.3.0" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "node_modules/seedrandom": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/seedrandom/-/seedrandom-3.0.5.tgz", + "integrity": "sha512-8OwmbklUNzwezjGInmZ+2clQmExQPvomqjL7LFqOYqtmuxRgQYqOD3mHaU+MvZn5FLUeVxVfQjwLZW/n/JFuqg==" + }, + "node_modules/semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true, + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/semver-diff": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-3.1.1.tgz", + "integrity": "sha512-GX0Ix/CJcHyB8c4ykpHGIAvLyOwOobtM/8d+TQkAd81/bEjgPHrfba41Vpesr7jX/t8Uh+R3EX9eAS5be+jQYg==", + "dev": true, + "dependencies": { + "semver": "^6.3.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/semver-diff/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/send": { + "version": "0.17.2", + "resolved": "https://registry.npmjs.org/send/-/send-0.17.2.tgz", + "integrity": "sha512-UJYB6wFSJE3G00nEivR5rgWp8c2xXvJ3OPWPhmuteU0IKj8nKbG3DrjiOmLwpnHGYWAVwA69zmTm++YG0Hmwww==", + "dependencies": { + "debug": "2.6.9", + "depd": "~1.1.2", + "destroy": "~1.0.4", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "1.8.1", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "~2.3.0", + "range-parser": "~1.2.1", + "statuses": "~1.5.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/send/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/send/node_modules/debug/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, + "node_modules/sequelize": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/sequelize/-/sequelize-6.5.0.tgz", + "integrity": "sha512-owBt8fnzVy8E1OvyCyfCdVk7OOLyPVrBCMEf+CvRReC5oCyo+UqeXCtwaex9L6LM9ifZ1i3TG3sFeM5MgLK0CQ==", + "dependencies": { + "debug": "^4.1.1", + "dottie": "^2.0.0", + "inflection": "1.12.0", + "lodash": "^4.17.20", + "moment": "^2.26.0", + "moment-timezone": "^0.5.31", + "retry-as-promised": "^3.2.0", + "semver": "^7.3.2", + "sequelize-pool": "^6.0.0", + "toposort-class": "^1.0.1", + "uuid": "^8.1.0", + "validator": "^10.11.0", + "wkx": "^0.5.0" + }, + "engines": { + "node": ">=10.0.0" + }, + "peerDependenciesMeta": { + "mariadb": { + "optional": true + }, + "mysql2": { + "optional": true + }, + "pg": { + "optional": true + }, + "pg-hstore": { + "optional": true + }, + "sqlite3": { + "optional": true + }, + "tedious": { + "optional": true + } + } + }, + "node_modules/sequelize-pool": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/sequelize-pool/-/sequelize-pool-6.1.0.tgz", + "integrity": "sha512-4YwEw3ZgK/tY/so+GfnSgXkdwIJJ1I32uZJztIEgZeAO6HMgj64OzySbWLgxj+tXhZCJnzRfkY9gINw8Ft8ZMg==", + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/sequelize/node_modules/debug": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/sequelize/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "node_modules/sequelize/node_modules/semver": { + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz", + "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/serve-static": { + "version": "1.14.2", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.2.tgz", + "integrity": "sha512-+TMNA9AFxUEGuC0z2mevogSnn9MXKb4fa7ngeRMJaaGv8vTwnIEkKi+QGvPt33HSnf8pRS+WGM0EbMtCJLKMBQ==", + "dependencies": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.17.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=" + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" + }, + "node_modules/signal-exit": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", + "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", + "dev": true + }, + "node_modules/split2": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/split2/-/split2-3.2.2.tgz", + "integrity": "sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg==", + "dependencies": { + "readable-stream": "^3.0.0" + } + }, + "node_modules/statuses": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/string-width": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width/node_modules/ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width/node_modules/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 + }, + "node_modules/string-width/node_modules/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, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width/node_modules/strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/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, + "dependencies": { + "ansi-regex": "^4.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/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, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/term-size": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/term-size/-/term-size-2.2.1.tgz", + "integrity": "sha512-wK0Ri4fOGjv/XPy8SBHZChl8CM7uMc5VML7SqiQ0zG7+J5Vr+RMQDoHa2CNT6KHUnTGIXH34UDMkPzAUyapBZg==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/to-readable-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/to-readable-stream/-/to-readable-stream-1.0.0.tgz", + "integrity": "sha512-Iq25XBt6zD5npPhlLVXGFN3/gyR2/qODcKNNyTMd4vbm39HUaOiAM4PMq0eMVC/Tkxz+Zjdsc55g9yyz+Yq00Q==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/toposort-class": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toposort-class/-/toposort-class-1.0.1.tgz", + "integrity": "sha1-f/0feMi+KMO6Rc1OGj9e4ZO9mYg=" + }, + "node_modules/touch": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.0.tgz", + "integrity": "sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA==", + "dev": true, + "dependencies": { + "nopt": "~1.0.10" + }, + "bin": { + "nodetouch": "bin/nodetouch.js" + } + }, + "node_modules/tweetnacl": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", + "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==" + }, + "node_modules/type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "dependencies": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/typedarray-to-buffer": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", + "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", + "dev": true, + "dependencies": { + "is-typedarray": "^1.0.0" + } + }, + "node_modules/undefsafe": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.3.tgz", + "integrity": "sha512-nrXZwwXrD/T/JXeygJqdCO6NZZ1L66HrxM/Z7mIq2oPanoN0F1nLx3lwJMu6AwJY69hdixaFQOuoYsMjE5/C2A==", + "dev": true, + "dependencies": { + "debug": "^2.2.0" + } + }, + "node_modules/undefsafe/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/undefsafe/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "node_modules/underscore": { + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.12.0.tgz", + "integrity": "sha512-21rQzss/XPMjolTiIezSu3JAjgagXKROtNrYFEOWK109qY1Uv2tVjPTZ1ci2HgvQDA16gHYSthQIJfB+XId/rQ==" + }, + "node_modules/unique-string": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-2.0.0.tgz", + "integrity": "sha512-uNaeirEPvpZWSgzwsPGtU2zVSTrn/8L5q/IexZmH0eH6SA73CmAA5U4GwORTxQAZs95TAXLNqeLoPPNO5gZfWg==", + "dev": true, + "dependencies": { + "crypto-random-string": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/update-notifier": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-4.1.3.tgz", + "integrity": "sha512-Yld6Z0RyCYGB6ckIjffGOSOmHXj1gMeE7aROz4MG+XMkmixBX4jUngrGXNYz7wPKBmtoD4MnBa2Anu7RSKht/A==", + "dev": true, + "dependencies": { + "boxen": "^4.2.0", + "chalk": "^3.0.0", + "configstore": "^5.0.1", + "has-yarn": "^2.1.0", + "import-lazy": "^2.1.0", + "is-ci": "^2.0.0", + "is-installed-globally": "^0.3.1", + "is-npm": "^4.0.0", + "is-yarn-global": "^0.3.0", + "latest-version": "^5.0.0", + "pupa": "^2.0.1", + "semver-diff": "^3.1.1", + "xdg-basedir": "^4.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/yeoman/update-notifier?sponsor=1" + } + }, + "node_modules/url-parse-lax": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-3.0.0.tgz", + "integrity": "sha1-FrXK/Afb42dsGxmZF3gj1lA6yww=", + "dev": true, + "dependencies": { + "prepend-http": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + }, + "node_modules/utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/validator": { + "version": "10.11.0", + "resolved": "https://registry.npmjs.org/validator/-/validator-10.11.0.tgz", + "integrity": "sha512-X/p3UZerAIsbBfN/IwahhYaBbY68EN/UQBWHtsbXGT5bfrH/p4NQzUCG1kF/rtKaNpnJ7jAu6NGTdSNtyNIXMw==", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/widest-line": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz", + "integrity": "sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg==", + "dev": true, + "dependencies": { + "string-width": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wkx": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/wkx/-/wkx-0.5.0.tgz", + "integrity": "sha512-Xng/d4Ichh8uN4l0FToV/258EjMGU9MGcA0HV2d9B/ZpZB3lqQm7nkOdZdm5GhKtLLhAE7PiVQwN4eN+2YJJUg==", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "node_modules/write-file-atomic": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", + "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", + "dev": true, + "dependencies": { + "imurmurhash": "^0.1.4", + "is-typedarray": "^1.0.0", + "signal-exit": "^3.0.2", + "typedarray-to-buffer": "^3.1.5" + } + }, + "node_modules/ws": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.2.tgz", + "integrity": "sha512-T4tewALS3+qsrpGI/8dqNMLIVdq/g/85U98HPMa6F0m6xTbvhXU6RCQLqPH3+SlomNV/LdY6RXEbBpMH6EOJnA==", + "engines": { + "node": ">=8.3.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/xdg-basedir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-4.0.0.tgz", + "integrity": "sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "engines": { + "node": ">=0.4" + } + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + } + }, "dependencies": { "@discordjs/collection": { "version": "0.1.6", @@ -1208,7 +3697,8 @@ "pg-pool": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.2.2.tgz", - "integrity": "sha512-ORJoFxAlmmros8igi608iVEbQNNZlp89diFVx6yV5v+ehmpMY9sK6QgpmgoXbmkNaBAx8cOOZh9g80kJv1ooyA==" + "integrity": "sha512-ORJoFxAlmmros8igi608iVEbQNNZlp89diFVx6yV5v+ehmpMY9sK6QgpmgoXbmkNaBAx8cOOZh9g80kJv1ooyA==", + "requires": {} }, "pg-protocol": { "version": "1.4.0", @@ -1273,7 +3763,8 @@ "prism-media": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/prism-media/-/prism-media-1.2.3.tgz", - "integrity": "sha512-fSrR66n0l6roW9Rx4rSLMyTPTjRTiXy5RVqDOurACQ6si1rKHHKDU5gwBJoCsIV0R3o9gi+K50akl/qyw1C74A==" + "integrity": "sha512-fSrR66n0l6roW9Rx4rSLMyTPTjRTiXy5RVqDOurACQ6si1rKHHKDU5gwBJoCsIV0R3o9gi+K50akl/qyw1C74A==", + "requires": {} }, "proxy-addr": { "version": "2.0.7", @@ -1575,6 +4066,14 @@ "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=" }, + "string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "requires": { + "safe-buffer": "~5.2.0" + } + }, "string-width": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", @@ -1615,14 +4114,6 @@ } } }, - "string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "requires": { - "safe-buffer": "~5.2.0" - } - }, "strip-ansi": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", @@ -1854,7 +4345,8 @@ "ws": { "version": "7.4.2", "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.2.tgz", - "integrity": "sha512-T4tewALS3+qsrpGI/8dqNMLIVdq/g/85U98HPMa6F0m6xTbvhXU6RCQLqPH3+SlomNV/LdY6RXEbBpMH6EOJnA==" + "integrity": "sha512-T4tewALS3+qsrpGI/8dqNMLIVdq/g/85U98HPMa6F0m6xTbvhXU6RCQLqPH3+SlomNV/LdY6RXEbBpMH6EOJnA==", + "requires": {} }, "xdg-basedir": { "version": "4.0.0", From 33afe647bfa04b0cf314a77b8ed30334a01af086 Mon Sep 17 00:00:00 2001 From: Dev Agrawal Date: Sun, 13 Feb 2022 00:59:24 -0500 Subject: [PATCH 39/55] added basic lattice message --- discord/lattice.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/discord/lattice.js b/discord/lattice.js index 136199c..9e51c85 100644 --- a/discord/lattice.js +++ b/discord/lattice.js @@ -6,8 +6,9 @@ const API_TOKEN = process.env.API_TOKEN; const latticeSkills = []; -Axios.get(`https://revolutionuc-api.herokuapp.com/api/v2/lattice/skills`) - .then(res => latticeSkills = res.data); +Axios.get(`https://revolutionuc-api.herokuapp.com/api/v2/lattice/skills`).then( + (res) => (latticeSkills = res.data) +); /** * @@ -33,6 +34,12 @@ function latticeCommand(receivedMessage) { // name and idea are strings, skills and lookingFor are arrays of strings const { name, skills, idea, lookingFor } = profile; + + message.channel.send( + `${name}: Skills: ${skills.join( + ", " + )}, Idea: ${idea}, Looking for: ${lookingFor.join(", ")}` + ); } } catch (err) { console.error(err); From 546bd7f2fd04c35853b2fa87ad674251069bc6ca Mon Sep 17 00:00:00 2001 From: Dev Agrawal Date: Sun, 13 Feb 2022 01:02:25 -0500 Subject: [PATCH 40/55] fixed datatypes import --- database/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database/index.js b/database/index.js index fed3a39..2ff2aec 100644 --- a/database/index.js +++ b/database/index.js @@ -1,4 +1,4 @@ -const { Sequelize } = require(`sequelize`); +const { Sequelize, DataTypes } = require(`sequelize`); const sequelize = new Sequelize(process.env.DATABASE_URL, { dialect: "postgres", From 063c8b43fb78aa04d48aa9f093ad39b69a91a9a7 Mon Sep 17 00:00:00 2001 From: Dev Agrawal Date: Sun, 13 Feb 2022 01:04:15 -0500 Subject: [PATCH 41/55] fixed bugs --- discord/lattice.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/discord/lattice.js b/discord/lattice.js index 9e51c85..866c309 100644 --- a/discord/lattice.js +++ b/discord/lattice.js @@ -7,14 +7,14 @@ const API_TOKEN = process.env.API_TOKEN; const latticeSkills = []; Axios.get(`https://revolutionuc-api.herokuapp.com/api/v2/lattice/skills`).then( - (res) => (latticeSkills = res.data) + (res) => latticeSkills.push(...res.data) ); /** * * @param {Discord.Message} receivedMessage */ -function latticeCommand(receivedMessage) { +async function latticeCommand(receivedMessage) { try { let user = await User.findByPk(receivedMessage.author.id); From e26b543507ad641159874d62600517f582aab6bc Mon Sep 17 00:00:00 2001 From: Dev Agrawal Date: Sun, 13 Feb 2022 03:23:38 -0500 Subject: [PATCH 42/55] updated lattice stuff --- discord/lattice.js | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/discord/lattice.js b/discord/lattice.js index 866c309..3004ef6 100644 --- a/discord/lattice.js +++ b/discord/lattice.js @@ -24,7 +24,7 @@ async function latticeCommand(receivedMessage) { ); } else { const { data: profile } = await Axios.get( - `https://revolutionuc-api.herokuapp.com/api/v2/lattice/admin/profile?email=${email}`, + `https://revolutionuc-api.herokuapp.com/api/v2/lattice/admin/profile?email=${user.email}`, { headers: { Authorization: `Bearer ${API_TOKEN}`, @@ -33,18 +33,24 @@ async function latticeCommand(receivedMessage) { ); // name and idea are strings, skills and lookingFor are arrays of strings - const { name, skills, idea, lookingFor } = profile; - - message.channel.send( - `${name}: Skills: ${skills.join( - ", " - )}, Idea: ${idea}, Looking for: ${lookingFor.join(", ")}` - ); + const { name, skills, idea, lookingFor, visible } = profile; + + if (visible) { + receivedMessage.channel.send( + `${name}\nSkills: ${skills.join( + ", " + )}\nIdea: ${idea}\nLooking for: ${lookingFor.join(", ")}` + ); + } else { + receivedMessage.channel.send( + `Hey ${receivedMessage.author.username}, your lattice profile is hidden. If you want to show it here, please go to https://lattice.revolutionuc.com/profile and click on "Mark Visible".` + ); + } } } catch (err) { console.error(err); receivedMessage.channel.send( - `Hey ${receivedMessage.author.username}, there was an error contacting the server, please report to an organizer!` + `Hey ${receivedMessage.author.username}, looks like you haven't signed up for lattice yet! If you are having issues with creating a lattice profile, or if you have already signed up and are still getting this error, please @Organizer.` ); } } From 817c6e9c2283e6a52d325cc996f4528a2d58f7ce Mon Sep 17 00:00:00 2001 From: Bao Huynh Date: Wed, 16 Feb 2022 12:08:56 -0500 Subject: [PATCH 43/55] Bump discord.js version --- package-lock.json | 54 +++++++++++++++++++++++------------------------ package.json | 2 +- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/package-lock.json b/package-lock.json index 455c9a8..d470b6c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "dependencies": { "axios": "^0.21.1", "cors": "^2.8.5", - "discord.js": "^12.3.1", + "discord.js": "^12.5.3", "dotenv": "^8.2.0", "email-validator": "^2.0.4", "express": "^4.17.2", @@ -640,19 +640,19 @@ "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" }, "node_modules/discord.js": { - "version": "12.3.1", - "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-12.3.1.tgz", - "integrity": "sha512-mSFyV/mbvzH12UXdS4zadmeUf8IMQOo/YdunubG1wWt1xjWvtaJz/s9CGsFD2B5pTw1W/LXxxUbrQjIZ/xlUdw==", + "version": "12.5.3", + "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-12.5.3.tgz", + "integrity": "sha512-D3nkOa/pCkNyn6jLZnAiJApw2N9XrIsXUAdThf01i7yrEuqUmDGc7/CexVWwEcgbQR97XQ+mcnqJpmJ/92B4Aw==", "deprecated": "no longer supported", "dependencies": { "@discordjs/collection": "^0.1.6", "@discordjs/form-data": "^3.0.1", "abort-controller": "^3.0.0", - "node-fetch": "^2.6.0", - "prism-media": "^1.2.2", + "node-fetch": "^2.6.1", + "prism-media": "^1.2.9", "setimmediate": "^1.0.5", "tweetnacl": "^1.0.3", - "ws": "^7.3.1" + "ws": "^7.4.4" }, "engines": { "node": ">=12.0.0" @@ -1678,14 +1678,14 @@ } }, "node_modules/prism-media": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/prism-media/-/prism-media-1.2.3.tgz", - "integrity": "sha512-fSrR66n0l6roW9Rx4rSLMyTPTjRTiXy5RVqDOurACQ6si1rKHHKDU5gwBJoCsIV0R3o9gi+K50akl/qyw1C74A==", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/prism-media/-/prism-media-1.3.2.tgz", + "integrity": "sha512-L6UsGHcT6i4wrQhFF1aPK+MNYgjRqR2tUoIqEY+CG1NqVkMjPRKzS37j9f8GiYPlD6wG9ruBj+q5Ax+bH8Ik1g==", "peerDependencies": { - "@discordjs/opus": "^0.3.3", + "@discordjs/opus": "^0.5.0", "ffmpeg-static": "^4.2.7 || ^3.0.0 || ^2.4.0", "node-opus": "^0.3.3", - "opusscript": "^0.0.7" + "opusscript": "^0.0.8" }, "peerDependenciesMeta": { "@discordjs/opus": { @@ -2450,9 +2450,9 @@ } }, "node_modules/ws": { - "version": "7.4.2", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.2.tgz", - "integrity": "sha512-T4tewALS3+qsrpGI/8dqNMLIVdq/g/85U98HPMa6F0m6xTbvhXU6RCQLqPH3+SlomNV/LdY6RXEbBpMH6EOJnA==", + "version": "7.5.7", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.7.tgz", + "integrity": "sha512-KMvVuFzpKBuiIXW3E4u3mySRO2/mCHSyZDJQM5NQ9Q9KHWHWh0NHgfbRMLLrceUK5qAL4ytALJbpRMjixFZh8A==", "engines": { "node": ">=8.3.0" }, @@ -2992,18 +2992,18 @@ "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" }, "discord.js": { - "version": "12.3.1", - "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-12.3.1.tgz", - "integrity": "sha512-mSFyV/mbvzH12UXdS4zadmeUf8IMQOo/YdunubG1wWt1xjWvtaJz/s9CGsFD2B5pTw1W/LXxxUbrQjIZ/xlUdw==", + "version": "12.5.3", + "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-12.5.3.tgz", + "integrity": "sha512-D3nkOa/pCkNyn6jLZnAiJApw2N9XrIsXUAdThf01i7yrEuqUmDGc7/CexVWwEcgbQR97XQ+mcnqJpmJ/92B4Aw==", "requires": { "@discordjs/collection": "^0.1.6", "@discordjs/form-data": "^3.0.1", "abort-controller": "^3.0.0", - "node-fetch": "^2.6.0", - "prism-media": "^1.2.2", + "node-fetch": "^2.6.1", + "prism-media": "^1.2.9", "setimmediate": "^1.0.5", "tweetnacl": "^1.0.3", - "ws": "^7.3.1" + "ws": "^7.4.4" } }, "dot-prop": { @@ -3761,9 +3761,9 @@ "dev": true }, "prism-media": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/prism-media/-/prism-media-1.2.3.tgz", - "integrity": "sha512-fSrR66n0l6roW9Rx4rSLMyTPTjRTiXy5RVqDOurACQ6si1rKHHKDU5gwBJoCsIV0R3o9gi+K50akl/qyw1C74A==", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/prism-media/-/prism-media-1.3.2.tgz", + "integrity": "sha512-L6UsGHcT6i4wrQhFF1aPK+MNYgjRqR2tUoIqEY+CG1NqVkMjPRKzS37j9f8GiYPlD6wG9ruBj+q5Ax+bH8Ik1g==", "requires": {} }, "proxy-addr": { @@ -4343,9 +4343,9 @@ } }, "ws": { - "version": "7.4.2", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.2.tgz", - "integrity": "sha512-T4tewALS3+qsrpGI/8dqNMLIVdq/g/85U98HPMa6F0m6xTbvhXU6RCQLqPH3+SlomNV/LdY6RXEbBpMH6EOJnA==", + "version": "7.5.7", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.7.tgz", + "integrity": "sha512-KMvVuFzpKBuiIXW3E4u3mySRO2/mCHSyZDJQM5NQ9Q9KHWHWh0NHgfbRMLLrceUK5qAL4ytALJbpRMjixFZh8A==", "requires": {} }, "xdg-basedir": { diff --git a/package.json b/package.json index 8a34d5c..eb6fc4d 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "dependencies": { "axios": "^0.21.1", "cors": "^2.8.5", - "discord.js": "^12.3.1", + "discord.js": "^12.5.3", "dotenv": "^8.2.0", "email-validator": "^2.0.4", "express": "^4.17.2", From 63bc250f1d2de6526fa724edab2ba93eacf8774e Mon Sep 17 00:00:00 2001 From: Bao Huynh Date: Wed, 16 Feb 2022 13:37:22 -0500 Subject: [PATCH 44/55] Add embed functionality to lattice command --- discord/lattice.js | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/discord/lattice.js b/discord/lattice.js index 3004ef6..4434a42 100644 --- a/discord/lattice.js +++ b/discord/lattice.js @@ -17,10 +17,11 @@ Axios.get(`https://revolutionuc-api.herokuapp.com/api/v2/lattice/skills`).then( async function latticeCommand(receivedMessage) { try { let user = await User.findByPk(receivedMessage.author.id); + const discordUsername = receivedMessage.author.username; if (!user) { receivedMessage.channel.send( - `Hey ${receivedMessage.author.username}, you are not checked in to RevUC, so either you hacked into the server, in which case you will be banned shortly, or you are an organizer, in which case, stop smurfing!` + `Hey ${discordUsername}, you are not checked in to RevUC, so either you hacked into the server, in which case you will be banned shortly, or you are an organizer, in which case, stop smurfing!` ); } else { const { data: profile } = await Axios.get( @@ -32,20 +33,27 @@ async function latticeCommand(receivedMessage) { } ); - // name and idea are strings, skills and lookingFor are arrays of strings + // `name` and `idea` are strings, `skills` and `lookingFor` are arrays of strings const { name, skills, idea, lookingFor, visible } = profile; - if (visible) { - receivedMessage.channel.send( - `${name}\nSkills: ${skills.join( - ", " - )}\nIdea: ${idea}\nLooking for: ${lookingFor.join(", ")}` - ); + if (!visible) { + receivedMessage.channel.send(`Hey ${discordUsername}, your lattice profile is hidden. If you want to show it here, please go to https://lattice.revolutionuc.com/profile and click on "Mark Visible".`) } else { - receivedMessage.channel.send( - `Hey ${receivedMessage.author.username}, your lattice profile is hidden. If you want to show it here, please go to https://lattice.revolutionuc.com/profile and click on "Mark Visible".` - ); + // Else, send an embed with the Hacker's profile info + const discordFullUsername = `${discordUsername}#${receivedMessage.author.discriminator}`; + const infoEmbed = new Discord.MessageEmbed() + .setColor("#008C8C") // Mars Green color + .setAuthor({ name: "RevUC Hacker Profile", iconURL: "https://assets.revolutionuc.com/logo-128.png" }) + .setTitle(`${name} @${discordFullUsername}`) + .addFields( + { name: "Idea", value: idea }, + { name: "Skills", value: skills.join(", ") }, + { name: "Looking for", value: lookingFor.join(", ") } + ) + + receivedMessage.channel.send({ embeds: [infoEmbed] }) } + } } catch (err) { console.error(err); From 5e5934b0629b7ecded3feb6909f70f19e7a430a5 Mon Sep 17 00:00:00 2001 From: sahupr Date: Wed, 16 Feb 2022 23:00:16 -0500 Subject: [PATCH 45/55] lattice profile embed + upgrading discordjs to 13 --- discord/client.js | 4 +- discord/index.js | 2 +- discord/lattice.js | 4 +- package-lock.json | 831 +++++++++++++++++++++++++-------------------- package.json | 2 +- 5 files changed, 460 insertions(+), 383 deletions(-) diff --git a/discord/client.js b/discord/client.js index 9f9520a..5b9b0ce 100644 --- a/discord/client.js +++ b/discord/client.js @@ -1,8 +1,8 @@ -const Discord = require('discord.js') +const { Discord, Client, Intents } = require('discord.js') const DISCORD_TOKEN = process.env.DISCORD_TOKEN -const client = new Discord.Client() +const client = new Client({intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES]}) client.login(DISCORD_TOKEN) diff --git a/discord/index.js b/discord/index.js index 1f8078b..f808f0d 100644 --- a/discord/index.js +++ b/discord/index.js @@ -4,7 +4,7 @@ const client = require("./client"); const help = require("./help"); const multiply = require("./multiply"); const react = require("./react"); -const countdown = require("./countdown"); +// const countdown = require("./countdown"); const checkin = require("./checkin"); const { score, top } = require("./score"); const revvit = require("./revvit"); diff --git a/discord/lattice.js b/discord/lattice.js index 4434a42..61a4b6d 100644 --- a/discord/lattice.js +++ b/discord/lattice.js @@ -1,6 +1,7 @@ const Discord = require("discord.js"); const Axios = require("axios").default; const { User } = require("../database"); +const { MessageEmbed } = require('discord.js'); const API_TOKEN = process.env.API_TOKEN; @@ -41,7 +42,7 @@ async function latticeCommand(receivedMessage) { } else { // Else, send an embed with the Hacker's profile info const discordFullUsername = `${discordUsername}#${receivedMessage.author.discriminator}`; - const infoEmbed = new Discord.MessageEmbed() + const infoEmbed = new MessageEmbed() .setColor("#008C8C") // Mars Green color .setAuthor({ name: "RevUC Hacker Profile", iconURL: "https://assets.revolutionuc.com/logo-128.png" }) .setTitle(`${name} @${discordFullUsername}`) @@ -50,7 +51,6 @@ async function latticeCommand(receivedMessage) { { name: "Skills", value: skills.join(", ") }, { name: "Looking for", value: lookingFor.join(", ") } ) - receivedMessage.channel.send({ embeds: [infoEmbed] }) } diff --git a/package-lock.json b/package-lock.json index d470b6c..98dd909 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "dependencies": { "axios": "^0.21.1", "cors": "^2.8.5", - "discord.js": "^12.5.3", + "discord.js": "^13.6.0", "dotenv": "^8.2.0", "email-validator": "^2.0.4", "express": "^4.17.2", @@ -25,22 +25,49 @@ "nodemon": "^2.0.7" } }, - "node_modules/@discordjs/collection": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.1.6.tgz", - "integrity": "sha512-utRNxnd9kSS2qhyivo9lMlt5qgAUasH2gb7BEOn6p0efFh24gjGomHzWKMAPn2hEReOPQZCJaRKoURwRotKucQ==" - }, - "node_modules/@discordjs/form-data": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@discordjs/form-data/-/form-data-3.0.1.tgz", - "integrity": "sha512-ZfFsbgEXW71Rw/6EtBdrP5VxBJy4dthyC0tpQKGKmYFImlmmrykO14Za+BiIVduwjte0jXEBlhSKf0MWbFp9Eg==", + "node_modules/@discordjs/builders": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-0.11.0.tgz", + "integrity": "sha512-ZTB8yJdJKrKlq44dpWkNUrAtEJEq0gqpb7ASdv4vmq6/mZal5kOv312hQ56I/vxwMre+VIkoHquNUAfnTbiYtg==", "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" + "@sindresorhus/is": "^4.2.0", + "discord-api-types": "^0.26.0", + "ts-mixer": "^6.0.0", + "tslib": "^2.3.1", + "zod": "^3.11.6" }, "engines": { - "node": ">= 6" + "node": ">=16.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/@discordjs/builders/node_modules/@sindresorhus/is": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.4.0.tgz", + "integrity": "sha512-QppPM/8l3Mawvh4rn9CNEYIU9bxpXUCRMaX9yUpvBk1nMKusLKpfXGDEKExKaPhLzcn3lzil7pR6rnJ11HgeRQ==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/is?sponsor=1" + } + }, + "node_modules/@discordjs/collection": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.4.0.tgz", + "integrity": "sha512-zmjq+l/rV35kE6zRrwe8BHqV78JvIh2ybJeZavBi5NySjWXqN3hmmAKg7kYMMXSeiWtSsMoZ/+MQi0DiQWy2lw==", + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/@sapphire/async-queue": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.2.0.tgz", + "integrity": "sha512-O5ND5Ljpef86X5oy8zXorQ754TMjWALcPSAgPBu4+76HLtDTrNoDyzU2uGE2G4A8Wv51u0MXHzGQ0WZ4GMtpIw==", + "engines": { + "node": ">=v14.0.0", + "npm": ">=7.0.0" } }, "node_modules/@sindresorhus/is": { @@ -79,17 +106,52 @@ "@types/node": "*" } }, + "node_modules/@types/debug": { + "version": "4.1.7", + "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.7.tgz", + "integrity": "sha512-9AonUzyTjXXhEOa0DnqpzZi6VHlqKMswga9EXjpXnnqxwLtdvPPtlO8evrI5D9S6asFRCQ6v+wpiUKbw+vKqyg==", + "dependencies": { + "@types/ms": "*" + } + }, "node_modules/@types/lodash": { "version": "4.14.168", "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.168.tgz", "integrity": "sha512-oVfRvqHV/V6D1yifJbVRU3TMp8OT6o6BG+U9MkwuJ3U8/CsDHvalRpsxBqivn71ztOFZBTfJMvETbqHiaNSj7Q==", "dev": true }, + "node_modules/@types/ms": { + "version": "0.7.31", + "resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.31.tgz", + "integrity": "sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA==" + }, "node_modules/@types/node": { "version": "14.14.25", "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.25.tgz", "integrity": "sha512-EPpXLOVqDvisVxtlbvzfyqSsFeQxltFbluZNRndIb8tr9KiBnYNLzrc1N3pyKUCww2RNrfHDViqDWWE1LCJQtQ==" }, + "node_modules/@types/node-fetch": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.1.tgz", + "integrity": "sha512-oMqjURCaxoSIsHSr1E47QHzbmzNR5rK8McHuNb11BOM9cHcIK3Avy0s/b2JlXHoQGTYS3NsvWzV1M0iK7l0wbA==", + "dependencies": { + "@types/node": "*", + "form-data": "^3.0.0" + } + }, + "node_modules/@types/node-fetch/node_modules/form-data": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz", + "integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/@types/sequelize": { "version": "4.28.9", "resolved": "https://registry.npmjs.org/@types/sequelize/-/sequelize-4.28.9.tgz", @@ -108,23 +170,20 @@ "integrity": "sha512-DaOWN1zf7j+8nHhqXhIgNmS+ltAC53NXqGxYuBhWqWgqolRhddKzfZU814lkHQSTG0IUfQxU7Cg0gb8fFWo2mA==", "dev": true }, + "node_modules/@types/ws": { + "version": "8.2.2", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.2.2.tgz", + "integrity": "sha512-NOn5eIcgWLOo6qW8AcuLZ7G8PycXu0xTxxkS6Q18VWFxgPUSOwV0pBj2a/4viNZVu25i7RIB7GttdkAIUUXOOg==", + "dependencies": { + "@types/node": "*" + } + }, "node_modules/abbrev": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", "dev": true }, - "node_modules/abort-controller": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", - "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", - "dependencies": { - "event-target-shim": "^5.0.0" - }, - "engines": { - "node": ">=6.5" - } - }, "node_modules/accepts": { "version": "1.3.7", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", @@ -138,35 +197,21 @@ } }, "node_modules/ansi-align": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.0.tgz", - "integrity": "sha512-ZpClVKqXN3RGBmKibdfWzqCY4lnjEuoNzU5T0oEFpfd/z5qJHVarukridD4juLO2FXMiwUQxr9WqQtaYa8XRYw==", - "dev": true, - "dependencies": { - "string-width": "^3.0.0" - } - }, - "node_modules/ansi-align/node_modules/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==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.1.tgz", + "integrity": "sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w==", "dev": true, "dependencies": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - }, - "engines": { - "node": ">=6" + "string-width": "^4.1.0" } }, "node_modules/ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, "engines": { - "node": ">=6" + "node": ">=8" } }, "node_modules/ansi-styles": { @@ -184,11 +229,6 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/any-promise": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", - "integrity": "sha1-q8av7tzqUugJzcA3au0845Y10X8=" - }, "node_modules/anymatch": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", @@ -213,11 +253,11 @@ "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" }, "node_modules/axios": { - "version": "0.21.1", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz", - "integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==", + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", + "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", "dependencies": { - "follow-redirects": "^1.10.0" + "follow-redirects": "^1.14.0" } }, "node_modules/babel-runtime": { @@ -639,23 +679,33 @@ "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" }, + "node_modules/discord-api-types": { + "version": "0.26.1", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.26.1.tgz", + "integrity": "sha512-T5PdMQ+Y1MEECYMV5wmyi9VEYPagEDEi4S0amgsszpWY0VB9JJ/hEvM6BgLhbdnKky4gfmZEXtEEtojN8ZKJQQ==", + "deprecated": "No longer supported. Install the latest release!", + "engines": { + "node": ">=12" + } + }, "node_modules/discord.js": { - "version": "12.5.3", - "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-12.5.3.tgz", - "integrity": "sha512-D3nkOa/pCkNyn6jLZnAiJApw2N9XrIsXUAdThf01i7yrEuqUmDGc7/CexVWwEcgbQR97XQ+mcnqJpmJ/92B4Aw==", - "deprecated": "no longer supported", + "version": "13.6.0", + "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-13.6.0.tgz", + "integrity": "sha512-tXNR8zgsEPxPBvGk3AQjJ9ljIIC6/LOPjzKwpwz8Y1Q2X66Vi3ZqFgRHYwnHKC0jC0F+l4LzxlhmOJsBZDNg9g==", "dependencies": { - "@discordjs/collection": "^0.1.6", - "@discordjs/form-data": "^3.0.1", - "abort-controller": "^3.0.0", + "@discordjs/builders": "^0.11.0", + "@discordjs/collection": "^0.4.0", + "@sapphire/async-queue": "^1.1.9", + "@types/node-fetch": "^2.5.12", + "@types/ws": "^8.2.2", + "discord-api-types": "^0.26.0", + "form-data": "^4.0.0", "node-fetch": "^2.6.1", - "prism-media": "^1.2.9", - "setimmediate": "^1.0.5", - "tweetnacl": "^1.0.3", - "ws": "^7.4.4" + "ws": "^8.4.0" }, "engines": { - "node": ">=12.0.0" + "node": ">=16.6.0", + "npm": ">=7.0.0" } }, "node_modules/dot-prop": { @@ -702,12 +752,6 @@ "node": ">4.0" } }, - "node_modules/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 - }, "node_modules/encodeurl": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", @@ -747,14 +791,6 @@ "node": ">= 0.6" } }, - "node_modules/event-target-shim": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", - "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", - "engines": { - "node": ">=6" - } - }, "node_modules/express": { "version": "4.17.2", "resolved": "https://registry.npmjs.org/express/-/express-4.17.2.tgz", @@ -851,9 +887,9 @@ "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" }, "node_modules/follow-redirects": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.1.tgz", - "integrity": "sha512-SSG5xmZh1mkPGyKzjZP8zLjltIfpW32Y5QpdNJyjcfGxK3qo3NDDkZOZSFiGn1A6SclQxY9GzEwAHQ3dmYRWpg==", + "version": "1.14.8", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.8.tgz", + "integrity": "sha512-1x0S9UVJHsQprFcEC/qnNzBLcIxsjAV905f/UkQxbclCsoTWlacCNOpQa/anodLl2uaEKFhfWOvM2Qg77+15zA==", "funding": [ { "type": "individual", @@ -869,6 +905,19 @@ } } }, + "node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/forwarded": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", @@ -912,9 +961,9 @@ } }, "node_modules/glob-parent": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", - "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dev": true, "dependencies": { "is-glob": "^4.0.1" @@ -1041,9 +1090,9 @@ } }, "node_modules/inflection": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/inflection/-/inflection-1.12.0.tgz", - "integrity": "sha1-ogCTVlbW9fa8TcdQLhrstwMihBY=", + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/inflection/-/inflection-1.13.2.tgz", + "integrity": "sha512-cmZlljCRTBFouT8UzMzrGcVEvkv6D/wBdcdKG7J1QH5cXjtU75Dm+P27v9EKu/Y43UYyCJd1WC4zLebRrC8NBw==", "engines": [ "node >= 0.4.0" ] @@ -1100,15 +1149,6 @@ "node": ">=0.10.0" } }, - "node_modules/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, - "engines": { - "node": ">=4" - } - }, "node_modules/is-glob": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", @@ -1213,9 +1253,9 @@ } }, "node_modules/lodash": { - "version": "4.17.20", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", - "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==" + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, "node_modules/lowercase-keys": { "version": "1.0.1", @@ -1348,9 +1388,9 @@ } }, "node_modules/moment-timezone": { - "version": "0.5.33", - "resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.33.tgz", - "integrity": "sha512-PTc2vcT8K9J5/9rDEPe5czSIKgLoGsH8UNpA4qZTVw0Vd/Uz19geE9abbIOQKaAQFcnQ3v5YEXrbSc5BpshH+w==", + "version": "0.5.34", + "resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.34.tgz", + "integrity": "sha512-3zAEHh2hKUs3EXLESx/wsgw6IQdusOT8Bxm3D9UrHPQR7zlMmzwybC8zHEM1tQ4LJwP7fcxrWr8tuBg05fFCbg==", "dependencies": { "moment": ">= 2.9.0" }, @@ -1372,11 +1412,22 @@ } }, "node_modules/node-fetch": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", - "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==", + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "dependencies": { + "whatwg-url": "^5.0.0" + }, "engines": { "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } } }, "node_modules/nodemon": { @@ -1433,9 +1484,9 @@ } }, "node_modules/normalize-url": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.0.tgz", - "integrity": "sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ==", + "version": "4.5.1", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.1.tgz", + "integrity": "sha512-9UZCFRHQdNrfTpGg8+1INIg93B6zE0aXMVFkw1WFwvO4SlZywU6aLg5Of0Ap/PgcbSw4LNxvMWXMeugwMCX0AA==", "dev": true, "engines": { "node": ">=8" @@ -1562,9 +1613,9 @@ } }, "node_modules/pg-connection-string": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.4.0.tgz", - "integrity": "sha512-3iBXuv7XKvxeMrIgym7njT+HlZkwZqqGX4Bu9cci8xHZNT+Um1gWKqCsAzcC0d95rcKMU5WBg6YRUcHyV0HZKQ==" + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.5.0.tgz", + "integrity": "sha512-r5o/V/ORTA6TmUnyWZR9nCj1klXCO2CEKNRlVuJptZe85QuhFayC7WeMic7ndayT5IRIR0S0xFxFi2ousartlQ==" }, "node_modules/pg-hstore": { "version": "2.3.3", @@ -1677,31 +1728,6 @@ "node": ">=4" } }, - "node_modules/prism-media": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/prism-media/-/prism-media-1.3.2.tgz", - "integrity": "sha512-L6UsGHcT6i4wrQhFF1aPK+MNYgjRqR2tUoIqEY+CG1NqVkMjPRKzS37j9f8GiYPlD6wG9ruBj+q5Ax+bH8Ik1g==", - "peerDependencies": { - "@discordjs/opus": "^0.5.0", - "ffmpeg-static": "^4.2.7 || ^3.0.0 || ^2.4.0", - "node-opus": "^0.3.3", - "opusscript": "^0.0.8" - }, - "peerDependenciesMeta": { - "@discordjs/opus": { - "optional": true - }, - "ffmpeg-static": { - "optional": true - }, - "node-opus": { - "optional": true - }, - "opusscript": { - "optional": true - } - } - }, "node_modules/proxy-addr": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", @@ -1868,12 +1894,9 @@ } }, "node_modules/retry-as-promised": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/retry-as-promised/-/retry-as-promised-3.2.0.tgz", - "integrity": "sha512-CybGs60B7oYU/qSQ6kuaFmRd9sTZ6oXSc0toqePvV74Ac6/IFZSI1ReFQmtCN+uvW1Mtqdwpvt/LGOiCBAY2Mg==", - "dependencies": { - "any-promise": "^1.3.0" - } + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/retry-as-promised/-/retry-as-promised-5.0.0.tgz", + "integrity": "sha512-6S+5LvtTl2ggBumk04hBo/4Uf6fRJUwIgunGZ7CYEBCeufGFW1Pu6ucUf/UskHeWOIsUcLOGLFXPig5tR5V1nA==" }, "node_modules/safe-buffer": { "version": "5.2.1", @@ -1971,28 +1994,39 @@ "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" }, "node_modules/sequelize": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/sequelize/-/sequelize-6.5.0.tgz", - "integrity": "sha512-owBt8fnzVy8E1OvyCyfCdVk7OOLyPVrBCMEf+CvRReC5oCyo+UqeXCtwaex9L6LM9ifZ1i3TG3sFeM5MgLK0CQ==", + "version": "6.16.1", + "resolved": "https://registry.npmjs.org/sequelize/-/sequelize-6.16.1.tgz", + "integrity": "sha512-YFGqrwkmEhSbpZBxay5+PRKMiZNNUJzgIixCyFkLm9+/5Rqq5jBADEjTAC8RYHzwsOGNboYh18imXrYNCjBZCQ==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/sequelize" + } + ], "dependencies": { - "debug": "^4.1.1", - "dottie": "^2.0.0", - "inflection": "1.12.0", - "lodash": "^4.17.20", - "moment": "^2.26.0", - "moment-timezone": "^0.5.31", - "retry-as-promised": "^3.2.0", - "semver": "^7.3.2", - "sequelize-pool": "^6.0.0", + "@types/debug": "^4.1.7", + "debug": "^4.3.3", + "dottie": "^2.0.2", + "inflection": "^1.13.1", + "lodash": "^4.17.21", + "moment": "^2.29.1", + "moment-timezone": "^0.5.34", + "pg-connection-string": "^2.5.0", + "retry-as-promised": "^5.0.0", + "semver": "^7.3.5", + "sequelize-pool": "^7.1.0", "toposort-class": "^1.0.1", - "uuid": "^8.1.0", - "validator": "^10.11.0", + "uuid": "^8.3.2", + "validator": "^13.7.0", "wkx": "^0.5.0" }, "engines": { "node": ">=10.0.0" }, "peerDependenciesMeta": { + "ibm_db": { + "optional": true + }, "mariadb": { "optional": true }, @@ -2005,6 +2039,9 @@ "pg-hstore": { "optional": true }, + "snowflake-sdk": { + "optional": true + }, "sqlite3": { "optional": true }, @@ -2014,17 +2051,17 @@ } }, "node_modules/sequelize-pool": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/sequelize-pool/-/sequelize-pool-6.1.0.tgz", - "integrity": "sha512-4YwEw3ZgK/tY/so+GfnSgXkdwIJJ1I32uZJztIEgZeAO6HMgj64OzySbWLgxj+tXhZCJnzRfkY9gINw8Ft8ZMg==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/sequelize-pool/-/sequelize-pool-7.1.0.tgz", + "integrity": "sha512-G9c0qlIWQSK29pR/5U2JF5dDQeqqHRragoyahj/Nx4KOOQ3CPPfzxnfqFPCSB7x5UgjOgnZ61nSxz+fjDpRlJg==", "engines": { "node": ">= 10.0.0" } }, "node_modules/sequelize/node_modules/debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", "dependencies": { "ms": "2.1.2" }, @@ -2043,9 +2080,9 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "node_modules/sequelize/node_modules/semver": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz", - "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==", + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", "dependencies": { "lru-cache": "^6.0.0" }, @@ -2070,11 +2107,6 @@ "node": ">= 0.8.0" } }, - "node_modules/setimmediate": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", - "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=" - }, "node_modules/setprototypeof": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", @@ -2124,15 +2156,6 @@ "node": ">=8" } }, - "node_modules/string-width/node_modules/ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/string-width/node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", @@ -2160,18 +2183,6 @@ "node": ">=8" } }, - "node_modules/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, - "dependencies": { - "ansi-regex": "^4.1.0" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/strip-json-comments": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", @@ -2251,10 +2262,20 @@ "nodetouch": "bin/nodetouch.js" } }, - "node_modules/tweetnacl": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", - "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==" + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" + }, + "node_modules/ts-mixer": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/ts-mixer/-/ts-mixer-6.0.0.tgz", + "integrity": "sha512-nXIb1fvdY5CBSrDIblLn73NW0qRDk5yJ0Sk1qPBF560OdJfQp9jhl+0tzcY09OZ9U+6GpeoI9RjwoIKFIoB9MQ==" + }, + "node_modules/tslib": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", + "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" }, "node_modules/type-fest": { "version": "0.8.1", @@ -2311,9 +2332,9 @@ "dev": true }, "node_modules/underscore": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.12.0.tgz", - "integrity": "sha512-21rQzss/XPMjolTiIezSu3JAjgagXKROtNrYFEOWK109qY1Uv2tVjPTZ1ci2HgvQDA16gHYSthQIJfB+XId/rQ==" + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.2.tgz", + "integrity": "sha512-ekY1NhRzq0B08g4bGuX4wd2jZx5GnKz6mKSqFL4nqBlfyMGiG10gDFhDTMEfYmDL6Jy0FUIZp7wiRB+0BP7J2g==" }, "node_modules/unique-string": { "version": "2.0.0", @@ -2396,9 +2417,9 @@ } }, "node_modules/validator": { - "version": "10.11.0", - "resolved": "https://registry.npmjs.org/validator/-/validator-10.11.0.tgz", - "integrity": "sha512-X/p3UZerAIsbBfN/IwahhYaBbY68EN/UQBWHtsbXGT5bfrH/p4NQzUCG1kF/rtKaNpnJ7jAu6NGTdSNtyNIXMw==", + "version": "13.7.0", + "resolved": "https://registry.npmjs.org/validator/-/validator-13.7.0.tgz", + "integrity": "sha512-nYXQLCBkpJ8X6ltALua9dRrZDHVYxjJ1wgskNt1lH9fzGjs3tgojGSCBjmEPwkWS1y29+DrizMTW19Pr9uB2nw==", "engines": { "node": ">= 0.10" } @@ -2411,6 +2432,20 @@ "node": ">= 0.8" } }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, "node_modules/widest-line": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz", @@ -2450,11 +2485,11 @@ } }, "node_modules/ws": { - "version": "7.5.7", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.7.tgz", - "integrity": "sha512-KMvVuFzpKBuiIXW3E4u3mySRO2/mCHSyZDJQM5NQ9Q9KHWHWh0NHgfbRMLLrceUK5qAL4ytALJbpRMjixFZh8A==", + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.5.0.tgz", + "integrity": "sha512-BWX0SWVgLPzYwF8lTzEy1egjhS4S4OEAHfsO8o65WOVsrnSRGaSiUaa9e0ggGlkMTtBlmOpEXiie9RUcBO86qg==", "engines": { - "node": ">=8.3.0" + "node": ">=10.0.0" }, "peerDependencies": { "bufferutil": "^4.0.1", @@ -2490,24 +2525,46 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + }, + "node_modules/zod": { + "version": "3.11.6", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.11.6.tgz", + "integrity": "sha512-daZ80A81I3/9lIydI44motWe6n59kRBfNzTuS2bfzVh1nAXi667TOTWWtatxyG+fwgNUiagSj/CWZwRRbevJIg==", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } } }, "dependencies": { - "@discordjs/collection": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.1.6.tgz", - "integrity": "sha512-utRNxnd9kSS2qhyivo9lMlt5qgAUasH2gb7BEOn6p0efFh24gjGomHzWKMAPn2hEReOPQZCJaRKoURwRotKucQ==" - }, - "@discordjs/form-data": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@discordjs/form-data/-/form-data-3.0.1.tgz", - "integrity": "sha512-ZfFsbgEXW71Rw/6EtBdrP5VxBJy4dthyC0tpQKGKmYFImlmmrykO14Za+BiIVduwjte0jXEBlhSKf0MWbFp9Eg==", + "@discordjs/builders": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-0.11.0.tgz", + "integrity": "sha512-ZTB8yJdJKrKlq44dpWkNUrAtEJEq0gqpb7ASdv4vmq6/mZal5kOv312hQ56I/vxwMre+VIkoHquNUAfnTbiYtg==", "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" + "@sindresorhus/is": "^4.2.0", + "discord-api-types": "^0.26.0", + "ts-mixer": "^6.0.0", + "tslib": "^2.3.1", + "zod": "^3.11.6" + }, + "dependencies": { + "@sindresorhus/is": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.4.0.tgz", + "integrity": "sha512-QppPM/8l3Mawvh4rn9CNEYIU9bxpXUCRMaX9yUpvBk1nMKusLKpfXGDEKExKaPhLzcn3lzil7pR6rnJ11HgeRQ==" + } } }, + "@discordjs/collection": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.4.0.tgz", + "integrity": "sha512-zmjq+l/rV35kE6zRrwe8BHqV78JvIh2ybJeZavBi5NySjWXqN3hmmAKg7kYMMXSeiWtSsMoZ/+MQi0DiQWy2lw==" + }, + "@sapphire/async-queue": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.2.0.tgz", + "integrity": "sha512-O5ND5Ljpef86X5oy8zXorQ754TMjWALcPSAgPBu4+76HLtDTrNoDyzU2uGE2G4A8Wv51u0MXHzGQ0WZ4GMtpIw==" + }, "@sindresorhus/is": { "version": "0.14.0", "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz", @@ -2538,17 +2595,51 @@ "@types/node": "*" } }, + "@types/debug": { + "version": "4.1.7", + "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.7.tgz", + "integrity": "sha512-9AonUzyTjXXhEOa0DnqpzZi6VHlqKMswga9EXjpXnnqxwLtdvPPtlO8evrI5D9S6asFRCQ6v+wpiUKbw+vKqyg==", + "requires": { + "@types/ms": "*" + } + }, "@types/lodash": { "version": "4.14.168", "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.168.tgz", "integrity": "sha512-oVfRvqHV/V6D1yifJbVRU3TMp8OT6o6BG+U9MkwuJ3U8/CsDHvalRpsxBqivn71ztOFZBTfJMvETbqHiaNSj7Q==", "dev": true }, + "@types/ms": { + "version": "0.7.31", + "resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.31.tgz", + "integrity": "sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA==" + }, "@types/node": { "version": "14.14.25", "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.25.tgz", "integrity": "sha512-EPpXLOVqDvisVxtlbvzfyqSsFeQxltFbluZNRndIb8tr9KiBnYNLzrc1N3pyKUCww2RNrfHDViqDWWE1LCJQtQ==" }, + "@types/node-fetch": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.1.tgz", + "integrity": "sha512-oMqjURCaxoSIsHSr1E47QHzbmzNR5rK8McHuNb11BOM9cHcIK3Avy0s/b2JlXHoQGTYS3NsvWzV1M0iK7l0wbA==", + "requires": { + "@types/node": "*", + "form-data": "^3.0.0" + }, + "dependencies": { + "form-data": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz", + "integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==", + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + } + } + } + }, "@types/sequelize": { "version": "4.28.9", "resolved": "https://registry.npmjs.org/@types/sequelize/-/sequelize-4.28.9.tgz", @@ -2567,20 +2658,20 @@ "integrity": "sha512-DaOWN1zf7j+8nHhqXhIgNmS+ltAC53NXqGxYuBhWqWgqolRhddKzfZU814lkHQSTG0IUfQxU7Cg0gb8fFWo2mA==", "dev": true }, + "@types/ws": { + "version": "8.2.2", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.2.2.tgz", + "integrity": "sha512-NOn5eIcgWLOo6qW8AcuLZ7G8PycXu0xTxxkS6Q18VWFxgPUSOwV0pBj2a/4viNZVu25i7RIB7GttdkAIUUXOOg==", + "requires": { + "@types/node": "*" + } + }, "abbrev": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", "dev": true }, - "abort-controller": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", - "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", - "requires": { - "event-target-shim": "^5.0.0" - } - }, "accepts": { "version": "1.3.7", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", @@ -2591,31 +2682,18 @@ } }, "ansi-align": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.0.tgz", - "integrity": "sha512-ZpClVKqXN3RGBmKibdfWzqCY4lnjEuoNzU5T0oEFpfd/z5qJHVarukridD4juLO2FXMiwUQxr9WqQtaYa8XRYw==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.1.tgz", + "integrity": "sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w==", "dev": true, "requires": { - "string-width": "^3.0.0" - }, - "dependencies": { - "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" - } - } + "string-width": "^4.1.0" } }, "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true }, "ansi-styles": { @@ -2627,11 +2705,6 @@ "color-convert": "^2.0.1" } }, - "any-promise": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", - "integrity": "sha1-q8av7tzqUugJzcA3au0845Y10X8=" - }, "anymatch": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", @@ -2653,11 +2726,11 @@ "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" }, "axios": { - "version": "0.21.1", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz", - "integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==", + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", + "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", "requires": { - "follow-redirects": "^1.10.0" + "follow-redirects": "^1.14.0" } }, "babel-runtime": { @@ -2991,19 +3064,25 @@ "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" }, + "discord-api-types": { + "version": "0.26.1", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.26.1.tgz", + "integrity": "sha512-T5PdMQ+Y1MEECYMV5wmyi9VEYPagEDEi4S0amgsszpWY0VB9JJ/hEvM6BgLhbdnKky4gfmZEXtEEtojN8ZKJQQ==" + }, "discord.js": { - "version": "12.5.3", - "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-12.5.3.tgz", - "integrity": "sha512-D3nkOa/pCkNyn6jLZnAiJApw2N9XrIsXUAdThf01i7yrEuqUmDGc7/CexVWwEcgbQR97XQ+mcnqJpmJ/92B4Aw==", + "version": "13.6.0", + "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-13.6.0.tgz", + "integrity": "sha512-tXNR8zgsEPxPBvGk3AQjJ9ljIIC6/LOPjzKwpwz8Y1Q2X66Vi3ZqFgRHYwnHKC0jC0F+l4LzxlhmOJsBZDNg9g==", "requires": { - "@discordjs/collection": "^0.1.6", - "@discordjs/form-data": "^3.0.1", - "abort-controller": "^3.0.0", + "@discordjs/builders": "^0.11.0", + "@discordjs/collection": "^0.4.0", + "@sapphire/async-queue": "^1.1.9", + "@types/node-fetch": "^2.5.12", + "@types/ws": "^8.2.2", + "discord-api-types": "^0.26.0", + "form-data": "^4.0.0", "node-fetch": "^2.6.1", - "prism-media": "^1.2.9", - "setimmediate": "^1.0.5", - "tweetnacl": "^1.0.3", - "ws": "^7.4.4" + "ws": "^8.4.0" } }, "dot-prop": { @@ -3041,12 +3120,6 @@ "resolved": "https://registry.npmjs.org/email-validator/-/email-validator-2.0.4.tgz", "integrity": "sha512-gYCwo7kh5S3IDyZPLZf6hSS0MnZT8QmJFqYvbqlDZSbwdZlY6QZWxJ4i/6UhITOJ4XzyI647Bm2MXKCLqnJ4nQ==" }, - "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 - }, "encodeurl": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", @@ -3077,11 +3150,6 @@ "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" }, - "event-target-shim": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", - "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==" - }, "express": { "version": "4.17.2", "resolved": "https://registry.npmjs.org/express/-/express-4.17.2.tgz", @@ -3173,9 +3241,19 @@ } }, "follow-redirects": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.1.tgz", - "integrity": "sha512-SSG5xmZh1mkPGyKzjZP8zLjltIfpW32Y5QpdNJyjcfGxK3qo3NDDkZOZSFiGn1A6SclQxY9GzEwAHQ3dmYRWpg==" + "version": "1.14.8", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.8.tgz", + "integrity": "sha512-1x0S9UVJHsQprFcEC/qnNzBLcIxsjAV905f/UkQxbclCsoTWlacCNOpQa/anodLl2uaEKFhfWOvM2Qg77+15zA==" + }, + "form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + } }, "forwarded": { "version": "0.2.0", @@ -3204,9 +3282,9 @@ } }, "glob-parent": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", - "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dev": true, "requires": { "is-glob": "^4.0.1" @@ -3303,9 +3381,9 @@ "dev": true }, "inflection": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/inflection/-/inflection-1.12.0.tgz", - "integrity": "sha1-ogCTVlbW9fa8TcdQLhrstwMihBY=" + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/inflection/-/inflection-1.13.2.tgz", + "integrity": "sha512-cmZlljCRTBFouT8UzMzrGcVEvkv6D/wBdcdKG7J1QH5cXjtU75Dm+P27v9EKu/Y43UYyCJd1WC4zLebRrC8NBw==" }, "inherits": { "version": "2.0.4", @@ -3347,12 +3425,6 @@ "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", "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 - }, "is-glob": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", @@ -3433,9 +3505,9 @@ } }, "lodash": { - "version": "4.17.20", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", - "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==" + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, "lowercase-keys": { "version": "1.0.1", @@ -3528,9 +3600,9 @@ "integrity": "sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ==" }, "moment-timezone": { - "version": "0.5.33", - "resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.33.tgz", - "integrity": "sha512-PTc2vcT8K9J5/9rDEPe5czSIKgLoGsH8UNpA4qZTVw0Vd/Uz19geE9abbIOQKaAQFcnQ3v5YEXrbSc5BpshH+w==", + "version": "0.5.34", + "resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.34.tgz", + "integrity": "sha512-3zAEHh2hKUs3EXLESx/wsgw6IQdusOT8Bxm3D9UrHPQR7zlMmzwybC8zHEM1tQ4LJwP7fcxrWr8tuBg05fFCbg==", "requires": { "moment": ">= 2.9.0" } @@ -3546,9 +3618,12 @@ "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==" }, "node-fetch": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", - "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==" + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "requires": { + "whatwg-url": "^5.0.0" + } }, "nodemon": { "version": "2.0.7", @@ -3584,9 +3659,9 @@ "dev": true }, "normalize-url": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.0.tgz", - "integrity": "sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ==", + "version": "4.5.1", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.1.tgz", + "integrity": "sha512-9UZCFRHQdNrfTpGg8+1INIg93B6zE0aXMVFkw1WFwvO4SlZywU6aLg5Of0Ap/PgcbSw4LNxvMWXMeugwMCX0AA==", "dev": true }, "object-assign": { @@ -3677,9 +3752,9 @@ } }, "pg-connection-string": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.4.0.tgz", - "integrity": "sha512-3iBXuv7XKvxeMrIgym7njT+HlZkwZqqGX4Bu9cci8xHZNT+Um1gWKqCsAzcC0d95rcKMU5WBg6YRUcHyV0HZKQ==" + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.5.0.tgz", + "integrity": "sha512-r5o/V/ORTA6TmUnyWZR9nCj1klXCO2CEKNRlVuJptZe85QuhFayC7WeMic7ndayT5IRIR0S0xFxFi2ousartlQ==" }, "pg-hstore": { "version": "2.3.3", @@ -3760,12 +3835,6 @@ "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=", "dev": true }, - "prism-media": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/prism-media/-/prism-media-1.3.2.tgz", - "integrity": "sha512-L6UsGHcT6i4wrQhFF1aPK+MNYgjRqR2tUoIqEY+CG1NqVkMjPRKzS37j9f8GiYPlD6wG9ruBj+q5Ax+bH8Ik1g==", - "requires": {} - }, "proxy-addr": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", @@ -3896,12 +3965,9 @@ } }, "retry-as-promised": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/retry-as-promised/-/retry-as-promised-3.2.0.tgz", - "integrity": "sha512-CybGs60B7oYU/qSQ6kuaFmRd9sTZ6oXSc0toqePvV74Ac6/IFZSI1ReFQmtCN+uvW1Mtqdwpvt/LGOiCBAY2Mg==", - "requires": { - "any-promise": "^1.3.0" - } + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/retry-as-promised/-/retry-as-promised-5.0.0.tgz", + "integrity": "sha512-6S+5LvtTl2ggBumk04hBo/4Uf6fRJUwIgunGZ7CYEBCeufGFW1Pu6ucUf/UskHeWOIsUcLOGLFXPig5tR5V1nA==" }, "safe-buffer": { "version": "5.2.1", @@ -3979,29 +4045,31 @@ } }, "sequelize": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/sequelize/-/sequelize-6.5.0.tgz", - "integrity": "sha512-owBt8fnzVy8E1OvyCyfCdVk7OOLyPVrBCMEf+CvRReC5oCyo+UqeXCtwaex9L6LM9ifZ1i3TG3sFeM5MgLK0CQ==", + "version": "6.16.1", + "resolved": "https://registry.npmjs.org/sequelize/-/sequelize-6.16.1.tgz", + "integrity": "sha512-YFGqrwkmEhSbpZBxay5+PRKMiZNNUJzgIixCyFkLm9+/5Rqq5jBADEjTAC8RYHzwsOGNboYh18imXrYNCjBZCQ==", "requires": { - "debug": "^4.1.1", - "dottie": "^2.0.0", - "inflection": "1.12.0", - "lodash": "^4.17.20", - "moment": "^2.26.0", - "moment-timezone": "^0.5.31", - "retry-as-promised": "^3.2.0", - "semver": "^7.3.2", - "sequelize-pool": "^6.0.0", + "@types/debug": "^4.1.7", + "debug": "^4.3.3", + "dottie": "^2.0.2", + "inflection": "^1.13.1", + "lodash": "^4.17.21", + "moment": "^2.29.1", + "moment-timezone": "^0.5.34", + "pg-connection-string": "^2.5.0", + "retry-as-promised": "^5.0.0", + "semver": "^7.3.5", + "sequelize-pool": "^7.1.0", "toposort-class": "^1.0.1", - "uuid": "^8.1.0", - "validator": "^10.11.0", + "uuid": "^8.3.2", + "validator": "^13.7.0", "wkx": "^0.5.0" }, "dependencies": { "debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", "requires": { "ms": "2.1.2" } @@ -4012,9 +4080,9 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "semver": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz", - "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==", + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", "requires": { "lru-cache": "^6.0.0" } @@ -4022,9 +4090,9 @@ } }, "sequelize-pool": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/sequelize-pool/-/sequelize-pool-6.1.0.tgz", - "integrity": "sha512-4YwEw3ZgK/tY/so+GfnSgXkdwIJJ1I32uZJztIEgZeAO6HMgj64OzySbWLgxj+tXhZCJnzRfkY9gINw8Ft8ZMg==" + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/sequelize-pool/-/sequelize-pool-7.1.0.tgz", + "integrity": "sha512-G9c0qlIWQSK29pR/5U2JF5dDQeqqHRragoyahj/Nx4KOOQ3CPPfzxnfqFPCSB7x5UgjOgnZ61nSxz+fjDpRlJg==" }, "serve-static": { "version": "1.14.2", @@ -4037,11 +4105,6 @@ "send": "0.17.2" } }, - "setimmediate": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", - "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=" - }, "setprototypeof": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", @@ -4085,12 +4148,6 @@ "strip-ansi": "^6.0.0" }, "dependencies": { - "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", - "dev": true - }, "emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", @@ -4114,15 +4171,6 @@ } } }, - "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": "2.0.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", @@ -4178,10 +4226,20 @@ "nopt": "~1.0.10" } }, - "tweetnacl": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", - "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==" + "tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" + }, + "ts-mixer": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/ts-mixer/-/ts-mixer-6.0.0.tgz", + "integrity": "sha512-nXIb1fvdY5CBSrDIblLn73NW0qRDk5yJ0Sk1qPBF560OdJfQp9jhl+0tzcY09OZ9U+6GpeoI9RjwoIKFIoB9MQ==" + }, + "tslib": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", + "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" }, "type-fest": { "version": "0.8.1", @@ -4234,9 +4292,9 @@ } }, "underscore": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.12.0.tgz", - "integrity": "sha512-21rQzss/XPMjolTiIezSu3JAjgagXKROtNrYFEOWK109qY1Uv2tVjPTZ1ci2HgvQDA16gHYSthQIJfB+XId/rQ==" + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.2.tgz", + "integrity": "sha512-ekY1NhRzq0B08g4bGuX4wd2jZx5GnKz6mKSqFL4nqBlfyMGiG10gDFhDTMEfYmDL6Jy0FUIZp7wiRB+0BP7J2g==" }, "unique-string": { "version": "2.0.0", @@ -4298,15 +4356,29 @@ "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" }, "validator": { - "version": "10.11.0", - "resolved": "https://registry.npmjs.org/validator/-/validator-10.11.0.tgz", - "integrity": "sha512-X/p3UZerAIsbBfN/IwahhYaBbY68EN/UQBWHtsbXGT5bfrH/p4NQzUCG1kF/rtKaNpnJ7jAu6NGTdSNtyNIXMw==" + "version": "13.7.0", + "resolved": "https://registry.npmjs.org/validator/-/validator-13.7.0.tgz", + "integrity": "sha512-nYXQLCBkpJ8X6ltALua9dRrZDHVYxjJ1wgskNt1lH9fzGjs3tgojGSCBjmEPwkWS1y29+DrizMTW19Pr9uB2nw==" }, "vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" }, + "webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" + }, + "whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", + "requires": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, "widest-line": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz", @@ -4343,9 +4415,9 @@ } }, "ws": { - "version": "7.5.7", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.7.tgz", - "integrity": "sha512-KMvVuFzpKBuiIXW3E4u3mySRO2/mCHSyZDJQM5NQ9Q9KHWHWh0NHgfbRMLLrceUK5qAL4ytALJbpRMjixFZh8A==", + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.5.0.tgz", + "integrity": "sha512-BWX0SWVgLPzYwF8lTzEy1egjhS4S4OEAHfsO8o65WOVsrnSRGaSiUaa9e0ggGlkMTtBlmOpEXiie9RUcBO86qg==", "requires": {} }, "xdg-basedir": { @@ -4363,6 +4435,11 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + }, + "zod": { + "version": "3.11.6", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.11.6.tgz", + "integrity": "sha512-daZ80A81I3/9lIydI44motWe6n59kRBfNzTuS2bfzVh1nAXi667TOTWWtatxyG+fwgNUiagSj/CWZwRRbevJIg==" } } } diff --git a/package.json b/package.json index eb6fc4d..c3c889b 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "dependencies": { "axios": "^0.21.1", "cors": "^2.8.5", - "discord.js": "^12.5.3", + "discord.js": "^13.6.0", "dotenv": "^8.2.0", "email-validator": "^2.0.4", "express": "^4.17.2", From 572dfe660509c43d5c51e8473fe61d5935bb5beb Mon Sep 17 00:00:00 2001 From: sahupr Date: Fri, 18 Feb 2022 22:05:33 -0500 Subject: [PATCH 46/55] message deletion on checkin and checkin errors --- discord/checkin.js | 15 ++++++++++----- discord/index.js | 2 +- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/discord/checkin.js b/discord/checkin.js index 58c1c51..d3b88e3 100644 --- a/discord/checkin.js +++ b/discord/checkin.js @@ -131,33 +131,38 @@ module.exports = async function (message) { }); } - message.channel.send( + var checkin_success = await message.channel.send( `${name} <${censoredEmail}> ${ responses_success[getRandomInt(max_success)] }` ); + checkin_success.delete({ timeout: 20000 }); } catch (err) { console.error(err); if (err.response?.status === 404) { - message.channel.send( + var err_404 = await message.channel.send( `${censoredEmail} ${ responses_404[getRandomInt(max_404)] }, please make sure you are registered with us or contact an organizer` ); + err_404.delete({ timeout: 20000 }); } else if (err.response?.status === 403) { - message.channel.send( + var err_403 = await message.channel.send( `${censoredEmail} ${responses_403[getRandomInt(max_403)]}` ); + err_403.delete({ timeout: 20000 }); } else { - message.channel.send( + var err_other = await message.channel.send( `Error checking in ${censoredEmail}, please try again later or contact an organizer` ); + err_other.delete({ timeout: 20000 }); } } message.delete({ timeout: 2000 }); } else { - message.channel.send(`${censoredEmail} is not a valid email`); + var invalid_email = await message.channel.send(`${censoredEmail} is not a valid email`); message.delete({ timeout: 3000 }); + invalid_email.delete({ timeout: 30000 }); } }; diff --git a/discord/index.js b/discord/index.js index f808f0d..3c3d426 100644 --- a/discord/index.js +++ b/discord/index.js @@ -56,7 +56,7 @@ client.once("ready", () => { // } }); -client.on("message", async (receivedMessage) => { +client.on("messageCreate", async (receivedMessage) => { if (receivedMessage.author == client.user) { return; } From 38115a9f39b7e488b83c541b7e541e5986f6effb Mon Sep 17 00:00:00 2001 From: sahupr Date: Wed, 23 Feb 2022 20:18:36 -0500 Subject: [PATCH 47/55] timeout-for 30 seconds --- discord/checkin.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/discord/checkin.js b/discord/checkin.js index d3b88e3..4140f98 100644 --- a/discord/checkin.js +++ b/discord/checkin.js @@ -34,6 +34,10 @@ const getRandomInt = (max) => { return Math.floor(Math.random() * Math.floor(max)); }; +function deleteTime(){ + setTimout(()=> msg.delete(), 10000); +} + const responses_success = [ "is checked in!", ", welcome to the main event!", @@ -136,7 +140,7 @@ module.exports = async function (message) { responses_success[getRandomInt(max_success)] }` ); - checkin_success.delete({ timeout: 20000 }); + setTimeout(() => checkin_success.delete(), 30000); } catch (err) { console.error(err); if (err.response?.status === 404) { @@ -150,12 +154,12 @@ module.exports = async function (message) { var err_403 = await message.channel.send( `${censoredEmail} ${responses_403[getRandomInt(max_403)]}` ); - err_403.delete({ timeout: 20000 }); + setTimeout(() => err_403.delete(), 30000); } else { var err_other = await message.channel.send( `Error checking in ${censoredEmail}, please try again later or contact an organizer` ); - err_other.delete({ timeout: 20000 }); + setTimeout(() => err_other.delete(), 30000); } } @@ -163,6 +167,6 @@ module.exports = async function (message) { } else { var invalid_email = await message.channel.send(`${censoredEmail} is not a valid email`); message.delete({ timeout: 3000 }); - invalid_email.delete({ timeout: 30000 }); + setTimeout(() => invalid_email.delete(), 30000); } }; From 671efea3206832fbae571f0e5032142d45992b8f Mon Sep 17 00:00:00 2001 From: sahupr Date: Wed, 23 Feb 2022 20:38:49 -0500 Subject: [PATCH 48/55] timeout-for 30 seconds - removed the unused function --- discord/checkin.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/discord/checkin.js b/discord/checkin.js index 4140f98..d40264c 100644 --- a/discord/checkin.js +++ b/discord/checkin.js @@ -34,10 +34,6 @@ const getRandomInt = (max) => { return Math.floor(Math.random() * Math.floor(max)); }; -function deleteTime(){ - setTimout(()=> msg.delete(), 10000); -} - const responses_success = [ "is checked in!", ", welcome to the main event!", From 309c836d9df7e8525e75512ff4048858c743034f Mon Sep 17 00:00:00 2001 From: Dev Agrawal Date: Wed, 23 Feb 2022 21:04:39 -0500 Subject: [PATCH 49/55] one of the error messages were deleting instantly --- discord/checkin.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/discord/checkin.js b/discord/checkin.js index d40264c..e3fa9f2 100644 --- a/discord/checkin.js +++ b/discord/checkin.js @@ -145,7 +145,7 @@ module.exports = async function (message) { responses_404[getRandomInt(max_404)] }, please make sure you are registered with us or contact an organizer` ); - err_404.delete({ timeout: 20000 }); + setTimeout(() => err_404.delete(), 30000); } else if (err.response?.status === 403) { var err_403 = await message.channel.send( `${censoredEmail} ${responses_403[getRandomInt(max_403)]}` @@ -159,10 +159,10 @@ module.exports = async function (message) { } } - message.delete({ timeout: 2000 }); + message.delete(); } else { var invalid_email = await message.channel.send(`${censoredEmail} is not a valid email`); - message.delete({ timeout: 3000 }); + message.delete(); setTimeout(() => invalid_email.delete(), 30000); } }; From 4cb667e485190b1ffa3879214663b0d0ea737ad4 Mon Sep 17 00:00:00 2001 From: Dev Agrawal Date: Sat, 26 Feb 2022 09:49:56 -0500 Subject: [PATCH 50/55] removed timestamps from event --- database/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database/index.js b/database/index.js index 2ff2aec..73c5eeb 100644 --- a/database/index.js +++ b/database/index.js @@ -43,7 +43,7 @@ exports.Event = sequelize.define(`event`, { type: DataTypes.INTEGER, allowNull: false, }, -}); +}, { timestamps: false }); exports.Claim = sequelize.define("claim", { userID: { From 05160a7b13749be27b9bc4962d9142c9bbc7f9f9 Mon Sep 17 00:00:00 2001 From: Dev Agrawal Date: Sat, 26 Feb 2022 09:51:53 -0500 Subject: [PATCH 51/55] example code --- discord/help.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discord/help.js b/discord/help.js index a1b753a..c8f4aa5 100644 --- a/discord/help.js +++ b/discord/help.js @@ -16,7 +16,7 @@ function helpCommand(args, receivedMessage) { receivedMessage.channel.send('Type the email you registered with out on the checkin channel to check in to RevolutionUC. Ex: `foo@bar.com`') break case 'codes': - receivedMessage.channel.send('Use the bot command `!claim CODE` to claim your participation points') + receivedMessage.channel.send('Use the bot command `!claim EXAMPLECODE` to claim your participation points') break case 'sponsor': case 'mentor': From 4d09f5d27ace0b3500f6892b03205d867be89589 Mon Sep 17 00:00:00 2001 From: Dev Agrawal Date: Sat, 26 Feb 2022 10:17:02 -0500 Subject: [PATCH 52/55] added lattice help --- discord/help.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/discord/help.js b/discord/help.js index c8f4aa5..c029eb9 100644 --- a/discord/help.js +++ b/discord/help.js @@ -6,7 +6,7 @@ function helpCommand(args, receivedMessage) { if(args.length < 1){ isAdminChannel ? receivedMessage.channel.send('specify what you need help for:\n `!revvit` \n `!help checkin` \n `!help codes` \n `!help sponsor` \n `!help mentor` \n `!help judge` \n `!help minor` \nor `!background` to know more about me! ') : - receivedMessage.channel.send('specify what you need help for:\n `!revvit` \n `!help checkin` \n `!help codes` \nor `!background` to know more about me! ') + receivedMessage.channel.send('specify what you need help for:\n `!revvit` \n `!help checkin` \n `!help codes` \n `!help lattice` \nor `!background` to know more about me! ') } else { const topic = args[0] @@ -26,6 +26,9 @@ function helpCommand(args, receivedMessage) { receivedMessage.channel.send(`Use the bot command \`!${topic} \` to add an attendee to the database and allow them to check in to the discord server`) break } + case 'lattice': + receivedMessage.channel.send('Use the bot command `!lattice ` to show your Lattice hacker profile') + break default: receivedMessage.channel.send('Invalid bot command') throw new Error(`Invalid command`) From 997a795b0f719020daf5358f89c63716566d1c7a Mon Sep 17 00:00:00 2001 From: Dev Agrawal Date: Sat, 26 Feb 2022 10:19:46 -0500 Subject: [PATCH 53/55] updated claim responses --- discord/score.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/discord/score.js b/discord/score.js index 339628f..f1e682e 100644 --- a/discord/score.js +++ b/discord/score.js @@ -14,23 +14,23 @@ const getRandomInt = (max) => Math.floor(Math.random() * Math.floor(max)); function generateResponse(name, event, score, responseType) { const claim_success = [ - `Good job attending ${event?.name}, you now have ${score} points. Now go attend another one.`, + `Good job attending ${event?.name} ${name}, you now have ${score} points. Now go attend another one.`, `Ayy nice job ${name}. Hope you enjoyed ${event?.name}! You now have ${score} points.`, ]; const code_wrong = [ //Doesn't take points for now `Stop cheating ${name}!`, - `Nice try!`, + `Nice try ${name}, but that code is wrong!`, `I’m sorry ${name}, but we never gave you that code. Please try a code that works.`, `${name} Did you just make that up? Because I sure don’t know this code.`, ]; const code_claimed = [ //Doesn't take points for now - `Oops, sorry that code has already been claimed`, - `You’ve already attended ${event?.name}, good job!`, - `Unless you invented time travel, you can’t attend ${event?.name} twice`, + `Oops, sorry ${name} that code has already been claimed`, + `You’ve already attended ${event?.name}, good job ${name}!`, + `Yo ${name}, unless you invented time travel, you can’t attend ${event?.name} twice`, ]; if (responseType === RESPONSE.SUCCESS) { From ec131035f214671f1a63b9b62ea1d1e238f921d0 Mon Sep 17 00:00:00 2001 From: Dev Agrawal Date: Sat, 26 Feb 2022 12:17:13 -0500 Subject: [PATCH 54/55] fixed help --- discord/help.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discord/help.js b/discord/help.js index c029eb9..203299f 100644 --- a/discord/help.js +++ b/discord/help.js @@ -27,7 +27,7 @@ function helpCommand(args, receivedMessage) { break } case 'lattice': - receivedMessage.channel.send('Use the bot command `!lattice ` to show your Lattice hacker profile') + receivedMessage.channel.send('Use the bot command `!lattice` to show your Lattice hacker profile') break default: receivedMessage.channel.send('Invalid bot command') From be7f07403392aa2db1df98b1421c0562c323d672 Mon Sep 17 00:00:00 2001 From: Dev Agrawal Date: Sat, 26 Feb 2022 13:15:19 -0500 Subject: [PATCH 55/55] claim deletes all messages --- discord/index.js | 10 +++++++--- discord/score.js | 18 ++++++++++++------ 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/discord/index.js b/discord/index.js index 3c3d426..a4ac5b2 100644 --- a/discord/index.js +++ b/discord/index.js @@ -13,6 +13,7 @@ const lattice = require("./lattice"); const checkin_prv = require("./checkin_prv"); const CHECKIN_CHANNEL_ID = process.env.CHECKIN_CHANNEL_ID; +const CLAIM_CHANNEL_ID = process.env.CLAIM_CHANNEL_ID; client.once("ready", () => { console.log("the bot is online!"); @@ -66,6 +67,12 @@ client.on("messageCreate", async (receivedMessage) => { await checkin(receivedMessage); return; } + + if (receivedMessage.channel.id == CLAIM_CHANNEL_ID) { + // run the checkIn function + await score(receivedMessage); + return; + } /* if (receivedMessage.guild.id in stats === false) { stats[receivedMessage.guild.id] = {}; @@ -120,9 +127,6 @@ function processCommand(receivedMessage) { case "countdown": countdown(arguments, receivedMessage); break; - case "claim": - score(arguments, receivedMessage); - break; case "top": top(arguments, receivedMessage); break; diff --git a/discord/score.js b/discord/score.js index f1e682e..5f72f83 100644 --- a/discord/score.js +++ b/discord/score.js @@ -46,16 +46,22 @@ function generateResponse(name, event, score, responseType) { /** * - * @param {string[]} args * @param {Discord.Message} receivedMessage */ -async function score(args, receivedMessage) { - if (receivedMessage.channel.id != CLAIM_CHANNEL_ID) { - console.log("wrong channel"); - return; - } +async function score(receivedMessage) { + const fullCommand = receivedMessage.content.substr(1); //remove the leading/bot identifying character + const splitCommand = fullCommand.split(" "); //split the message up into pieces for each space + const primaryCommand = splitCommand[0]; //take the first string from the split + const args = splitCommand.slice(1); //all other words are arguments/parameters for the primaryCommand try { + if (primaryCommand != `claim`) { + receivedMessage.channel.send( + `Wrong command ${receivedMessage.author.username}, please use the command \`!claim EXAMPLECODE\`` + ); + return; + } + let user = await User.findByPk(receivedMessage.author.id); if (!user) {