From c09484f617cd2f62045bc16dcea230ee8d2e2979 Mon Sep 17 00:00:00 2001 From: Braeden57 Date: Tue, 9 Nov 2021 09:16:19 -0800 Subject: [PATCH] 1.8.7 allowedRoles --- LPS.js | 435 ++++++++++++++++++++++++++++++---------------- beta-config.json | 2 +- config.json | 2 +- package-lock.json | 198 +++++++++++---------- package.json | 2 +- 5 files changed, 401 insertions(+), 238 deletions(-) diff --git a/LPS.js b/LPS.js index a86d216..2a51a66 100644 --- a/LPS.js +++ b/LPS.js @@ -37,8 +37,8 @@ class Bot { if (!args[0]==null||!args[0]==undefined&&args[1]==null||args[1]==undefined) return message.author.send(`You must provide a \`login token\` ${message.author}!`); user = await this.dbo.collection("users").findOne({"user.email":args[0]}).then(user => user); if (user==null||user==undefined) return message.author.send(`Cannot find the email \`${args[0]}\` ${message.author}!`); - - // Check discord Login Token + + // Check discord Token if (args[1]==user.user.discordLoginToken) { // Modify user to include user.user.discord let discord = { @@ -415,6 +415,70 @@ class Bot { return message.channel.send(`You are in the community \`${community.community.name}\` ${message.author}!`); } + async setRole(message, args) { + if (args.length==0) return message.channel.send(`You must provide a role ${message.author}!`); + let roleid = args[0].replace('<@&', '').replace('>', ''); + let role = message.guild.roles.cache.find(x => x.id == roleid); + if (role == undefined) { + return message.channel.send(`Uh Oh! The role ${args[0]} connot be found.`); + } else { + let guild = await this.dbo.collection("prefixes").findOne({"server.serverID":message.guild.id}).then(guild => guild); + if (guild.server.allowedRole!=undefined&&guild.server.allowedRoles.includes(roleid)) return message.channel.send(`The role ${args[0]} has already been added ${message.author}!`); + this.dbo.collection("prefixes").updateOne({"server.serverID":message.guild.id},{$push:{"server.allowedRoles":roleid},$set:{"server.hasCustomRoles":true}},function(err, res) { + if (err) throw err; + return message.channel.send(`Successfuly added ${args[0]} to allowed roles ${message.author}!`); + }); + } + } + + async removeRole(message, args) { + if (args.length==0) return message.channel.send(`You must provide a role ${message.author}!`); + let roleid = args[0].replace('<@&', '').replace('>', ''); + let role = message.guild.roles.cache.find(x => x.id == roleid); + if (role == undefined) { + return message.channel.send(`Uh Oh! The role ${args[0]} connot be found.`); + } else { + let guild = await this.dbo.collection("prefixes").findOne({"server.serverID":message.guild.id}).then(guild => guild); + if (guild.server.allowedRoles.length==0) return message.channel.send(`There are no roles to be removed ${message.author}!`); + if (!guild.server.allowedRoles.includes(roleid)) return message.channel.send(`The role ${args[0]} is not added to your roles ${message.author}!`); + for (let i = 0; i < guild.server.allowedRoles.length; i++) { + if (guild.server.allowedRoles[i]==roleid) { + if ((guild.server.allowedRoles.length-1)==0) { + this.dbo.collection("prefixes").updateOne({"server.serverID":message.guild.id},{$pull:{"server.allowedRoles":roleid},$set:{"server.hasCustomRoles":false}},function(err, res) { + if (err) throw err; + return message.channel.send(`Successfuly removed ${args[0]} from allowed roles ${message.author}! There are no more allowed roles.`); + }); + } else if ((guild.server.allowedRoles.length-1)>0) { + this.dbo.collection("prefixes").updateOne({"server.serverID":message.guild.id},{$pull:{"server.allowedRoles":roleid}},function(err, res) { + if (err) throw err; + return message.channel.send(`Successfuly removed ${args[0]} from allowed roles ${message.author}!`); + }); + } + } + } + } + } + + async roles(message) { + let guild = await this.dbo.collection("prefixes").findOne({"server.serverID":message.guild.id}).then(guild => guild); + if (guild.server.hasCustomRoles==false) { + return message.channel.send('There are no roles set for the bot.'); + } + let rolesEmbed = new Discord.MessageEmbed() + .setColor('#0099ff') + .setTitle('Lines Police CAD') + .setURL('https://discord.gg/w2g2FFmHbF') + .setAuthor('LPS Website Support', 'https://raw.githubusercontent.com/Linesmerrill/police-cad/master/lines-police-server.png', 'https://discord.gg/jgUW656v2t') + .setDescription('Allowed Roles:') + + let roles = "Allowed Roles:"; + for (let i = 0; i < guild.server.allowedRoles.length; i++) { + if (guild.server.allowedRoles[i] == undefined) break; + roles = roles + `\n<@&${guild.server.allowedRoles[i]}>`; + } + return message.channel.send(roles); + } + async setChannel(message, args) { if (args.length==0) return message.channel.send(`You must provide a channel ${message.author}!`); let channel = client.channels.cache.get(args[0].replace('<#', '').replace('>', '')); @@ -434,47 +498,49 @@ class Bot { }); } - async getPrefix(message) { + async getGuildPresets(message) { let prefix; + let channelId; + let customeRoleStatus; if (message.channel.type!="dm") { let guild = await this.dbo.collection("prefixes").findOne({"server.serverID":message.guild.id}).then(guild => guild); - // If not prefix, generate server default + // If guild not found, generate guild default if (!guild) { let newGuild = { server: { serverID: message.guild.id, - prefix: this.config.defaultPrefix + prefix: this.config.defaultPrefix, + hasCustomeRoles: false, } } this.dbo.collection("prefixes").insertOne(newGuild, function(err, res) { if (err) throw err; }); - prefix = newGuild.server.serverID; - } else prefix = guild.server.prefix; - } else prefix = this.config.defaultPrefix; - return prefix + prefix = newGuild.server.prefix; + channelId = newGuild.server.preferredChannelId; + customeRoleStatus = newGuild.server.hasCustomRoles; + } else { + prefix = guild.server.prefix; + channelId = guild.server.preferredChannelId; + customeRoleStatus = guild.server.hasCustomRoles; + } + } else { + prefix = this.config.defaultPrefix; + channelId = null; + customeRoleStatus = false; + } + return {prefix, channelId, customeRoleStatus}; } - async getPreferredChannel(message) { - let channelId; - if (message.channel.type!="dm") { - let guild = await this.dbo.collection("prefixes").findOne({"server.serverID":message.guild.id}).then(guild => guild); - - if (!guild) { - let newGuild = { - server: { - serverID: message.guild.id, - prefix: this.config.defaultPrefix - } - } - this.dbo.collection("prefixes").insertOne(newGuild, function(err, res) { - if (err) throw err; - }); - prefix = newGuild.server.serverID; - } else channelId = guild.server.preferredChannelId; - } else channelId = null; - return channelId; + async checkRoleStatus(message) { + let hasRole = false; + let guild = await this.dbo.collection("prefixes").findOne({"server.serverID":message.guild.id}).then(guild => guild); + // If user has one of any in the list of allowed roles, hasRole is true + for (let i = 0; i < guild.server.allowedRoles.length; i++) { + if (message.member.roles.cache.some(role => role.id == guild.server.allowedRoles[i])) hasRole = true; + } + return hasRole; } main() { @@ -484,131 +550,210 @@ class Bot { // Basic Commands client.on('message', async (message) => { - this.getPrefix(message).then(prefix => { - if (!message.content.startsWith(prefix) || message.author.bot) return; + let { prefix, channelId, customeRoleStatus } = await this.getGuildPresets(message); + if (!message.content.startsWith(prefix) || message.author.bot) return; - this.getPreferredChannel(message).then(channelId => { - if (channelId != null && message.channel.id!=channelId) { - return message.channel.send(`This is not the preferred channel, please use the channel <#${channelId}> ${message.author}!`); + if (channelId != null && message.channel.id!=channelId) { + return message.channel.send(`This is not the preferred channel, please use the channel <#${channelId}> ${message.author}!`); + } + const args = message.content.slice(prefix.length).trim().split(' '); + const command = args.shift().toLowerCase(); + + // Valid Statuses Embed + const validStatus = new Discord.MessageEmbed() + .setColor('#0099ff') + .setTitle('Lines Police CAD') + .setURL('https://www.linespolice-cad.com/') + .setAuthor('LPS Website Support', 'https://raw.githubusercontent.com/Linesmerrill/police-cad/master/lines-police-server.png', 'https://discord.gg/jgUW656v2t') + .setDescription('Valid Statuses') + .addFields( + { name: 'Statuses:', value: ` + 10-8 | \`On Duty\` + 10-7 | \`Off Duty\` + 10-6 | \`Busy\` + 10-11 | \`Traffic Stop\` + 10-23 | \`Arrive on Scene\` + 10-97 | \`In Route\` + 10-15 | \`Subject in Custody\` + 10-70 | \`Foot Pursuit\` + 10-80 | \`Vehicle Pursiut\` + ` + } + ) + + // Help Embed + const help = new Discord.MessageEmbed() + .setColor('#0099ff') + .setTitle('**Commands:**') + .setURL('https://discord.gg/w2g2FFmHbF') + .setAuthor('LPS Website & Bot Support', 'https://raw.githubusercontent.com/Linesmerrill/police-cad/master/lines-police-server.png', 'https://discord.gg/jgUW656v2t') + .setDescription('Lines Police CAD Bot Commands') + .addFields( + { name: `**${prefix}help**`, value: '\`Displays this help page\`', inline: true }, + { name: `**${prefix}stats**`, value: '\`Displays current Bot status\`', inline: true }, + { name: `**${prefix}ping**`, value: '\`Responds with Pong to check Bot responce\`', inline: true }, + { name: `**${prefix}setPrefix** `, value: '\`Sets new prefix (Admin only command)\`', inline: true }, + { name: `**${prefix}login** `, value: '\`Login to LPS account (DM only command)\`', inline: true }, + { name: `**${prefix}logout**`, value: '\`Logs out of your current logged in account\`', inline: true }, + { name: `**${prefix}validStatus**`, value: '\`Shows list of valid statuses to updade to\`', inline: true }, + { name: `**${prefix}checkStatus** `, value: '\`Leave user blank to check own status\`', inline: true }, + { name: `**${prefix}updateStatus** `, value: '\`Updates your status\`', inline: true }, + { name: `**${prefix}account**`, value: '\`returns logged in account\`', inline: true }, + { name: `**${prefix}penalCodes**`, value: '\`Provides Link to penal codes\`', inline: true }, + { name: `**${prefix}namedb** `, value: '\`Searches in your community for name (dob only required if not in a community)\`', inline: true }, + { name: `**${prefix}platedb** `, value: '\`Searches in your community for Vehicles with the given Licence plate #\`', inline: true }, + { name: `**${prefix}firearmdb** `, value: '\`Searches for Firearms with the given Serial #\`', inline: true }, + { name: `**${prefix}panic**`, value: '\`Enables or disables your panic button\`', inline: true }, + { name: `**${prefix}joincommunity** `, value: '\`Joined a community with the given code\`', inline: true }, + { name: `**${prefix}leavecommunity**`, value: '\`Leaves your current active community\`', inline: true }, + { name: `**${prefix}community**`, value: '\`Returns the name of the Community your currenty in\`', inline: true }, + { name: `**${prefix}setChannel** `, value: `\`Sets preferred channel allowed for commands (Admin only command)\``, inline: true }, + { name: `**${prefix}removeChannel**`, value: `\`Removes preferred channel (Admin only command)\``, inline: true }, + { name: `**${prefix}setRole **`, value: `\`Adds role to list of allowed roles (Admin only command)\``, inline: true }, + { name: `**${prefix}removeRole **`, value: `\`Removes role from list of allowed roles (Admin only command)\``, inline: true }, + { name: `**${prefix}roles**`, value: `\`Shows a list of allowed roles\``, inline: true } + ) + + const stats = new Discord.MessageEmbed() + .setColor('#0099ff') + .setTitle("Current LPC-Bot Statistics") + .setURL('https://discord.gg/w2g2FFmHbF') + .addField(" \u200B ", "**Channels** : ` " + `${client.channels.cache.size}` + " `") + .addField(" \u200B ", "**Servers** : ` " + `${client.guilds.cache.size}` + " `") + .addField(" \u200B ", "**Users** : ` " + `${client.users.cache.size}` + " `") + + if (command == 'ping') message.channel.send('Pong!'); + if (command == 'help') message.channel.send(help); + if (command == 'stats') message.channel.send(stats); + if (command == 'setprefix') { + if (message.channel.type=="dm") return message.author.send(`You cannot set a prefix in a dm ${message.author}!`); + if(!message.member.hasPermission(["ADMINISTRATOR","MANAGE_GUILD"])) return message.channel.send(`You don't have permission to used this command ${message.author}`); + this.newPrefix(message, args); + } + if (command == 'setchannel') { + if (message.channel.type=="dm") return message.author.send(`You cannot set a channel in a dm ${message.author}!`); + if (!message.member.hasPermission(["ADMINISTRATOR","MANAGE_GUILD"])) return message.channel.send(`You don't have permission to used this command ${message.author}`); + this.setChannel(message, args); + } + if (command == 'removechannel') { + if (message.channel.type=="dm") return message.author.send(`You cannot remove a channel in a dm ${message.author}!`); + if (!message.member.hasPermission(["ADMINISTRATOR","MANAGE_GUILD"])) return message.channel.send(`You don't have permission to used this command ${message.author}`); + this.removeChannel(message); + } + if (command == 'setrole') { + if (message.channel.type=="dm") return message.author.send(`You cannot set a role in a dm ${message.author}!`); + if (!message.member.hasPermission(["ADMINISTRATOR","MANAGE_GUILD"])) return message.channel.send(`You don't have permission to used this command ${message.author}`); + this.setRole(message, args); + } + if (command == 'removerole') { + if (message.channel.type=="dm") return message.author.send(`You cannot remove a role in a dm ${message.author}!`); + if (!message.member.hasPermission(["ADMINISTRATOR","MANAGE_GUILD"])) return message.channel.send(`You don't have permission to used this command ${message.author}`); + this.removeRole(message, args); + } + if (command == 'roles') { + if (message.channel.type=="dm") return message.author.send(`You cannot see allowed roles in a dm ${message.author}!`); + this.roles(message); + } + + // Login + if (command == 'login') { + if (message.channel.type=="text") return message.channel.send(`You must direct message me to use this command ${message.author}!`); + this.remoteLogin(message, args); + } + if (command == 'logout') this.remoteLogout(message); + if (command == 'validstatus') message.channel.send(validStatus); + if (command == 'checkstatus') { + if (customeRoleStatus) { + let hasRole = await this.checkRoleStatus(message); + if (hasRole) { + this.checkStatus(message, args); + } else { + return message.channel.send(`You don't permission to use this command ${message.author}!`); } - const args = message.content.slice(prefix.length).trim().split(' '); - const command = args.shift().toLowerCase(); - - // Valid Statuses Embed - const validStatus = new Discord.MessageEmbed() - .setColor('#0099ff') - .setTitle('Lines Police CAD') - .setURL('https://www.linespolice-cad.com/') - .setAuthor('LPS Website Support', 'https://raw.githubusercontent.com/Linesmerrill/police-cad/master/lines-police-server.png', 'https://discord.gg/jgUW656v2t') - .setDescription('Valid Statuses') - .addFields( - { name: 'Statuses:', value: ` - 10-8 | \`On Duty\` - 10-7 | \`Off Duty\` - 10-6 | \`Busy\` - 10-11 | \`Traffic Stop\` - 10-23 | \`Arrive on Scene\` - 10-97 | \`In Route\` - 10-15 | \`Subject in Custody\` - 10-70 | \`Foot Pursuit\` - 10-80 | \`Vehicle Pursiut\` - ` - } - ) - - // Help Embed - const help = new Discord.MessageEmbed() - .setColor('#0099ff') - .setTitle('**Commands:**') - .setURL('https://discord.gg/w2g2FFmHbF') - .setAuthor('LPS Website & Bot Support', 'https://raw.githubusercontent.com/Linesmerrill/police-cad/master/lines-police-server.png', 'https://discord.gg/jgUW656v2t') - .setDescription('Lines Police CAD Bot Commands') - .addFields( - { name: `**${prefix}help**`, value: '\`Displays this help page\`', inline: true }, - { name: `**${prefix}stats**`, value: '\`Displays current Bot status\`', inline: true }, - { name: `**${prefix}ping**`, value: '\`Responds with Pong to check Bot responce\`', inline: true }, - { name: `**${prefix}setPrefix** `, value: '\`Sets new prefix (Admin only command)\`', inline: true }, - { name: `**${prefix}login** `, value: '\`Login to LPS account (DM only command)\`', inline: true }, - { name: `**${prefix}logout**`, value: '\`Logs out of your current logged in account\`', inline: true }, - { name: `**${prefix}validStatus**`, value: '\`Shows list of valid statuses to updade to\`', inline: true }, - { name: `**${prefix}checkStatus** `, value: '\`Leave user blank to check own status\`', inline: true }, - { name: `**${prefix}updateStatus** `, value: '\`Updates your status\`', inline: true }, - { name: `**${prefix}account**`, value: '\`returns logged in account\`', inline: true }, - { name: `**${prefix}penalCodes**`, value: '\`Provides Link to penal codes\`', inline: true }, - { name: `**${prefix}namedb** `, value: '\`Searches in your community for name (dob only required if not in a community)\`', inline: true }, - { name: `**${prefix}platedb** `, value: '\`Searches in your community for Vehicles with the given Licence plate #\`', inline: true }, - { name: `**${prefix}firearmdb** `, value: '\`Searches for Firearms with the given Serial #\`', inline: true }, - { name: `**${prefix}panic**`, value: '\`Enables or disables your panic button\`', inline: true }, - { name: `**${prefix}joincommunity** `, value: '\`Joined a community with the given code\`', inline: true }, - { name: `**${prefix}leavecommunity**`, value: '\`Leaves your current active community\`', inline: true }, - { name: `**${prefix}community**`, value: '\`Returns the name of the Community your currenty in\`', inline: true }, - { name: `**${prefix}setChannel** `, value: `\`Sets preferred channel allowed for commands (Admin only command)\``, inline: true }, - { name: `**${prefix}removeChannel**`, value: `\`Removes preferred channel (Admin only command)\``, inline: true } - ) - - const stats = new Discord.MessageEmbed() - .setColor('#0099ff') - .setTitle("Current LPC-Bot Statistics") - .setURL('https://discord.gg/w2g2FFmHbF') - .addField(" \u200B ", "**Channels** : ` " + `${client.channels.cache.size}` + " `") - .addField(" \u200B ", "**Servers** : ` " + `${client.guilds.cache.size}` + " `") - .addField(" \u200B ", "**Users** : ` " + `${client.users.cache.size}` + " `") - - if (command == 'ping') message.channel.send('Pong!'); - if (command == 'help') message.channel.send(help); - if (command == 'stats') message.channel.send(stats); - if (command == 'setprefix') { - if (message.channel.type=="dm") return message.author.send(`You cannot set a prefix in a dm ${message.author}!`); - if(!message.member.hasPermission(["ADMINISTRATOR","MANAGE_GUILD"])) return message.channel.send(`You don't have permission to used this command ${message.author}`); - this.newPrefix(message, args); + } else { + this.checkStatus(message, args); + } + } + if (command == 'updatestatus') { + if (customeRoleStatus) { + let hasRole = await this.checkRoleStatus(message); + if (hasRole) { + this.updateStatus(message, args, prefix); + } else { + return message.channel.send(`You don't permission to use this command ${message.author}!`); } - if (command == 'setchannel') { - if (message.channel.type=="dm") return message.author.send(`You cannot set a prefix in a dm ${message.author}!`); - if (!message.member.hasPermission(["ADMINISTRATOR","MANAGE_GUILD"])) return message.channel.send(`You don't have permission to used this command ${message.author}`); - this.setChannel(message, args); + } else { + this.updateStatus(message, args, prefix); + } + } + if (command == 'account') this.account(message); + if (command == 'penalcodes') return message.channel.send('https://www.linespolice-cad.com/penal-code'); + if (command == 'namedb') { + if (customeRoleStatus) { + let hasRole = await this.checkRoleStatus(message); + if (hasRole) { + this.nameSearch(message, args); + } else { + return message.channel.send(`You don't permission to use this command ${message.author}!`); } - if (command == 'removechannel') { - if (message.channel.type=="dm") return message.author.send(`You cannot set a prefix in a dm ${message.author}!`); - if (!message.member.hasPermission(["ADMINISTRATOR","MANAGE_GUILD"])) return message.channel.send(`You don't have permission to used this command ${message.author}`); - this.removeChannel(message); + } else { + this.nameSearch(message, args); + } + } + if (command == 'platedb') { + if (customeRoleStatus) { + let hasRole = await this.checkRoleStatus(message); + if (hasRole) { + this.plateSearch(message, args); + } else { + return message.channel.send(`You don't permission to use this command ${message.author}!`); } + } else { + this.plateSearch(message, args); + } + } + if (command == 'firearmdb') { + if (customeRoleStatus) { + let hasRole = await this.checkRoleStatus(message); + if (hasRole) { + this.firearmSearch(message, args); + } else { + return message.channel.send(`You don't permission to use this command ${message.author}!`); + } + } else { + this.firearmSearch(message, args); + } + } + if (command == 'panic') { + if (customeRoleStatus) { + let hasRole = await this.checkRoleStatus(message); + if (hasRole) { + this.enablePanic(message); + } else { + return message.channel.send(`You don't permission to use this command ${message.author}!`); + } + } else { + this.enablePanic(message); + } + } + if (command == 'joincommunity') this.joinCommunity(message, args); + if (command == 'leavecommunity') this.leaveCommunity(message); + if (command == 'community') this.community(message); - // Login - if (command == 'login') { - if (message.channel.type=="text") return message.channel.send(`You must direct message me to use this command ${message.author}!`); - this.remoteLogin(message, args); - } - if (command == 'logout') this.remoteLogout(message); - if (command == 'validstatus') message.channel.send(validStatus); - if (command == 'checkstatus') this.checkStatus(message, args); - if (command == 'updatestatus') this.updateStatus(message, args, prefix); - if (command == 'account') this.account(message); - if (command == 'penalcodes') return message.channel.send('https://www.linespolice-cad.com/penal-code'); - if (command == 'namedb') this.nameSearch(message, args); - if (command == 'platedb') this.plateSearch(message, args); - if (command == 'firearmdb') this.firearmSearch(message, args); - if (command == 'panic') this.enablePanic(message); - if (command == 'joincommunity') this.joinCommunity(message, args); - if (command == 'leavecommunity') this.leaveCommunity(message); - if (command == 'community') this.community(message); - - // Dev Commands (not visible in help) && easter egg commands - if (command == 'version') message.channel.send(`**LPS-BOT Version : ${this.dev}-${this.config.version}**`) - if (command == 'whatisthemeaningoflife') message.channel.send('42'); - if (command == 'whatareyou' || command == 'whoareyou') message.channel.send('Im your friendly neighborhood Lines Police CAD Bot'); - if (command == 'whocreatedyou') message.channel.send('Lines Police CAD Developer McDazzzled | https://github.com/SowinskiBraeden'); - if (command == 'pingserver') { - const socket = io.connect(this.config.socket); - socket.emit('botping', {message:'hello there'}); - socket.on('botpong', (data) => { - console.log(data); - socket.disconnect(); - }); - } + // Dev Commands (not visible in help) && easter egg commands + if (command == 'version') message.channel.send(`**LPS-BOT Version : ${this.dev}-${this.config.version}**`) + if (command == 'whatisthemeaningoflife') message.channel.send('42'); + if (command == 'whatareyou' || command == 'whoareyou') message.channel.send('Im your friendly neighborhood Lines Police CAD Bot'); + if (command == 'whocreatedyou') message.channel.send('Lines Police CAD Developer McDazzzled | https://github.com/SowinskiBraeden'); + if (command == 'pingserver') { + const socket = io.connect(this.config.socket); + socket.emit('botping', {message:'hello there'}); + socket.on('botpong', (data) => { + console.log(data); + socket.disconnect(); }); - }); + } }); - client.login(this.token); } } diff --git a/beta-config.json b/beta-config.json index c47bab1..e7e56c2 100644 --- a/beta-config.json +++ b/beta-config.json @@ -1,5 +1,5 @@ { "defaultPrefix": "?", - "version": "Beta 1.8.2", + "version": "Beta 1.8.7", "socket": "https://police-cad-dev.herokuapp.com/" } diff --git a/config.json b/config.json index 64b4ba6..8bda149 100644 --- a/config.json +++ b/config.json @@ -1,5 +1,5 @@ { "defaultPrefix": "?", - "version": "1.8.2", + "version": "1.8.7", "socket": "https://www.linespolice-cad.com/" } diff --git a/package-lock.json b/package-lock.json index dcbd402..8b0495e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -166,18 +166,18 @@ } }, "boxen": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/boxen/-/boxen-4.2.0.tgz", - "integrity": "sha512-eB4uT9RGzg2odpER62bBwSLvUeGC+WbRjjyyFhGsKnc8wp/m0+hQsMUvUe3H2V0D5vw0nBdO1hCJoZo5mKeuIQ==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/boxen/-/boxen-5.1.2.tgz", + "integrity": "sha512-9gYgQKXx+1nP8mP7CzFyaUARhg7D3n1dF/FnErWmu9l6JvGpNUN278h0aSb+QjoiKSWG+iZ3uHrcqk0qrY9RQQ==", "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" + "camelcase": "^6.2.0", + "chalk": "^4.1.0", + "cli-boxes": "^2.2.1", + "string-width": "^4.2.2", + "type-fest": "^0.20.2", + "widest-line": "^3.1.0", + "wrap-ansi": "^7.0.0" } }, "brace-expansion": { @@ -237,14 +237,14 @@ } }, "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==" + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.2.0.tgz", + "integrity": "sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg==" }, "chalk": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", - "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "requires": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -670,11 +670,11 @@ } }, "global-dirs": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-2.1.0.tgz", - "integrity": "sha512-MG6kdOUh/xBnyo9cJFeIKkLEc1AyFq42QTU4XiX51i2NEdxLxLWXIjEjmqKeSuKR7pAZjTqUVoT2b2huxVLgYQ==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-3.0.0.tgz", + "integrity": "sha512-v8ho2DS5RiCjftj1nD9NmnfaOzTdud7RRnVd9kFNOjqZbISlx5DQ+OrTkywgd0dIt7oFCvKetZSHoHcP3sDdiA==", "requires": { - "ini": "1.3.7" + "ini": "2.0.0" } }, "got": { @@ -696,9 +696,9 @@ } }, "graceful-fs": { - "version": "4.2.6", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz", - "integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==" + "version": "4.2.8", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.8.tgz", + "integrity": "sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg==" }, "has-cors": { "version": "1.1.0", @@ -768,9 +768,9 @@ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, "ini": { - "version": "1.3.7", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.7.tgz", - "integrity": "sha512-iKpRpXP+CrP2jyrxvg1kMUpXDyRUFDWurxbnVT1vQPx+Wz9uCYsMIqYuSBLV+PAaZG/d7kRLKRFc9oDMsH+mFQ==" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ini/-/ini-2.0.0.tgz", + "integrity": "sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA==" }, "ipaddr.js": { "version": "1.9.1", @@ -804,26 +804,26 @@ "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" }, "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==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "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==", + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.4.0.tgz", + "integrity": "sha512-iwGqO3J21aaSkC7jWnHP/difazwS7SFeIqxv6wEtLU8Y5KlzFTjyqcSIT0d8s4+dDhKytsk9PJZ2BkS5eZwQRQ==", "requires": { - "global-dirs": "^2.0.1", - "is-path-inside": "^3.0.1" + "global-dirs": "^3.0.0", + "is-path-inside": "^3.0.2" } }, "is-npm": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-4.0.0.tgz", - "integrity": "sha512-96ECIfh9xtDDlPylNPXhzjsykHsMJZ18ASpaWzQyBr4YRTcVjUvzaHayDAES2oU/3KpljhHUjtSRNiDwi0F0ig==" + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-5.0.0.tgz", + "integrity": "sha512-WW/rQLOazUq+ST/bCAVBp/2oMERWLsR7OrKyt052dNDk4DHcDE0/7QSXITlmi+VBcV13DfIbysG3tZJm5RfdBA==" }, "is-number": { "version": "7.0.0", @@ -881,6 +881,14 @@ "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==" }, + "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", @@ -982,9 +990,9 @@ "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==" }, "nodemon": { - "version": "2.0.9", - "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.9.tgz", - "integrity": "sha512-6O4k7C8f2HQArGpaPBOqGGddjzDLQAqCYmq3tKMeNIbz7Is/hOphMHy2dcY10sSq5wl3cqyn9Iz+Ep2j51JOLg==", + "version": "2.0.14", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.14.tgz", + "integrity": "sha512-frcpDx+PviKEQRSYzwhckuO2zoHcBYLHI754RE9z5h1RGtrngerc04mLpQQCPWBkH/2ObrX7We9YiwVSYZpFJQ==", "requires": { "chokidar": "^3.2.2", "debug": "^3.2.6", @@ -995,7 +1003,7 @@ "supports-color": "^5.5.0", "touch": "^3.1.0", "undefsafe": "^2.0.3", - "update-notifier": "^4.1.0" + "update-notifier": "^5.1.0" } }, "nopt": { @@ -1175,6 +1183,13 @@ "ini": "~1.3.0", "minimist": "^1.2.0", "strip-json-comments": "~2.0.1" + }, + "dependencies": { + "ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" + } } }, "readable-stream": { @@ -1333,9 +1348,9 @@ "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==" }, "signal-exit": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", - "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==" + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.5.tgz", + "integrity": "sha512-KWcOiKeQj6ZyXx7zq4YxSMgHRlod4czeBQZrPb8OKcohcqAXShm7E20kEMle9WBt26hFcAf0qLOcp5zmY7kOqQ==" }, "socket.io-client": { "version": "4.1.2", @@ -1406,13 +1421,13 @@ "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=" }, "string-width": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", - "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "requires": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" + "strip-ansi": "^6.0.1" } }, "string_decoder": { @@ -1431,11 +1446,11 @@ } }, "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "requires": { - "ansi-regex": "^5.0.0" + "ansi-regex": "^5.0.1" } }, "strip-json-comments": { @@ -1451,11 +1466,6 @@ "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==" - }, "to-readable-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/to-readable-stream/-/to-readable-stream-1.0.0.tgz", @@ -1488,9 +1498,9 @@ "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==" + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==" }, "type-is": { "version": "1.6.18", @@ -1510,27 +1520,9 @@ } }, "undefsafe": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.3.tgz", - "integrity": "sha512-nrXZwwXrD/T/JXeygJqdCO6NZZ1L66HrxM/Z7mIq2oPanoN0F1nLx3lwJMu6AwJY69hdixaFQOuoYsMjE5/C2A==", - "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==", - "requires": { - "ms": "2.0.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - } - } + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz", + "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==" }, "unique-string": { "version": "2.0.0", @@ -1546,23 +1538,34 @@ "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" }, "update-notifier": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-4.1.3.tgz", - "integrity": "sha512-Yld6Z0RyCYGB6ckIjffGOSOmHXj1gMeE7aROz4MG+XMkmixBX4jUngrGXNYz7wPKBmtoD4MnBa2Anu7RSKht/A==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-5.1.0.tgz", + "integrity": "sha512-ItnICHbeMh9GqUy31hFPrD1kcuZ3rpxDZbf4KUDavXwS0bW5m7SLbDQpGX3UYr072cbrF5hFUs3r5tUsPwjfHw==", "requires": { - "boxen": "^4.2.0", - "chalk": "^3.0.0", + "boxen": "^5.0.0", + "chalk": "^4.1.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-installed-globally": "^0.4.0", + "is-npm": "^5.0.0", "is-yarn-global": "^0.3.0", - "latest-version": "^5.0.0", - "pupa": "^2.0.1", + "latest-version": "^5.1.0", + "pupa": "^2.1.1", + "semver": "^7.3.4", "semver-diff": "^3.1.1", "xdg-basedir": "^4.0.0" + }, + "dependencies": { + "semver": { + "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" + } + } } }, "url-parse-lax": { @@ -1596,6 +1599,16 @@ "string-width": "^4.0.0" } }, + "wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", @@ -1622,6 +1635,11 @@ "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-4.0.0.tgz", "integrity": "sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q==" }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + }, "yeast": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/yeast/-/yeast-0.1.2.tgz", diff --git a/package.json b/package.json index 27f935c..8abbb82 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "discord.js": "^12.5.3", "express": "^4.17.1", "mongodb": "^3.6.8", - "nodemon": "^2.0.9", + "nodemon": "^2.0.14", "randomstring": "^1.2.1", "socket.io-client": "^4.1.2" }