diff --git a/.gitignore b/.gitignore index b252dde..42118d8 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,8 @@ test.js dev.js # Dev config -dev-config.json \ No newline at end of file +config/dev-config.js + +# Logs +logs +*.log \ No newline at end of file diff --git a/LPS.js b/LPS.js index 6521e63..36b4f81 100644 --- a/LPS.js +++ b/LPS.js @@ -1,17 +1,69 @@ +const { Collection, Client, MessageEmbed } = require('discord.js'); +const CommandHandler = require('./commands').Commands; const MongoClient = require('mongodb').MongoClient; -const ObjectId = require('mongodb').ObjectID -const randomstring = require('randomstring'); -const io = require('socket.io-client'); -const Discord = require('discord.js'); -const client = new Discord.Client(); +const Logger = require("./util/Logger"); +const fs = require('fs'); -class Bot { +class LinesPoliceCadBot extends Client { - constructor(dev, token, config, mongoURI, dbo) { - this.dev = dev; - this.token = token; - this.config = require(config); - this.connectMongo(mongoURI, dbo); + constructor(config) { + super() + + this.config = config; + this.commands = new Collection(); + this.logger = new Logger('./Logs.log'); + + if (this.config.Token === "") + return new TypeError( + "The botconfig.js is not filled out. Please make sure nothing is blank, otherwise the bot will not work properly." + ); + + this.connectMongo(this.config.mongoURI, this.config.dbo); + this.LoadCommands(); + this.LoadEvents(); + + this.Ready = false; + + this.ws.on("INTERACTION_CREATE", async (interaction) => { + client.log("Interaction") + let GuildDB = await this.GetGuild(interaction.guild_id); + + //Initialize GuildDB + if (!GuildDB) { + await this.database.guild.set(interaction.guild_id, { + prefix: this.config.DefaultPrefix, + DJ: null, + }); + GuildDB = await this.GetGuild(interaction.guild_id); + } + + const command = interaction.data.name.toLowerCase(); + const args = interaction.data.options; + + //Easy to send respnose so ;) + interaction.guild = await this.guilds.fetch(interaction.guild_id); + interaction.send = async (message) => { + return await this.api + .interactions(interaction.id, interaction.token) + .callback.post({ + data: { + type: 4, + data: + typeof message == "string" + ? { content: message } + : message.type && message.type === "rich" + ? { embeds: [message] } + : message, + }, + }); + }; + + let cmd = client.commands.get(command); + if (cmd.SlashCommand && cmd.SlashCommand.run) + cmd.SlashCommand.run(this, interaction, args, { GuildDB }); + }); + + const client = this; } async connectMongo(mongoURI, dbo) { @@ -19,563 +71,68 @@ class Bot { this.dbo = this.db.db(dbo); } - // Updates Prefix - async newPrefix(message, n) { - if (n[0]==undefined) return message.channel.send(`You must provide a \`new prefix\` ${message.author}`); - if (n[0].length<1) return message.channel.send('Your new prefix must be \`1\` character!') - this.dbo.collection("prefixes").updateOne({"server.serverID":message.guild.id},{$set:{"server.prefix":n[0]}},function(err, res) { - if (err) throw err; - message.channel.send(`The new prefix is now **\`${n}\`**`); + LoadCommands() { + let CommandsDir = './commands'; + fs.readdir(CommandsDir, (err, files) => { + if (err) this.log(err); + else + files.forEach((file) => { + let cmd = require(CommandsDir + "/" + file); + if (!cmd.name || !cmd.description || !cmd.run) + return this.log( + "Unable to load Command: " + + file.split(".")[0] + + ", Reason: File doesn't had run/name/desciption" + ); + this.commands.set(file.split(".")[0].toLowerCase(), cmd); + this.log("Command Loaded: " + file.split(".")[0]); + }); }); } - // Remote Login - async remoteLogin(message, args) { - return message.channel.send('Login from Lines Police CAD account management https://www.linespolice-cad.com/'); - } - - async remoteLogout(message) { - let user = await this.dbo.collection("users").findOne({"user.discord.id":message.author.id}).then(user => user); - if (!user) return message.channel.send(`You cannot logout if your not logged in ${message.author}`); - this.dbo.collection("users").updateOne({"user.discord.id":message.author.id},{$unset:{"user.discord":""}, $set:{"user.discordConnected":false}},function(err,res) { - if (err) throw err; - message.channel.send(`Succesfully disconnected you Discord account ${message.author}`); + LoadEvents() { + let EventsDir = './events'; + fs.readdir(EventsDir, (err, files) => { + if (err) this.log(err); + else + files.forEach((file) => { + const event = require(EventsDir + "/" + file); + this.on(file.split(".")[0], event.bind(null, this)); + this.logger.log("Event Loaded: " + file.split(".")[0]); + }); }); } - async account(message) { - let user = await this.dbo.collection("users").findOne({"user.discord.id":message.author.id}).then(user => user); - if (user==null) return message.channel.send(`You are not logged in ${message.author}`); - message.author.send(`${message.author} Logged in as **${user.user.username}** | **${user.user.email}**`); - } - - async nameSearch(message, args) { - let user = await this.dbo.collection("users").findOne({"user.discord.id":message.author.id}).then(user => user); - if (!user) return message.channel.send(`You are not logged in ${message.author}`); - let data; - if (user.user.activeCommunity=='' || user.user.activeCommunity==null) { - if (args.length==0) return message.channel.send(`You must provide a \`First Name\`, \`Last Name\` and \`DOB\`(yyyy-mm-dd) ${message.author}`); - if (args.length==1) return message.channel.send(`You're missing a \`Last Name\` and \`DOB\`(yyyy-mm-dd) ${message.author}`); - if (args.length==2) return message.channel.send(`You're missing a \`DOB\`(yyyy-mm-dd) ${message.author}`); - } - if (args.length==0) return message.channel.send(`You must provide a \`First Name\` and \`Last Name\` ${message.author}`); - if (args.length==1) return message.channel.send(`You're missing a \`Last Name\` ${message.author}`); - - if (user.user.activeCommunity=='' || user.user.activeCommunity==null) { - data = { - user: user, - query: { - firstName: args[0], - lastName: args[1], - dateOfBirth: args[2], - activeCommunityID: user.user.activeCommunity - } - } - } else { - data = { - user: user, - query: { - firstName: args[0], - lastName: args[1], - activeCommunityID: user.user.activeCommunity - } - } - } - - const socket = io.connect(this.config.socket); - socket.emit("bot_name_search", data); - socket.on("bot_name_search_results", results => { - - if (results.user._id==user._id) { - if (results.civilians.length == 0) { - return message.channel.send(`Name \`${args[0]} ${args[1]}\` not found ${message.author}`); - } - - for (let i = 0; i < results.civilians.length; i++) { - // Get Drivers Licence Status - let licenceStatus; - if (results.civilians[i].civilian.licenseStatus == 1) licenceStatus = 'Valid'; - if (results.civilians[i].civilian.licenceStatus == 2) licenceStatus = 'Revoked'; - if (results.civilians[i].civilian.licenceStatus == 3) licenceStatus = 'None'; - // Get Firearm Licence Status - let firearmLicence = results.civilians[i].civilian.firearmLicense; - if (firearmLicence == undefined || firearmLicence == null) firearmLicence = 'None'; - if (firearmLicence == '2') firearmLicence = 'Valid'; - if (firearmLicence == '3') firearmLicence = 'Revoked'; - let nameResult = new Discord.MessageEmbed() - .setColor('#0099ff') - .setTitle(`**${results.civilians[i].civilian.firstName} ${results.civilians[i].civilian.lastName} | ${results.civilians[i]._id}**`) - .setURL('https://discord.gg/jgUW656v2t') - .setAuthor('LPS Website Support', 'https://raw.githubusercontent.com/Linesmerrill/police-cad/master/lines-police-server.png', 'https://discord.gg/jgUW656v2t') - .setDescription('Name Search Results') - .addFields( - { name: `**First Name**`, value: `\`${results.civilians[i].civilian.firstName}\``, inline: true }, - { name: `**Last Name**`, value: `\`${results.civilians[i].civilian.lastName}\``, inline: true }, - { name: `**DOB**`, value: `\`${results.civilians[i].civilian.birthday}\``, inline: true }, - { name: `**Drivers License**`, value: `\`${licenceStatus}\``, inline: true }, - { name: `**Firearm Licence**`, value: `\`${firearmLicence}\``, inline: true }, - { name: `**Gender**`, value: `\`${results.civilians[i].civilian.gender}\``, inline: true } - ) - // Check Other details - let address = results.civilians[i].civilian.address; - let occupation = results.civilians[i].civilian.occupation; - let height = results.civilians[i].civilian.height; - let weight = results.civilians[i].civilian.weight; - let eyeColor = results.civilians[i].civilian.eyeColor; - let hairColor = results.civilians[i].civilian.hairColor; - if (address != null && address != undefined && address != '') nameResult.addFields({ name: `**Address**`, value: `\`${address}\``, inline: true }); - if (occupation != null && occupation != undefined && occupation != '') nameResult.addFields({ name: `**Occupation**`, value: `\`${occupation}\``, inline: true }); - if (height!=null&&height!=undefined&&height!="NaN"&&height!='') { - if (results.civilians[i].civilian.heightClassification=='imperial') { - let ft = Math.floor(height/12); - let inch = height%12; - nameResult.addFields({ name: '**Height**', value: `\`${ft}'${inch}"\``, inline: true }); - } else { - nameResult.addFields({ name: '**Height**', value: `\`${height}cm\``, inline: true }); - } - } - if (weight!=null&&weight!=undefined&&weight!='') { - if (results.civilians[i].civilian.weightClassification=='imperial') { - nameResult.addFields({ name: '**Weight**', value: `\`${weight}lbs.\``, inline: true }); - } else { - nameResult.addFields({ name: '**Weight**', value: `\`${weight}kgs.\``, inline: true }); - } - } - if (eyeColor!=null&&eyeColor!=undefined&&eyeColor!='') nameResult.addFields({name:'**Eye Color**',value:`\`${eyeColor}\``,inline:true}); - if (hairColor!=null&&hairColor!=undefined&&hairColor!='') nameResult.addFields({name:'**Hair Color**',value:`\`${hairColor}\``,inline:true}); - nameResult.addFields({name:'**Organ Donor**',value:`\`${results.civilians[i].civilian.organDonor}\``,inline:true}); - nameResult.addFields({name:'**Veteran**',value:`\`${results.civilians[i].civilian.veteran}\``,inline:true}); - message.channel.send(nameResult); - } - } - socket.disconnect(); + RegisterSlashCommands() { + this.guilds.cache.forEach((guild) => { + require("./util/RegisterSlashCommands")(this, guild.id); }); } - async plateSearch(message, args) { - let user = await this.dbo.collection("users").findOne({"user.discord.id":message.author.id}).then(user => user); - if (!user) return message.channel.send(`You are not logged in ${message.author}`); - if (args.length==0) return message.channel.send(`You are missing a \`Plate #\` ${message.author}`); - let data = { - user: user, - query: { - plateNumber: args[0], - activeCommunityID: user.user.activeCommunity - } - } - const socket = io.connect(this.config.socket); - socket.emit('bot_plate_search', data); - socket.on('bot_plate_search_results', results => { - - if (results.user._id==user._id) { - if (results.vehicles.length == 0) { - return message.channel.send(`Plate Number \`${args[0]}\` not found ${message.author}`); - } - - for (let i = 0; i < results.vehicles.length; i++) { - let plateResult = new Discord.MessageEmbed() - .setColor('#0099ff') - .setTitle(`**${results.vehicles[i].vehicle.plate} | ${results.vehicles[i]._id}**`) - .setURL('https://discord.gg/jgUW656v2t') - .setAuthor('LPS Website Support', 'https://raw.githubusercontent.com/Linesmerrill/police-cad/master/lines-police-server.png', 'https://discord.gg/jgUW656v2t') - .setDescription('Plate Search Results') - .addFields( - { name: `**Plate #**`, value: `\`${results.vehicles[i].vehicle.plate}\``, inline: true }, - { name: `**Vin #**`, value: `\`${results.vehicles[i].vehicle.vin}\``, inline: true }, - { name: `**Model**`, value: `\`${results.vehicles[i].vehicle.model}\``, inline: true }, - { name: `**Color**`, value: `\`${results.vehicles[i].vehicle.color}\``, inline: true }, - { name: `**Owner**`, value: `\`${results.vehicles[i].vehicle.registeredOwner}\``, inline: true }, - ) - // Other details - let validRegistration = results.vehicles[i].vehicle.validRegistration; - let validInsurance = results.vehicles[i].vehicle.validInsurance; - let stolen = results.vehicles[i].vehicle.isStolen; - if (validRegistration=='1') plateResult.addFields({ name: `**Registration**`, value: `\`Valid\``, inline: true }); - if (validRegistration=='2') plateResult.addFields({ name: `**Registration**`, value: `\`InValid\``, inline: true }); - if (validInsurance=='1') plateResult.addFields({ name: `**Insurance**`, value: `\`Valid\``, inline: true }); - if (validInsurance=='2') plateResult.addFields({ name: `**Insurance**`, value: `\`InValid\``, inline: true }); - if (stolen=='1') plateResult.addFields({ name: `**Stolen**`, value: `\`No\``, inline: true }); - if (stolen=='2') plateResult.addFields({ name: `**Stolen**`, value: `\`Yes\``, inline: true }); - message.channel.send(plateResult); - } - } - socket.disconnect(); - }); - } - - async firearmSearch(message, args) { - let user = await this.dbo.collection("users").findOne({"user.discord.id":message.author.id}).then(user => user); - if (!user) return message.channel.send(`You are not logged in ${message.author}`); - if (args.length==0) return message.channel.send(`You are missing a \`Serial Number\` ${message.author}`); - let data = { - user: user, - query: { - serialNumber: args[0], - activeCommunityID: user.user.activeCommunity - } - } - const socket = io.connect(this.config.socket); - socket.emit('bot_firearm_search', data); - socket.on('bot_firearm_search_results', results => { - if (results.user._id==user._id) { - if (results.firearms.length==0) { - return message.channel.send(`No Firearms found ${message.author}`); - } - - for (let i = 0; i < results.firearms.length; i++) { - let firearmResult = new Discord.MessageEmbed() - .setColor('#0099ff') - .setTitle(`**${results.firearms[i].firearm.serialNumber} | ${results.firearms[i]._id}**`) - .setURL('https://discord.gg/jgUW656v2t') - .setAuthor('LPS Website Support', 'https://raw.githubusercontent.com/Linesmerrill/police-cad/master/lines-police-server.png', 'https://discord.gg/jgUW656v2t') - .setDescription('Firearm Search Results') - .addFields( - { name: `**Serial Number**`, value: `\`${results.firearms[i].firearm.serialNumber}\``, inline: true }, - { name: `**Type**`, value: `\`${results.firearms[i].firearm.weaponType}\``, inline: true }, - { name: `**Owner**`, value: `\`${results.firearms[i].firearm.registeredOwner}\``, inline: true }, - ) - // Other details - let isStolen = results.firearms[i].firearm.isStolen; - if (isStolen=="false"||isStolen==false) firearmResult.addFields({name:`**Stolen**`,value:'\`No\`',inline: true}); - if (isStolen=="true"||isStolen==true) firearmResult.addFields({name:`**Stolen**`,value:'\`Yes\`',inline: true}); - message.channel.send(firearmResult); - } - } - socket.disconnect(); - }); - } - - async checkStatus(message, args) { - let user = await this.dbo.collection("users").findOne({"user.discord.id":message.author.id}).then(user => user); - if (!user) return message.channel.send(`You are not logged in ${message.author}`); - if (user.user.activeCommunity == null) return message.channel.send(`You must join a community to use this command ${message.author}`); - if (args.length == 0) { - message.channel.send(`${message.author}'s status: \`${user.user.dispatchStatus}\` | Set by: \`${user.user.dispatchStatusSetBy}\``); - } else { - let targetUserID = args[0].replace('<@!', '').replace('>', ''); - let targetUser = await this.dbo.collection("users").findOne({"user.discord.id":targetUserID}).then(user => user); - // This lame line of code to get username without ping on discord - const User = client.users.cache.get(args[0].replace('<@!', '').replace('>', '')); - if (!targetUser) return message.channel.send(`Cannot find **${args[0]}** ${message.author}`); - if (targetUser.user.activeCommunity!=user.user.activeCommunity) { - return message.channel.send(`You are not in the same community as \`${User.tag}\` ${message.author}`); - } - return message.channel.send(`${message.author}, \`${User.tag}'s\` status: \`${targetUser.user.dispatchStatus}\` | Set by: \`${targetUser.user.dispatchStatusSetBy}\``); - } - } - - async updateStatus(message, args, prefix) { - let validStatus=['10-8','10-7','10-6','10-11','10-23','10-97','10-15','10-70','10-80', 'Panic', '10-41', '10-42']; - let user = await this.dbo.collection("users").findOne({"user.discord.id":message.author.id}).then(user => user); - if (!user) return message.channel.send(`You are not logged in ${message.author}`); - if (user.user.activeCommunity==null) return message.channel.send(`You must join a community to use this command ${message.author}`); - if (args.length==0) return message.channel.send(`You must provide a new status ${message.author} | To see a list of valid statuses, use command \`${prefix}validStatus\`.`); - if (!validStatus.includes(args[0])) return message.channel.send(`\`${args[0]}\` is a Invalid Status ${message.author}! To see a list of valid statuses, use command \`${prefix}validStatus\`.`); - let onDuty=null; - let updateDuty=false; - let status = args[0] - if (args[0]=='10-41') { - onDuty=true; - updateDuty=true; - status='Online'; - } - if (args[0]=='10-42') { - onDuty=false; - updateDuty=true; - status='Offline'; - } - let req={ - userID: user._id, - status: status, - setBy: 'Self', - onDuty: onDuty, - updateDuty: updateDuty - }; - const socket = io.connect(this.config.socket); - socket.emit('bot_update_status', req); - socket.on('bot_updated_status', (res) => { - message.channel.send(`Succesfully updated status to \`${args[0]}\` ${message.author}`); - socket.disconnect(); - }); - } - - async enablePanic(message) { - let user = await this.dbo.collection("users").findOne({"user.discord.id":message.author.id}).then(user => user); - if (!user) return message.channel.send(`You are not logged in ${message.author}`); - if (user.user.activeCommunity==null) return message.channel.send(`You must join a community to use this command ${message.author}`); - const socket = io.connect(this.config.socket); - // If panic is enabled, disable panic - if (user.user.dispatchStatus=='Panic') { - let myReq = { - userID: user._id, - communityID: user.user.activeCommunity - }; - socket.emit('clear_panic', myReq); - - let myUpdateReq = { - userID: user._id, - status: '10-8', - setBy: 'System', - onDuty: null, - updateDuty: false - }; - socket.emit('bot_update_status', myUpdateReq); - socket.on('bot_updated_status', (res) => { - message.channel.send(`Disabled Panic ${message.author} and set status to \`10-8\`.`); - socket.disconnect(); - }); - return; - // If panic is disabled, enable panic - } else { - this.updateStatus(message, ['Panic'], null); - let myReq = { - userID: user._id, - userUsername: user.user.username, - activeCommunity: user.user.activeCommunity - } - socket.emit('panic_button_update', myReq); - socket.disconnect(); - let guild = await this.dbo.collection("prefixes").findOne({"server.serverID":message.guild.id}).then(guild => guild); - if (guild.server.pingOnPanic) return message.channel.send(`Attention <@&${guild.server.pingRole}>! \`${user.user.username}\` has activated panic`); - return; - } - } - - async updateLicense(message, args) { - let user = await this.dbo.collection("users").findOne({"user.discord.id":message.author.id}).then(user => user); - if (!user) return message.channel.send(`You are not logged in ${message.author}`); - let data; - if (user.user.activeCommunity=='' || user.user.activeCommunity==null) { - if (args.length==0) return message.channel.send(`You must provide a \`License Status\`, \`First Name\`, \`Last Name\`, \`DOB\`(yyyy-mm-dd) ${message.author}`); - if (args.length==1) return message.channel.send(`You're missing a \`First Name\`, \`Last Name\` and \`DOB\`(yyyy-mm-dd) ${message.author}`); - if (args.length==2) return message.channel.send(`You're missing a \`Last Name\` and \`DOB\`(yyyy-mm-dd) ${message.author}`); - if (args.length==3) return message.channel.send(`You're missing a \`DOB\`(yyyy-mm-dd) ${message.author}`); - if (args[0].toLowerCase()!='revoke'&&args[0].toLowerCase()!='reinstate') return message.channel.send(`Invalid License Status, choose \`revoke\` or \`reinstate\` ${message.author}`); - } - if (args.length==0) return message.channel.send(`You must provide a \`License Status\`, \`First Name\` and \`Last Name\` ${message.author}`); - if (args.length==1) return message.channel.send(`You're missing a \`First Name\` and \`Last Name\` ${message.author}`); - if (args.length==2) return message.channel.send(`You're missing a \`Last Name\` ${message.author}`); - if (args[0].toLowerCase()!='revoke'&&args[0].toLowerCase()!='reinstate') return message.channel.send(`Invalid License Status, choose \`revoke\` or \`reinstate\` ${message.author}`); - - if (user.user.activeCommunity=='' || user.user.activeCommunity==null) { - data = { - user: user, - query: { - firstName: args[1], - lastName: args[2], - dateOfBirth: args[3], - activeCommunityID: user.user.activeCommunity - } - } - } else { - data = { - user: user, - query: { - firstName: args[1], - lastName: args[2], - activeCommunityID: user.user.activeCommunity - } - } - } - - const socket = io.connect(this.config.socket); - socket.emit("bot_name_search", data); - socket.on("bot_name_search_results", (results) => { - if (results.user._id==user._id) { - if (results.civilians.length == 0) { - return message.channel.send(`Name \`${args[1]} ${args[2]}\` not found ${message.author}`); - } - } - - let query = { - _id: results.civilians[0]._id, - status: null, - bot_request: true - }; - if (args[0]=='revoke') query.status = 2; - if (args[0]=='reinstate') query.status = 1; - socket.emit("update_drivers_license_status", query); - socket.on("bot_updated_drivers_license_status", (res) => { - if (!res.success) return message.channel.send(`Failed to update license of \`${args[1]} ${args[2]}\` ${message.author}`); - message.channel.send(`Successfully updated license of \`${args[1]} ${args[2]}\` ${message.author}`); - socket.disconnect(); - return; - }); - }); - } - - async joinCommunity(message, args) { - let user = await this.dbo.collection("users").findOne({"user.discord.id":message.author.id}).then(user => user); - if (!user) return message.channel.send(`You are not logged in ${message.author}`); - if (args.length==0) return message.channel.send(`You must provide a \`Community Code\` ${message.author}`); - let myReq = { - userID: user._id, - communityCode: args[0] - }; - const socket = io.connect(this.config.socket); - socket.emit('bot_join_community', myReq); - socket.on('bot_joined_community', (data) => { - socket.disconnect() - if (data.error) { - return message.channel.send(`${data.error} ${message.author}`); - } - return message.channel.send(`Successfully joined the community \` ${data.commName} \` ${message.author}`) - }); - } - - async leaveCommunity(message) { - let user = await this.dbo.collection("users").findOne({"user.discord.id":message.author.id}).then(user => user); - if (!user) return message.channel.send(`You are not logged in ${message.author}`); - let myReq = { - userID: user._id - }; - const socket = io.connect(this.config.socket); - socket.emit('bot_leave_community', myReq); - socket.on('bot_left_community', (data) => { - socket.disconnect() - if (data.error) { - return message.channel.send(`${data.error} ${message.author}`); - } - return message.channel.send(`${data.message} ${message.author}`) - }); - } - - async community(message) { - let user = await this.dbo.collection("users").findOne({"user.discord.id":message.author.id}).then(user => user); - if (!user) return message.channel.send(`You are not logged in ${message.author}`); - if (user.user.activeCommunity==null) return message.channel.send(`You are not in a community ${message.author}`); - let community = await this.dbo.collection("communities").findOne({_id:ObjectId(user.user.activeCommunity)}).then(community => community); - if (!community) return message.channel.send(`Community not found ${message.author}`); - 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(`Successfully 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.hasCustomRoles==false) 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(`Successfully 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(`Successfully removed ${args[0]} from allowed roles ${message.author}`); - }); - } - } - } - } - } - - async roles(message) { + async checkRoleStatus(message) { + let hasRole = false; 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 roles = "Allowed Roles:"; + // 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 (guild.server.allowedRoles[i] == undefined) break; - roles += `\n<@&${guild.server.allowedRoles[i]}>`; + if (message.member.roles.cache.some(role => role.id == guild.server.allowedRoles[i])) hasRole = true; } - return message.channel.send(roles); + return hasRole; } - async setChannel(message, args) { - if (args.length==0) return message.channel.send(`You must provide a channel ${message.author}`); - let channelid = args[0].replace('<#', '').replace('>', ''); - let channel = client.channels.cache.get(channelid); - if (!channel) return message.channel.send(`Cannot find that channel ${message.author}`); - if (channel.type=="voice") return message.channel.send(`Connot set voice channel to preferred channel ${message.author}`); - if (channel.deleted) return message.channel.send(`Connot set deleted channel to preferred channel ${message.author}`); - let guild = await this.dbo.collection("prefixes").findOne({"server.serverID":message.guild.id}).then(guild => guild); - if (guild.server.allowedChannels!=undefined&&guild.server.allowedChannels.includes(channelid)) return message.channel.send(`The channel ${args[0]} has already been added ${message.author}`); - this.dbo.collection("prefixes").updateOne({"server.serverID":message.guild.id},{$push:{"server.allowedChannels":channelid},$set:{"server.hasCustomChannels":true}},function(err, res) { - if (err) throw err; - return message.channel.send(`Successfully added ${args[0]} to allowed channels ${message.author}`); - }); - } - - async removeChannel(message, args) { - if (args.length==0) return message.channel.send(`You must provide a channel ${message.author}`); - let channelid = args[0].replace('<#', '').replace('>', ''); - let channel = client.channels.cache.get(channelid); - if (!channel) return message.channel.send(`Uh Oh! The channel ${args[0]} connot be found.`); - let guild = await this.dbo.collection("prefixes").findOne({"server.serverID":message.guild.id}).then(guild => guild); - if (guild.server.hasCustomChannels==false) return message.channel.send(`There are no channels to be removed ${message.author}`); - if (!guild.server.allowedChannels.includes(channelid)) return message.channel.send(`The channel ${args[0]} is not added to your roles ${message.author}`); - for (let i = 0; i < guild.server.allowedChannels.length; i++) { - if (guild.server.allowedChannels[i]==channelid) { - if ((guild.server.allowedChannels.length-1)==0) { - this.dbo.collection("prefixes").updateOne({"server.serverID":message.guild.id},{$pull:{"server.allowedChannels":channelid},$set:{"server.hasCustomChannels":false}},function(err, res) { - if (err) throw err; - return message.channel.send(`Successfully removed ${args[0]} from allowed channels ${message.author}! There are no more allowed channels.`); - }); - } else if ((guild.server.allowedChannels.length-1)>0) { - this.dbo.collection("prefixes").updateOne({"server.serverID":message.guild.id},{$pull:{"server.allowedChannels":channelid}},function(err, res) { - if (err) throw err; - return message.channel.send(`Successfully removed ${args[0]} from allowed channels ${message.author}`); - }); - } - } - } - } - - async channels(message) { - let guild = await this.dbo.collection("prefixes").findOne({"server.serverID":message.guild.id}).then(guild => guild); - if (guild.server.hasCustomChannels==false) { - return message.channel.send('There are no channels set for the bot.'); - } - - let channels = "Allowed Channels:"; - for (let i = 0; i < guild.server.allowedChannels.length; i++) { - if (guild.server.allowedChannels[i] == undefined) break; - channels += `\n<#${guild.server.allowedChannels[i]}>`; - } - return message.channel.send(channels); - } - - async getGuildPresets(message) { + async GetGuild(GuildId) { let prefix; let channelId; let customRoleStatus; let customChannelStatus; let allowedChannels; - if (message.channel.type!="dm") { - let guild = await this.dbo.collection("prefixes").findOne({"server.serverID":message.guild.id}).then(guild => guild); + let guild = await this.dbo.collection("prefixes").findOne({"server.serverID":GuildId}).then(guild => guild); // If guild not found, generate guild default if (!guild) { let newGuild = { server: { - serverID: message.guild.id, - prefix: this.config.defaultPrefix, + serverID: GuildId, + prefix: this.config.DefaultPrefix, hasCustomRoles: false, hasCustomChannels: false, } @@ -595,289 +152,272 @@ class Bot { allowedChannels = guild.server.allowedChannels; } else allowedChannels = null; } - } else { - prefix = this.config.defaultPrefix; - customRoleStatus = false; - customChannelStatus = false; - allowedChannels = null; + let guildData = { + prefix: prefix, + channelId: channelId, + customRoleStatus: customRoleStatus, + customChannelStatus: allowedChannels, + guildId: GuildId } - return {prefix, channelId, customRoleStatus, customChannelStatus, allowedChannels}; + return guildData; } - 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; + log(Text) { + this.logger.log(Text); } - async togglePingOnPanic(message, args) { - if (args.length==0) return message.channel.send(`You must provide a \`Ping On Role Status\` and a \`role\` to ping ${message.author}`); - if (args[0]=="false") { - // disable ping on panic and remove ping role - this.dbo.collection("prefixes").updateOne({"server.serverID":message.guild.id},{$set:{"server.pingOnPanic":false,"server.pingRole":null}},function(err, res) { - if (err) throw err; - return message.channel.send(`Successfully disabled ping role on panic ${message.author}`); - }); - } else if (args[0]=="true") { - if (!args[1]) return message.channel.send(`You must provide a \`role\` to ping ${message.author}`); - let roleid = args[1].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[1]} connot be found.`); - } else { - this.dbo.collection("prefixes").updateOne({"server.serverID":message.guild.id},{$set:{"server.pingRole":roleid,"server.pingOnPanic":true}},function(err, res) { - if (err) throw err; - return message.channel.send(`Successfully set ${args[1]} to be pinged on panic ${message.author}`); - }); - } - } else return message.channel.send(`\`${args[0]}\` is an invalid status, use \`true\` or \`false\` ${message.author}`); + sendError(Channel, Error) { + let embed = new MessageEmbed() + .setTitle("An error occured") + .setColor("RED") + .setDescription(Error) + .setFooter( + "If you think this as a bug, please report it in the support server!" + ); + + Channel.send(embed); } - async getPingOnPanicStatus(message) { - let guild = await this.dbo.collection("prefixes").findOne({"server.serverID":message.guild.id}).then(guild => guild); - return message.channel.send(`Current Ping on Panic Status: ${guild.server.pingOnPanic} ${message.author}`); + + build() { + this.login(this.config.Token); } - main() { - client.on('ready', () => { - console.log(`Logged in as ${client.user.tag}`); - }); + // main() { + // client.on('ready', () => { + // console.log(`Logged in as ${client.user.tag}`); + // }); - // Basic Commands - client.on('message', async (message) => { - let { prefix, channelId, customRoleStatus, customChannelStatus, allowedChannels } = await this.getGuildPresets(message); - if (!message.content.startsWith(prefix) || message.author.bot) return; + // // Basic Commands + // client.on('message', async (message) => { + // let { prefix, channelId, customRoleStatus, customChannelStatus, allowedChannels } = await this.getGuildPresets(message); + // if (!message.content.startsWith(prefix) || message.author.bot) return; - if (customChannelStatus==true&&!allowedChannels.includes(message.channel.id)) { - return message.channel.send(`This is not the preferred channel, please one of the allowed channels. Use \`${prefix}channels\` to see a list of allowed channels ${message.author}`); - } - const args = message.content.slice(prefix.length).trim().split(' '); - const command = args.shift().toLowerCase(); + // if (customChannelStatus==true&&!allowedChannels.includes(message.channel.id)) { + // return message.channel.send(`This is not the preferred channel, please one of the allowed channels. Use \`${prefix}channels\` to see a list of allowed channels ${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\` - ` - } - ) + // // Valid Statuses Embed + // const validStatus = new 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: `**__Bot Commands:__**`, - value: ` - **${prefix}help** - \`Displays this help page\` - **${prefix}stats** - \`Displays current Bot statistics\` - **${prefix}ping** - \`Responds with Pong to check Bot responce\` - `, - inline: false - }, - { - name: `**__LPC Commands (1/2):__**`, - value: ` - **${prefix}login** - \`Redirects you to connect your discord to LPC(DM only)\` - **${prefix}logout** - \`Logs out of your current logged in account\` - **${prefix}validStatus** - \`Shows list of valid statuses to updade to\` - **${prefix}checkStatus** - \`Check your own or other status\` - **${prefix}updateStatus** - \`Updates your status\` - **${prefix}account** - \`returns logged in account\` - **${prefix}penalCodes** - \`Provides Link to penal codes\` - **${prefix}namedb** - \`Searches for Civilian by Name\` - **${prefix}platedb** - \`Searches for Vehicle by Licence Plate #\` - **${prefix}firearmdb** - \`Searches for Firearms by Serial #\` - **${prefix}panic** - \`Enables/Disables your panic button\` - **${prefix}license** - \`Revoke/Reinstate License\` - `, - inline: true - }, - { - name: `**__LPC Command (2/2):__**`, - value: ` - **${prefix}roles** - \`Shows a list of allowed roles\` - **${prefix}channels** - \`Shows a list of allowed channels\` - **${prefix}joincommunity** - \`Joins a community with the given code\` - **${prefix}leavecommunity** - \`Leaves your current active community\` - **${prefix}community** - \`Returns the name of the Community your currenty in\` - `, - inline: false - }, - { - name: `**__Admin Commands:__**`, - value: ` - **${prefix}setPrefix** - \`Sets new prefix\` - **${prefix}setChannel** - \`Adds channel to list of allowed channels\` - **${prefix}removeChannel** - \`Removes channel from list of allowed channels\` - **${prefix}setRole** - \`Adds role to list of allowed roles\` - **${prefix}removeRole** - \`Removes role from list of allowed roles\` - **${prefix}togglePingOnPanic** - \`Enable/disable ping role on panic\` - `, - inline: false - }) + // // Help Embed + // const help = new 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: `**__Bot Commands:__**`, + // value: ` + // **${prefix}help** - \`Displays this help page\` + // **${prefix}stats** - \`Displays current Bot statistics\` + // **${prefix}ping** - \`Responds with Pong to check Bot responce\` + // `, + // inline: false + // }, + // { + // name: `**__LPC Commands (1/2):__**`, + // value: ` + // **${prefix}login** - \`Redirects you to connect your discord to LPC(DM only)\` + // **${prefix}logout** - \`Logs out of your current logged in account\` + // **${prefix}validStatus** - \`Shows list of valid statuses to updade to\` + // **${prefix}checkStatus** - \`Check your own or other status\` + // **${prefix}updateStatus** - \`Updates your status\` + // **${prefix}account** - \`returns logged in account\` + // **${prefix}penalCodes** - \`Provides Link to penal codes\` + // **${prefix}namedb** - \`Searches for Civilian by Name\` + // **${prefix}platedb** - \`Searches for Vehicle by Licence Plate #\` + // **${prefix}firearmdb** - \`Searches for Firearms by Serial #\` + // **${prefix}panic** - \`Enables/Disables your panic button\` + // **${prefix}license** - \`Revoke/Reinstate License\` + // `, + // inline: true + // }, + // { + // name: `**__LPC Command (2/2):__**`, + // value: ` + // **${prefix}roles** - \`Shows a list of allowed roles\` + // **${prefix}channels** - \`Shows a list of allowed channels\` + // **${prefix}joincommunity** - \`Joins a community with the given code\` + // **${prefix}leavecommunity** - \`Leaves your current active community\` + // **${prefix}community** - \`Returns the name of the Community your currenty in\` + // `, + // inline: false + // }, + // { + // name: `**__Admin Commands:__**`, + // value: ` + // **${prefix}setPrefix** - \`Sets new prefix\` + // **${prefix}setChannel** - \`Adds channel to list of allowed channels\` + // **${prefix}removeChannel** - \`Removes channel from list of allowed channels\` + // **${prefix}setRole** - \`Adds role to list of allowed roles\` + // **${prefix}removeRole** - \`Removes role from list of allowed roles\` + // **${prefix}togglePingOnPanic** - \`Enable/disable ping role on panic\` + // `, + // inline: false + // }) - 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}` + " `") + // const stats = new 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); - console.debug('"',message.channel.type,'"') - 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, args); - } - 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 == 'togglepingonpanic') { - 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.togglePingOnPanic(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); - } - if (command == 'channels') { - if (message.channel.type=="dm") return message.channel.send(`You cannot see allowed channels in a dm ${message.author}`); - this.channels(message); - } - if (command == 'pingonpanic') { - if (message.channel.type=="dm") return message.channel.send(`You cannot see allowed channels in a dm ${message.author}`); - this.getPingOnPanicStatus(message); - } + // if (command == 'ping') return message.channel.send('Pong!'); + // if (command == 'help') return message.channel.send(help); + // if (command == 'stats') return 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.commandHandler.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.commandHandler.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.commandHandler.removeChannel(message, args); + // } + // 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.commandHandler.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.commandHandler.removeRole(message, args); + // } + // if (command == 'togglepingonpanic') { + // 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.commandHandler.togglePingOnPanic(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.commandHandler.roles(message); + // } + // if (command == 'channels') { + // if (message.channel.type=="dm") return message.channel.send(`You cannot see allowed channels in a dm ${message.author}`); + // this.commandHandler.channels(message); + // } + // if (command == 'pingonpanic') { + // if (message.channel.type=="dm") return message.channel.send(`You cannot see allowed channels in a dm ${message.author}`); + // this.commandHandler.getPingOnPanicStatus(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 (customRoleStatus) { - let hasRole = await this.checkRoleStatus(message); - if (hasRole) { - this.checkStatus(message, args); - } else return message.channel.send(`You don't have permission to use this command ${message.author}`); - } else this.checkStatus(message, args); - } - if (command == 'updatestatus') { - if (customRoleStatus) { - let hasRole = await this.checkRoleStatus(message); - if (hasRole) { - this.updateStatus(message, args, prefix); - } else return message.channel.send(`You don't have permission to use this command ${message.author}`); - } 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 (customRoleStatus) { - let hasRole = await this.checkRoleStatus(message); - if (hasRole) { - this.nameSearch(message, args); - } else return message.channel.send(`You don't have permission to use this command ${message.author}`); - } else this.nameSearch(message, args); - } - if (command == 'platedb') { - if (customRoleStatus) { - let hasRole = await this.checkRoleStatus(message); - if (hasRole) { - this.plateSearch(message, args); - } else return message.channel.send(`You don't have permission to use this command ${message.author}`); - } else this.plateSearch(message, args); - } - if (command == 'firearmdb') { - if (customRoleStatus) { - let hasRole = await this.checkRoleStatus(message); - if (hasRole) { - this.firearmSearch(message, args); - } else return message.channel.send(`You don't have permission to use this command ${message.author}`); - } else this.firearmSearch(message, args); - } - if (command == 'panic') { - if (customRoleStatus) { - let hasRole = await this.checkRoleStatus(message); - if (hasRole) { - this.enablePanic(message); - } else return message.channel.send(`You don't have permission to use this command ${message.author}`); - } else this.enablePanic(message); - } - if (command == 'license') { - if (customRoleStatus) { - let hasRole = await this.checkRoleStatus(message); - if (hasRole) { - this.updateLicense(message, args); - } else return message.channel.send(`You don't have permission to use this command ${message.author}! `); - } else this.updateLicense(message, args); - } - 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.commandHandler.remoteLogin(message, args); + // } + // if (command == 'logout') this.commandHandler.remoteLogout(message); + // if (command == 'validstatus') return message.channel.send(validStatus); + // if (command == 'checkstatus') { + // if (customRoleStatus) { + // let hasRole = await this.commandHandler.checkRoleStatus(message); + // if (hasRole) { + // this.commandHandler.checkStatus(message, args); + // } else return message.channel.send(`You don't have permission to use this command ${message.author}`); + // } else this.commandHandler.checkStatus(message, args); + // } + // if (command == 'updatestatus') { + // if (customRoleStatus) { + // let hasRole = await this.commandHandler.checkRoleStatus(message); + // if (hasRole) { + // this.commandHandler.updateStatus(message, args, prefix); + // } else return message.channel.send(`You don't have permission to use this command ${message.author}`); + // } else this.commandHandler.updateStatus(message, args, prefix); + // } + // if (command == 'account') this.commandHandler.account(message); + // if (command == 'penalcodes') return message.channel.send('https://www.linespolice-cad.com/penal-code'); + // if (command == 'namedb') { + // if (customRoleStatus) { + // let hasRole = await this.commandHandler.checkRoleStatus(message); + // if (hasRole) { + // this.commandHandler.nameSearch(message, args); + // } else return message.channel.send(`You don't have permission to use this command ${message.author}`); + // } else this.commandHandler.nameSearch(message, args); + // } + // if (command == 'platedb') { + // if (customRoleStatus) { + // let hasRole = await this.commandHandler.checkRoleStatus(message); + // if (hasRole) { + // this.commandHandler.plateSearch(message, args); + // } else return message.channel.send(`You don't have permission to use this command ${message.author}`); + // } else this.commandHandler.plateSearch(message, args); + // } + // if (command == 'firearmdb') { + // if (customRoleStatus) { + // let hasRole = await this.checkRoleStatus(message); + // if (hasRole) { + // this.commandHandler.firearmSearch(message, args); + // } else return message.channel.send(`You don't have permission to use this command ${message.author}`); + // } else this.commandHandler.firearmSearch(message, args); + // } + // if (command == 'panic') { + // if (customRoleStatus) { + // let hasRole = await this.commandHandler.checkRoleStatus(message); + // if (hasRole) { + // this.commandHandler.enablePanic(message); + // } else return message.channel.send(`You don't have permission to use this command ${message.author}`); + // } else this.commandHandler.enablePanic(message); + // } + // if (command == 'license') { + // if (customRoleStatus) { + // let hasRole = await this.commandHandler.checkRoleStatus(message); + // if (hasRole) { + // this.commandHandler.updateLicense(message, args); + // } else return message.channel.send(`You don't have permission to use this command ${message.author}! `); + // } else this.commandHandler.updateLicense(message, args); + // } + // if (command == 'joincommunity') this.commandHandler.joinCommunity(message, args); + // if (command == 'leavecommunity') this.commandHandler.leaveCommunity(message); + // if (command == 'community') this.commandHandler.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(); - }); - } - }); - client.login(this.token); - } + // // 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); + // message.channel.send(`Debug: Server responded`) + // socket.disconnect(); + // }); + // } + // }); + // } } -module.exports = {Bot}; +module.exports = {LinesPoliceCadBot}; diff --git a/beta-config.json b/beta-config.json deleted file mode 100644 index 4484641..0000000 --- a/beta-config.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "defaultPrefix": "?", - "version": "Beta 2.0.0", - "socket": "https://police-cad-dev.herokuapp.com/" -} diff --git a/beta.js b/beta.js index 4b1ce25..1f6a26a 100644 --- a/beta.js +++ b/beta.js @@ -1,4 +1,6 @@ -const Bot = require('./LPS').Bot; +const LinesPoliceCadBot = require('./LPS'); +const client = new LinesPoliceCadBot(require('./config/beta-config')); -let client = new Bot('DEVELOPMENT', process.env.token, './beta-config', process.env.mongoURI, process.env.dbo); -client.main() +client.build(); + +module.exports = client; diff --git a/commands.js b/commands.js new file mode 100644 index 0000000..9e5d2de --- /dev/null +++ b/commands.js @@ -0,0 +1,603 @@ +/* +HEY YOU! YEAH YOU! +If you are looking at this file, +that means I am not done, and this is +all the old code for commands that I need +to refactor to be up to date with modern +discord.js bot structure utilizing the +slash command support. So just ignore this +file for now, its just all the old command +logic. +*/ + + +const MongoClient = require('mongodb').MongoClient; +const { MessageEmbed } = require("discord.js"); +const ObjectId = require('mongodb').ObjectID +const randomstring = require('randomstring'); +const io = require('socket.io-client'); + +class Commands { + + constructor(config, mongoURI, dbo) { + this.config = config; + this.connectMongo(mongoURI, dbo); + } + + async connectMongo(mongoURI, dbo) { + this.db = await MongoClient.connect(mongoURI,{useUnifiedTopology:true}); + this.dbo = this.db.db(dbo); + } + + // Updates Prefix + async newPrefix(message, n) { + if (n[0]==undefined) return message.channel.send(`You must provide a \`new prefix\` ${message.author}`); + if (n[0].length<1) return message.channel.send('Your new prefix must be \`1\` character!') + this.dbo.collection("prefixes").updateOne({"server.serverID":message.guild.id},{$set:{"server.prefix":n[0]}},function(err, res) { + if (err) throw err; + message.channel.send(`The new prefix is now **\`${n}\`**`); + }); + } + + // Remote Login + async remoteLogin(message, args) { + return message.channel.send('Login from Lines Police CAD account management https://www.linespolice-cad.com/'); + } + + async remoteLogout(message) { + let user = await this.dbo.collection("users").findOne({"user.discord.id":message.author.id}).then(user => user); + if (!user) return message.channel.send(`You cannot logout if your not logged in ${message.author}`); + this.dbo.collection("users").updateOne({"user.discord.id":message.author.id},{$unset:{"user.discord":""}, $set:{"user.discordConnected":false}},function(err,res) { + if (err) throw err; + message.channel.send(`Succesfully disconnected you Discord account ${message.author}`); + }); + } + + async account(message) { + let user = await this.dbo.collection("users").findOne({"user.discord.id":message.author.id}).then(user => user); + if (user==null) return message.channel.send(`You are not logged in ${message.author}`); + message.author.send(`${message.author} Logged in as **${user.user.username}** | **${user.user.email}**`); + } + + async nameSearch(message, args) { + let user = await this.dbo.collection("users").findOne({"user.discord.id":message.author.id}).then(user => user); + if (!user) return message.channel.send(`You are not logged in ${message.author}`); + let data; + if (user.user.activeCommunity=='' || user.user.activeCommunity==null) { + if (args.length==0) return message.channel.send(`You must provide a \`First Name\`, \`Last Name\` and \`DOB\`(yyyy-mm-dd) ${message.author}`); + if (args.length==1) return message.channel.send(`You're missing a \`Last Name\` and \`DOB\`(yyyy-mm-dd) ${message.author}`); + if (args.length==2) return message.channel.send(`You're missing a \`DOB\`(yyyy-mm-dd) ${message.author}`); + } + if (args.length==0) return message.channel.send(`You must provide a \`First Name\` and \`Last Name\` ${message.author}`); + if (args.length==1) return message.channel.send(`You're missing a \`Last Name\` ${message.author}`); + + if (user.user.activeCommunity=='' || user.user.activeCommunity==null) { + data = { + user: user, + query: { + firstName: args[0], + lastName: args[1], + dateOfBirth: args[2], + activeCommunityID: user.user.activeCommunity + } + } + } else { + data = { + user: user, + query: { + firstName: args[0], + lastName: args[1], + activeCommunityID: user.user.activeCommunity + } + } + } + + const socket = io.connect(this.config.socket); + socket.emit("bot_name_search", data); + socket.on("bot_name_search_results", results => { + + if (results.user._id==user._id) { + if (results.civilians.length == 0) { + return message.channel.send(`Name \`${args[0]} ${args[1]}\` not found ${message.author}`); + } + + for (let i = 0; i < results.civilians.length; i++) { + // Get Drivers Licence Status + let licenceStatus; + if (results.civilians[i].civilian.licenseStatus == 1) licenceStatus = 'Valid'; + if (results.civilians[i].civilian.licenceStatus == 2) licenceStatus = 'Revoked'; + if (results.civilians[i].civilian.licenceStatus == 3) licenceStatus = 'None'; + // Get Firearm Licence Status + let firearmLicence = results.civilians[i].civilian.firearmLicense; + if (firearmLicence == undefined || firearmLicence == null) firearmLicence = 'None'; + if (firearmLicence == '2') firearmLicence = 'Valid'; + if (firearmLicence == '3') firearmLicence = 'Revoked'; + let nameResult = new MessageEmbed() + .setColor('#0099ff') + .setTitle(`**${results.civilians[i].civilian.firstName} ${results.civilians[i].civilian.lastName} | ${results.civilians[i]._id}**`) + .setURL('https://discord.gg/jgUW656v2t') + .setAuthor('LPS Website Support', 'https://raw.githubusercontent.com/Linesmerrill/police-cad/master/lines-police-server.png', 'https://discord.gg/jgUW656v2t') + .setDescription('Name Search Results') + .addFields( + { name: `**First Name**`, value: `\`${results.civilians[i].civilian.firstName}\``, inline: true }, + { name: `**Last Name**`, value: `\`${results.civilians[i].civilian.lastName}\``, inline: true }, + { name: `**DOB**`, value: `\`${results.civilians[i].civilian.birthday}\``, inline: true }, + { name: `**Drivers License**`, value: `\`${licenceStatus}\``, inline: true }, + { name: `**Firearm Licence**`, value: `\`${firearmLicence}\``, inline: true }, + { name: `**Gender**`, value: `\`${results.civilians[i].civilian.gender}\``, inline: true } + ) + // Check Other details + let address = results.civilians[i].civilian.address; + let occupation = results.civilians[i].civilian.occupation; + let height = results.civilians[i].civilian.height; + let weight = results.civilians[i].civilian.weight; + let eyeColor = results.civilians[i].civilian.eyeColor; + let hairColor = results.civilians[i].civilian.hairColor; + if (address != null && address != undefined && address != '') nameResult.addFields({ name: `**Address**`, value: `\`${address}\``, inline: true }); + if (occupation != null && occupation != undefined && occupation != '') nameResult.addFields({ name: `**Occupation**`, value: `\`${occupation}\``, inline: true }); + if (height!=null&&height!=undefined&&height!="NaN"&&height!='') { + if (results.civilians[i].civilian.heightClassification=='imperial') { + let ft = Math.floor(height/12); + let inch = height%12; + nameResult.addFields({ name: '**Height**', value: `\`${ft}'${inch}"\``, inline: true }); + } else { + nameResult.addFields({ name: '**Height**', value: `\`${height}cm\``, inline: true }); + } + } + if (weight!=null&&weight!=undefined&&weight!='') { + if (results.civilians[i].civilian.weightClassification=='imperial') { + nameResult.addFields({ name: '**Weight**', value: `\`${weight}lbs.\``, inline: true }); + } else { + nameResult.addFields({ name: '**Weight**', value: `\`${weight}kgs.\``, inline: true }); + } + } + if (eyeColor!=null&&eyeColor!=undefined&&eyeColor!='') nameResult.addFields({name:'**Eye Color**',value:`\`${eyeColor}\``,inline:true}); + if (hairColor!=null&&hairColor!=undefined&&hairColor!='') nameResult.addFields({name:'**Hair Color**',value:`\`${hairColor}\``,inline:true}); + nameResult.addFields({name:'**Organ Donor**',value:`\`${results.civilians[i].civilian.organDonor}\``,inline:true}); + nameResult.addFields({name:'**Veteran**',value:`\`${results.civilians[i].civilian.veteran}\``,inline:true}); + message.channel.send(nameResult); + } + } + socket.disconnect(); + }); + } + + async plateSearch(message, args) { + let user = await this.dbo.collection("users").findOne({"user.discord.id":message.author.id}).then(user => user); + if (!user) return message.channel.send(`You are not logged in ${message.author}`); + if (args.length==0) return message.channel.send(`You are missing a \`Plate #\` ${message.author}`); + let data = { + user: user, + query: { + plateNumber: args[0], + activeCommunityID: user.user.activeCommunity + } + } + const socket = io.connect(this.config.socket); + socket.emit('bot_plate_search', data); + socket.on('bot_plate_search_results', results => { + + if (results.user._id==user._id) { + if (results.vehicles.length == 0) { + return message.channel.send(`Plate Number \`${args[0]}\` not found ${message.author}`); + } + + for (let i = 0; i < results.vehicles.length; i++) { + let plateResult = new MessageEmbed() + .setColor('#0099ff') + .setTitle(`**${results.vehicles[i].vehicle.plate} | ${results.vehicles[i]._id}**`) + .setURL('https://discord.gg/jgUW656v2t') + .setAuthor('LPS Website Support', 'https://raw.githubusercontent.com/Linesmerrill/police-cad/master/lines-police-server.png', 'https://discord.gg/jgUW656v2t') + .setDescription('Plate Search Results') + .addFields( + { name: `**Plate #**`, value: `\`${results.vehicles[i].vehicle.plate}\``, inline: true }, + { name: `**Vin #**`, value: `\`${results.vehicles[i].vehicle.vin}\``, inline: true }, + { name: `**Model**`, value: `\`${results.vehicles[i].vehicle.model}\``, inline: true }, + { name: `**Color**`, value: `\`${results.vehicles[i].vehicle.color}\``, inline: true }, + { name: `**Owner**`, value: `\`${results.vehicles[i].vehicle.registeredOwner}\``, inline: true }, + ) + // Other details + let validRegistration = results.vehicles[i].vehicle.validRegistration; + let validInsurance = results.vehicles[i].vehicle.validInsurance; + let stolen = results.vehicles[i].vehicle.isStolen; + if (validRegistration=='1') plateResult.addFields({ name: `**Registration**`, value: `\`Valid\``, inline: true }); + if (validRegistration=='2') plateResult.addFields({ name: `**Registration**`, value: `\`InValid\``, inline: true }); + if (validInsurance=='1') plateResult.addFields({ name: `**Insurance**`, value: `\`Valid\``, inline: true }); + if (validInsurance=='2') plateResult.addFields({ name: `**Insurance**`, value: `\`InValid\``, inline: true }); + if (stolen=='1') plateResult.addFields({ name: `**Stolen**`, value: `\`No\``, inline: true }); + if (stolen=='2') plateResult.addFields({ name: `**Stolen**`, value: `\`Yes\``, inline: true }); + message.channel.send(plateResult); + } + } + socket.disconnect(); + }); + } + + async firearmSearch(message, args) { + let user = await this.dbo.collection("users").findOne({"user.discord.id":message.author.id}).then(user => user); + if (!user) return message.channel.send(`You are not logged in ${message.author}`); + if (args.length==0) return message.channel.send(`You are missing a \`Serial Number\` ${message.author}`); + let data = { + user: user, + query: { + serialNumber: args[0], + activeCommunityID: user.user.activeCommunity + } + } + const socket = io.connect(this.config.socket); + socket.emit('bot_firearm_search', data); + socket.on('bot_firearm_search_results', results => { + if (results.user._id==user._id) { + if (results.firearms.length==0) { + return message.channel.send(`No Firearms found ${message.author}`); + } + + for (let i = 0; i < results.firearms.length; i++) { + let firearmResult = new MessageEmbed() + .setColor('#0099ff') + .setTitle(`**${results.firearms[i].firearm.serialNumber} | ${results.firearms[i]._id}**`) + .setURL('https://discord.gg/jgUW656v2t') + .setAuthor('LPS Website Support', 'https://raw.githubusercontent.com/Linesmerrill/police-cad/master/lines-police-server.png', 'https://discord.gg/jgUW656v2t') + .setDescription('Firearm Search Results') + .addFields( + { name: `**Serial Number**`, value: `\`${results.firearms[i].firearm.serialNumber}\``, inline: true }, + { name: `**Type**`, value: `\`${results.firearms[i].firearm.weaponType}\``, inline: true }, + { name: `**Owner**`, value: `\`${results.firearms[i].firearm.registeredOwner}\``, inline: true }, + ) + // Other details + let isStolen = results.firearms[i].firearm.isStolen; + if (isStolen=="false"||isStolen==false) firearmResult.addFields({name:`**Stolen**`,value:'\`No\`',inline: true}); + if (isStolen=="true"||isStolen==true) firearmResult.addFields({name:`**Stolen**`,value:'\`Yes\`',inline: true}); + message.channel.send(firearmResult); + } + } + socket.disconnect(); + }); + } + + async checkStatus(message, args) { + let user = await this.dbo.collection("users").findOne({"user.discord.id":message.author.id}).then(user => user); + if (!user) return message.channel.send(`You are not logged in ${message.author}`); + if (user.user.activeCommunity == null) return message.channel.send(`You must join a community to use this command ${message.author}`); + if (args.length == 0) { + message.channel.send(`${message.author}'s status: \`${user.user.dispatchStatus}\` | Set by: \`${user.user.dispatchStatusSetBy}\``); + } else { + let targetUserID = args[0].replace('<@!', '').replace('>', ''); + let targetUser = await this.dbo.collection("users").findOne({"user.discord.id":targetUserID}).then(user => user); + // This lame line of code to get username without ping on discord + const User = client.users.cache.get(args[0].replace('<@!', '').replace('>', '')); + if (!targetUser) return message.channel.send(`Cannot find **${args[0]}** ${message.author}`); + if (targetUser.user.activeCommunity!=user.user.activeCommunity) { + return message.channel.send(`You are not in the same community as \`${User.tag}\` ${message.author}`); + } + return message.channel.send(`${message.author}, \`${User.tag}'s\` status: \`${targetUser.user.dispatchStatus}\` | Set by: \`${targetUser.user.dispatchStatusSetBy}\``); + } + } + + async updateStatus(message, args, prefix) { + let validStatus=['10-8','10-7','10-6','10-11','10-23','10-97','10-15','10-70','10-80', 'Panic', '10-41', '10-42']; + let user = await this.dbo.collection("users").findOne({"user.discord.id":message.author.id}).then(user => user); + if (!user) return message.channel.send(`You are not logged in ${message.author}`); + if (user.user.activeCommunity==null) return message.channel.send(`You must join a community to use this command ${message.author}`); + if (args.length==0) return message.channel.send(`You must provide a new status ${message.author} | To see a list of valid statuses, use command \`${prefix}validStatus\`.`); + if (!validStatus.includes(args[0])) return message.channel.send(`\`${args[0]}\` is a Invalid Status ${message.author}! To see a list of valid statuses, use command \`${prefix}validStatus\`.`); + let onDuty=null; + let updateDuty=false; + let status = args[0] + if (args[0]=='10-41') { + onDuty=true; + updateDuty=true; + status='Online'; + } + if (args[0]=='10-42') { + onDuty=false; + updateDuty=true; + status='Offline'; + } + let req={ + userID: user._id, + status: status, + setBy: 'Self', + onDuty: onDuty, + updateDuty: updateDuty + }; + const socket = io.connect(this.config.socket); + socket.emit('bot_update_status', req); + socket.on('bot_updated_status', (res) => { + message.channel.send(`Succesfully updated status to \`${args[0]}\` ${message.author}`); + socket.disconnect(); + }); + } + + async enablePanic(message) { + let user = await this.dbo.collection("users").findOne({"user.discord.id":message.author.id}).then(user => user); + if (!user) return message.channel.send(`You are not logged in ${message.author}`); + if (user.user.activeCommunity==null) return message.channel.send(`You must join a community to use this command ${message.author}`); + const socket = io.connect(this.config.socket); + // If panic is enabled, disable panic + if (user.user.dispatchStatus=='Panic') { + let myReq = { + userID: user._id, + communityID: user.user.activeCommunity + }; + socket.emit('clear_panic', myReq); + + let myUpdateReq = { + userID: user._id, + status: '10-8', + setBy: 'System', + onDuty: null, + updateDuty: false + }; + socket.emit('bot_update_status', myUpdateReq); + socket.on('bot_updated_status', (res) => { + message.channel.send(`Disabled Panic ${message.author} and set status to \`10-8\`.`); + socket.disconnect(); + }); + return; + // If panic is disabled, enable panic + } else { + this.updateStatus(message, ['Panic'], null); + let myReq = { + userID: user._id, + userUsername: user.user.username, + activeCommunity: user.user.activeCommunity + } + socket.emit('panic_button_update', myReq); + socket.disconnect(); + let guild = await this.dbo.collection("prefixes").findOne({"server.serverID":message.guild.id}).then(guild => guild); + if (guild.server.pingOnPanic) return message.channel.send(`Attention <@&${guild.server.pingRole}>! \`${user.user.username}\` has activated panic`); + return; + } + } + + async updateLicense(message, args) { + let user = await this.dbo.collection("users").findOne({"user.discord.id":message.author.id}).then(user => user); + if (!user) return message.channel.send(`You are not logged in ${message.author}`); + let data; + if (user.user.activeCommunity=='' || user.user.activeCommunity==null) { + if (args.length==0) return message.channel.send(`You must provide a \`License Status\`, \`First Name\`, \`Last Name\`, \`DOB\`(yyyy-mm-dd) ${message.author}`); + if (args.length==1) return message.channel.send(`You're missing a \`First Name\`, \`Last Name\` and \`DOB\`(yyyy-mm-dd) ${message.author}`); + if (args.length==2) return message.channel.send(`You're missing a \`Last Name\` and \`DOB\`(yyyy-mm-dd) ${message.author}`); + if (args.length==3) return message.channel.send(`You're missing a \`DOB\`(yyyy-mm-dd) ${message.author}`); + if (args[0].toLowerCase()!='revoke'&&args[0].toLowerCase()!='reinstate') return message.channel.send(`Invalid License Status, choose \`revoke\` or \`reinstate\` ${message.author}`); + } + if (args.length==0) return message.channel.send(`You must provide a \`License Status\`, \`First Name\` and \`Last Name\` ${message.author}`); + if (args.length==1) return message.channel.send(`You're missing a \`First Name\` and \`Last Name\` ${message.author}`); + if (args.length==2) return message.channel.send(`You're missing a \`Last Name\` ${message.author}`); + if (args[0].toLowerCase()!='revoke'&&args[0].toLowerCase()!='reinstate') return message.channel.send(`Invalid License Status, choose \`revoke\` or \`reinstate\` ${message.author}`); + + if (user.user.activeCommunity=='' || user.user.activeCommunity==null) { + data = { + user: user, + query: { + firstName: args[1], + lastName: args[2], + dateOfBirth: args[3], + activeCommunityID: user.user.activeCommunity + } + } + } else { + data = { + user: user, + query: { + firstName: args[1], + lastName: args[2], + activeCommunityID: user.user.activeCommunity + } + } + } + + const socket = io.connect(this.config.socket); + socket.emit("bot_name_search", data); + socket.on("bot_name_search_results", (results) => { + if (results.user._id==user._id) { + if (results.civilians.length == 0) { + return message.channel.send(`Name \`${args[1]} ${args[2]}\` not found ${message.author}`); + } + } + + let query = { + _id: results.civilians[0]._id, + status: null, + bot_request: true + }; + if (args[0]=='revoke') query.status = 2; + if (args[0]=='reinstate') query.status = 1; + socket.emit("update_drivers_license_status", query); + socket.on("bot_updated_drivers_license_status", (res) => { + if (!res.success) return message.channel.send(`Failed to update license of \`${args[1]} ${args[2]}\` ${message.author}`); + message.channel.send(`Successfully updated license of \`${args[1]} ${args[2]}\` ${message.author}`); + socket.disconnect(); + return; + }); + }); + } + + async joinCommunity(message, args) { + let user = await this.dbo.collection("users").findOne({"user.discord.id":message.author.id}).then(user => user); + if (!user) return message.channel.send(`You are not logged in ${message.author}`); + if (args.length==0) return message.channel.send(`You must provide a \`Community Code\` ${message.author}`); + let myReq = { + userID: user._id, + communityCode: args[0] + }; + const socket = io.connect(this.config.socket); + socket.emit('bot_join_community', myReq); + socket.on('bot_joined_community', (data) => { + socket.disconnect() + if (data.error) { + return message.channel.send(`${data.error} ${message.author}`); + } + return message.channel.send(`Successfully joined the community \` ${data.commName} \` ${message.author}`) + }); + } + + async leaveCommunity(message) { + let user = await this.dbo.collection("users").findOne({"user.discord.id":message.author.id}).then(user => user); + if (!user) return message.channel.send(`You are not logged in ${message.author}`); + let myReq = { + userID: user._id + }; + const socket = io.connect(this.config.socket); + socket.emit('bot_leave_community', myReq); + socket.on('bot_left_community', (data) => { + socket.disconnect() + if (data.error) { + return message.channel.send(`${data.error} ${message.author}`); + } + return message.channel.send(`${data.message} ${message.author}`) + }); + } + + async community(message) { + let user = await this.dbo.collection("users").findOne({"user.discord.id":message.author.id}).then(user => user); + if (!user) return message.channel.send(`You are not logged in ${message.author}`); + if (user.user.activeCommunity==null) return message.channel.send(`You are not in a community ${message.author}`); + let community = await this.dbo.collection("communities").findOne({_id:ObjectId(user.user.activeCommunity)}).then(community => community); + if (!community) return message.channel.send(`Community not found ${message.author}`); + 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(`Successfully 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.hasCustomRoles==false) 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(`Successfully 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(`Successfully 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 roles = "Allowed Roles:"; + for (let i = 0; i < guild.server.allowedRoles.length; i++) { + if (guild.server.allowedRoles[i] == undefined) break; + 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 channelid = args[0].replace('<#', '').replace('>', ''); + let channel = client.channels.cache.get(channelid); + if (!channel) return message.channel.send(`Cannot find that channel ${message.author}`); + if (channel.type=="voice") return message.channel.send(`Connot set voice channel to preferred channel ${message.author}`); + if (channel.deleted) return message.channel.send(`Connot set deleted channel to preferred channel ${message.author}`); + let guild = await this.dbo.collection("prefixes").findOne({"server.serverID":message.guild.id}).then(guild => guild); + if (guild.server.allowedChannels!=undefined&&guild.server.allowedChannels.includes(channelid)) return message.channel.send(`The channel ${args[0]} has already been added ${message.author}`); + this.dbo.collection("prefixes").updateOne({"server.serverID":message.guild.id},{$push:{"server.allowedChannels":channelid},$set:{"server.hasCustomChannels":true}},function(err, res) { + if (err) throw err; + return message.channel.send(`Successfully added ${args[0]} to allowed channels ${message.author}`); + }); + } + + async removeChannel(message, args) { + if (args.length==0) return message.channel.send(`You must provide a channel ${message.author}`); + let channelid = args[0].replace('<#', '').replace('>', ''); + let channel = client.channels.cache.get(channelid); + if (!channel) return message.channel.send(`Uh Oh! The channel ${args[0]} connot be found.`); + let guild = await this.dbo.collection("prefixes").findOne({"server.serverID":message.guild.id}).then(guild => guild); + if (guild.server.hasCustomChannels==false) return message.channel.send(`There are no channels to be removed ${message.author}`); + if (!guild.server.allowedChannels.includes(channelid)) return message.channel.send(`The channel ${args[0]} is not added to your roles ${message.author}`); + for (let i = 0; i < guild.server.allowedChannels.length; i++) { + if (guild.server.allowedChannels[i]==channelid) { + if ((guild.server.allowedChannels.length-1)==0) { + this.dbo.collection("prefixes").updateOne({"server.serverID":message.guild.id},{$pull:{"server.allowedChannels":channelid},$set:{"server.hasCustomChannels":false}},function(err, res) { + if (err) throw err; + return message.channel.send(`Successfully removed ${args[0]} from allowed channels ${message.author}! There are no more allowed channels.`); + }); + } else if ((guild.server.allowedChannels.length-1)>0) { + this.dbo.collection("prefixes").updateOne({"server.serverID":message.guild.id},{$pull:{"server.allowedChannels":channelid}},function(err, res) { + if (err) throw err; + return message.channel.send(`Successfully removed ${args[0]} from allowed channels ${message.author}`); + }); + } + } + } + } + + async channels(message) { + let guild = await this.dbo.collection("prefixes").findOne({"server.serverID":message.guild.id}).then(guild => guild); + if (guild.server.hasCustomChannels==false) { + return message.channel.send('There are no channels set for the bot.'); + } + + let channels = "Allowed Channels:"; + for (let i = 0; i < guild.server.allowedChannels.length; i++) { + if (guild.server.allowedChannels[i] == undefined) break; + channels += `\n<#${guild.server.allowedChannels[i]}>`; + } + return message.channel.send(channels); + } + + async togglePingOnPanic(message, args) { + if (args.length==0) return message.channel.send(`You must provide a \`Ping On Role Status\` and a \`role\` to ping ${message.author}`); + if (args[0]=="false") { + // disable ping on panic and remove ping role + this.dbo.collection("prefixes").updateOne({"server.serverID":message.guild.id},{$set:{"server.pingOnPanic":false,"server.pingRole":null}},function(err, res) { + if (err) throw err; + return message.channel.send(`Successfully disabled ping role on panic ${message.author}`); + }); + } else if (args[0]=="true") { + if (!args[1]) return message.channel.send(`You must provide a \`role\` to ping ${message.author}`); + let roleid = args[1].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[1]} connot be found.`); + } else { + this.dbo.collection("prefixes").updateOne({"server.serverID":message.guild.id},{$set:{"server.pingRole":roleid,"server.pingOnPanic":true}},function(err, res) { + if (err) throw err; + return message.channel.send(`Successfully set ${args[1]} to be pinged on panic ${message.author}`); + }); + } + } else return message.channel.send(`\`${args[0]}\` is an invalid status, use \`true\` or \`false\` ${message.author}`); + } + + async getPingOnPanicStatus(message) { + let guild = await this.dbo.collection("prefixes").findOne({"server.serverID":message.guild.id}).then(guild => guild); + return message.channel.send(`Current Ping on Panic Status: ${guild.server.pingOnPanic} ${message.author}`); + } +} + +module.exports = {Commands}; \ No newline at end of file diff --git a/commands/help.js b/commands/help.js new file mode 100644 index 0000000..60c5692 --- /dev/null +++ b/commands/help.js @@ -0,0 +1,165 @@ +const { MessageEmbed } = require("discord.js"); + +module.exports = { + name: "help", + description: "Get information on a specific command", + usage: "[command]", + permissions: { + channel: ["VIEW_CHANNEL", "SEND_MESSAGES", "EMBED_LINKS"], + member: [], + }, + aliases: ["command", "commands", "cmd"], + /** + * + * @param {import("../LPS")} client + * @param {import("discord.js").Message} message + * @param {string[]} args + * @param {*} param3 + */ + run: async (client, message, args, { GuildDB }) => { + let Commands = client.commands.map( + (cmd) => + `\`${GuildDB ? GuildDB.prefix : client.config.DefaultPrefix}${ + cmd.name + }${cmd.usage ? " " + cmd.usage : ""}\` - ${cmd.description}` + ); + + let Embed = new MessageEmbed() + .setAuthor( + `Commands of ${client.user.username}`, + client.config.IconURL + ) + .setColor(client.config.EmbedColor) + .setFooter( + `To get info of each command type ${ + GuildDB ? GuildDB.prefix : client.config.DefaultPrefix + }help [Command] | Have a nice day!` + ).setDescription(`${Commands.join("\n")} + + Lines Police CAD Bot Version: v${client.config.Version}`); + if (!args[0]) message.channel.send(Embed); + else { + let cmd = + client.commands.get(args[0]) || + client.commands.find((x) => x.aliases && x.aliases.includes(args[0])); + if (!cmd) + return client.sendTime( + message.channel, + `❌ | Unable to find that command.` + ); + + let embed = new MessageEmbed() + .setAuthor(`Command: ${cmd.name}`, client.config.IconURL) + .setDescription(cmd.description) + .setColor("GREEN") + //.addField("Name", cmd.name, true) + .addField("Aliases", `\`${cmd.aliases.join(", ")}\``, true) + .addField( + "Usage", + `\`${GuildDB ? GuildDB.prefix : client.config.DefaultPrefix}${ + cmd.name + }${cmd.usage ? " " + cmd.usage : ""}\``, + true + ) + .addField( + "Permissions", + "Member: " + + cmd.permissions.member.join(", ") + + "\nBot: " + + cmd.permissions.channel.join(", "), + true + ) + .setFooter( + `Prefix - ${ + GuildDB ? GuildDB.prefix : client.config.DefaultPrefix + }` + ); + + message.channel.send(embed); + } + }, + + SlashCommand: { + options: [ + { + name: "command", + description: "Get information on a specific command", + value: "command", + type: 3, + required: false, + }, + ], + /** + * + * @param {import("../LPS")} client + * @param {import("discord.js").Message} message + * @param {string[]} args + * @param {*} param3 + */ + + run: async (client, interaction, args, { GuildDB }) => { + let Commands = client.commands.map( + (cmd) => + `\`${GuildDB ? GuildDB.prefix : client.config.DefaultPrefix}${ + cmd.name + }${cmd.usage ? " " + cmd.usage : ""}\` - ${cmd.description}` + ); + + let Embed = new MessageEmbed() + .setAuthor( + `Commands of ${client.user.username}`, + client.config.IconURL + ) + .setColor(client.config.EmbedColor) + .setFooter( + `To get info of each command type ${ + GuildDB ? GuildDB.prefix : client.config.DefaultPrefix + }help [Command] | Have a nice day!` + ).setDescription(`${Commands.join("\n")} + + Lines Police CAD Bot Version: v${client.Version}`); + if (!args) return interaction.send(Embed); + else { + let cmd = + client.commands.get(args[0].value) || + client.commands.find( + (x) => x.aliases && x.aliases.includes(args[0].value) + ); + if (!cmd) + return client.sendTime( + interaction, + `❌ | Unable to find that command.` + ); + + let embed = new MessageEmbed() + .setAuthor(`Command: ${cmd.name}`, client.config.IconURL) + .setDescription(cmd.description) + .setColor("GREEN") + //.addField("Name", cmd.name, true) + .addField("Aliases", cmd.aliases.join(", "), true) + .addField( + "Usage", + `\`${GuildDB ? GuildDB.prefix : client.config.DefaultPrefix}${ + cmd.name + }\`${cmd.usage ? " " + cmd.usage : ""}`, + true + ) + .addField( + "Permissions", + "Member: " + + cmd.permissions.member.join(", ") + + "\nBot: " + + cmd.permissions.channel.join(", "), + true + ) + .setFooter( + `Prefix - ${ + GuildDB ? GuildDB.prefix : client.config.DefaultPrefix + }` + ); + + interaction.send(embed); + } + }, + }, +}; \ No newline at end of file diff --git a/commands/stats.js b/commands/stats.js new file mode 100644 index 0000000..1e9aa55 --- /dev/null +++ b/commands/stats.js @@ -0,0 +1,50 @@ +const { MessageEmbed } = require("discord.js"); +require("moment-duration-format"); + +module.exports = { + name: "stats", + description: "Displays current Bot statistics", + usage: "", + permissions: { + channel: ["VIEW_CHANNEL", "SEND_MESSAGES", "EMBED_LINKS"], + member: [], + }, + aliases: ["stat", "statistics", "info"], + /** + * + * @param {import("../LPS")} client + * @param {import("discord.js").Message} message + * @param {string[]} args + * @param {*} param3 + */ + run: async (client, message) => { + const stats = new 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}` + " `") + return message.channel.send(stats) + }, + SlashCommand: { + /** + * + * @param {import("../LPS")} client + * @param {import("discord.js").Message} message + * @param {string[]} args + * @param {*} param3 + */ + run: async (client, interaction) => { + const { version } = require("discord.js"); + const stats = new 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}` + " `") + return message.channel.send(stats) + }, + }, +}; \ No newline at end of file diff --git a/config.json b/config.json deleted file mode 100644 index 2d0fda4..0000000 --- a/config.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "defaultPrefix": "?", - "version": "2.0.0", - "socket": "https://www.linespolice-cad.com/" -} diff --git a/config/beta-config.js b/config/beta-config.js new file mode 100644 index 0000000..03d986a --- /dev/null +++ b/config/beta-config.js @@ -0,0 +1,24 @@ +module.exports = { + Dev: "DEVELOPMENT", + Version: "2.0.0 Beta", + Admins: ["userID", "userID"], // Admins of the bot + defaultPrefix: "?", + socket: "https://www.linespolice-cad.com/", + SupportServer: "https://discord.gg/w2g2FFmHbF", //Support Server Link + Token: process.env.TOKEN || "", //Discord Bot Token + Scopes: ["identify", "guilds", "applications.commands"], //Discord OAuth2 Scopes + IconURL: "https://raw.githubusercontent.com/Linesmerrill/police-cad/master/lines-police-server.png", + EmbedColor: "#0099ff", + Permissions: 2205281600, + Website: "https://linespolice-cad.com", + api_url: process.env.API_URL || "", + api_token: process.env.API_TOKEN || "", + mongoURI: process.env.mongoURI || "mongodb://localhost:27017", + dbo: process.env.dbo || "knoldus", + + Presence: { + status: "online", // You can show online, idle, and dnd + name: "GTA V", // The message shown + type: "Playing", // PLAYING, WATCHING, LISTENING, STREAMING + }, +} diff --git a/config/config.js b/config/config.js new file mode 100644 index 0000000..f3a86e4 --- /dev/null +++ b/config/config.js @@ -0,0 +1,24 @@ +module.exports = { + Dev: "PRODUCTION", + Version: "2.0.0", + Admins: ["userID", "userID"], // Admins of the bot + defaultPrefix: "?", + socket: "https://www.linespolice-cad.com/", + SupportServer: "https://discord.gg/w2g2FFmHbF", //Support Server Link + Token: process.env.TOKEN || "", //Discord Bot Token + Scopes: ["identify", "guilds", "applications.commands"], //Discord OAuth2 Scopes + IconURL: "https://raw.githubusercontent.com/Linesmerrill/police-cad/master/lines-police-server.png", + EmbedColor: "#0099ff", + Permissions: 2205281600, + Website: "https://linespolice-cad.com", + api_url: process.env.API_URL || "", + api_token: process.env.API_TOKEN || "", + mongoURI: process.env.mongoURI || "mongodb://localhost:27017", + dbo: process.env.dbo || "knoldus", + + Presence: { + status: "online", // You can show online, idle, and dnd + name: "GTA V", // The message shown + type: "Playing", // PLAYING, WATCHING, LISTENING, STREAMING + }, +} diff --git a/events/guildCreate.js b/events/guildCreate.js new file mode 100644 index 0000000..d2cfaf4 --- /dev/null +++ b/events/guildCreate.js @@ -0,0 +1,3 @@ +module.exports = (client, guild) => { + require("../util/RegisterSlashCommands")(client, guild.id); +}; \ No newline at end of file diff --git a/events/message.js b/events/message.js new file mode 100644 index 0000000..9f735f3 --- /dev/null +++ b/events/message.js @@ -0,0 +1,70 @@ +/** + * + * @param {require("../LPS")} client + * @param {require("discord.js").Message} message + * @returns {void} or nothing if you didn't know + */ + +module.exports = async (client, message) => { + if (message.author.bot || message.channel.type === "dm") return; + let prefix = client.config.DefaultPrefix; + + let GuildDB = await client.GetGuild(message.guild.id); + if (GuildDB && GuildDB.prefix) prefix = GuildDB.prefix; + + //Initialize GuildDB + if (!GuildDB) { + await client.database.guild.set(message.guild.id, { + prefix: prefix, + DJ: null, + }); + GuildDB = await client.GetGuild(message.guild.id); + } + + //Prefixes also have mention match + const prefixMention = new RegExp(`^<@!?${client.user.id}> `); + prefix = message.content.match(prefixMention) + ? message.content.match(prefixMention)[0] + : prefix; + + if (message.content.indexOf(prefix) !== 0) return; + + const args = message.content.slice(prefix.length).trim().split(/ +/g); + //Making the command lowerCase because our file name will be in lowerCase + const command = args.shift().toLowerCase(); + + //Searching a command + const cmd = + client.commands.get(command) || + client.commands.find((x) => x.aliases && x.aliases.includes(command)); + + //Executing the codes when we get the command or aliases + if (cmd) { + if ( + (cmd.permissions && + cmd.permissions.channel && + !message.channel + .permissionsFor(client.user) + .has(cmd.permissions.channel)) || + (cmd.permissions && + cmd.permissions.member && + !message.channel + .permissionsFor(message.member) + .has(cmd.permissions.member)) || + (cmd.permissions && + GuildDB.DJ && + !message.channel + .permissionsFor(message.member) + .has(["ADMINISTRATOR"]) && + !message.member.roles.cache.has(GuildDB.DJ)) + ) + return client.sendError( + message.channel, + "Missing Permissions!" + GuildDB.DJ + ? " You need the `DJ` role to access this command." + : "" + ); + cmd.run(client, message, args, { GuildDB }); + client.CommandsRan++; + } else return; +}; \ No newline at end of file diff --git a/events/ready.js b/events/ready.js new file mode 100644 index 0000000..2a8a892 --- /dev/null +++ b/events/ready.js @@ -0,0 +1,12 @@ +module.exports = async (client) => { + (client.Ready = true), + client.user.setPresence({ + status: client.config.Presence.status, // You can show online, idle, and dnd + activity: { + name: client.config.Presence.name, + type: client.config.Presence.type, + }, +}); + client.log("Successfully Logged in as " + client.user.tag); // You can change the text if you want, but DO NOT REMOVE "client.user.tag" + client.RegisterSlashCommands(); +}; \ No newline at end of file diff --git a/index.js b/index.js index b756a3c..112bfc2 100644 --- a/index.js +++ b/index.js @@ -1,4 +1,6 @@ -const Bot = require('./LPS').Bot; +const LinesPoliceCadBot = require('./LPS'); +const client = new LinesPoliceCadBot(require('./config/config')); -let client = new Bot('PRODUCTION', process.env.token, './config', process.env.mongoURI, process.env.dbo); -client.main() +client.build(); + +module.exports = client; diff --git a/package-lock.json b/package-lock.json index 0b02f36..cabbbe4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,9 +1,2493 @@ { "name": "lps-bot", "version": "1.0.0", - "lockfileVersion": 1, + "lockfileVersion": 2, "requires": true, + "packages": { + "": { + "name": "lps-bot", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "colors": "^1.4.0", + "discord.js": "^12.5.3", + "express": "^4.17.1", + "moment-duration-format": "^2.3.2", + "mongodb": "^3.6.8", + "nodemon": "^2.0.14", + "randomstring": "^1.2.1", + "socket.io-client": "^4.1.2", + "winston": "^3.6.0" + } + }, + "node_modules/@colors/colors": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", + "integrity": "sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==", + "engines": { + "node": ">=0.1.90" + } + }, + "node_modules/@dabh/diagnostics": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@dabh/diagnostics/-/diagnostics-2.0.3.tgz", + "integrity": "sha512-hrlQOIi7hAfzsMqlGSFyVucrx38O+j6wiGOf//H2ecvIEqYN4ADBSS2iLMh5UFyDunCNniUIPk/q3riFv45xRA==", + "dependencies": { + "colorspace": "1.1.x", + "enabled": "2.0.x", + "kuler": "^2.0.0" + } + }, + "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==", + "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==", + "dependencies": { + "defer-to-connect": "^1.0.1" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@types/component-emitter": { + "version": "1.2.10", + "resolved": "https://registry.npmjs.org/@types/component-emitter/-/component-emitter-1.2.10.tgz", + "integrity": "sha512-bsjleuRKWmGqajMerkzox19aGbscQX5rmmvvXl3wlIp5gMG1HgkiwPxsN5p070fBDKTNSPgojVbuY1+HWMbFhg==" + }, + "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==" + }, + "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.1", + "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.1.tgz", + "integrity": "sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w==", + "dependencies": { + "string-width": "^4.1.0" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "engines": { + "node": ">=8" + } + }, + "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==", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/anymatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", + "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", + "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/array-uniq": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.2.tgz", + "integrity": "sha1-X8w3OSB3VyPP1k1lxkvvU7+eum0=", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/async": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.3.tgz", + "integrity": "sha512-spZRyzKL5l5BZQrr/6m/SqFdBN0q3OCI0f9rjfBzCMBIP4p75P620rR3gTmaksNOhmzgdxcaxdNfMy6anrbM0g==" + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + }, + "node_modules/backo2": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/backo2/-/backo2-1.0.2.tgz", + "integrity": "sha1-MasayLEpNjRj41s+u2n038+6eUc=" + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + }, + "node_modules/base64-arraybuffer": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-0.1.4.tgz", + "integrity": "sha1-mBjHngWbE1X5fgQooBfIOOkLqBI=", + "engines": { + "node": ">= 0.6.0" + } + }, + "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==", + "engines": { + "node": ">=8" + } + }, + "node_modules/bl": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/bl/-/bl-2.2.1.tgz", + "integrity": "sha512-6Pesp1w0DEX1N550i/uGV/TqucVL4AM/pgThFSN/Qq9si1/DF9aIHs1BxD8V/QU0HoeHO6cQRTAuYnLPKq1e4g==", + "dependencies": { + "readable-stream": "^2.3.5", + "safe-buffer": "^5.1.1" + } + }, + "node_modules/body-parser": { + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", + "integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==", + "dependencies": { + "bytes": "3.1.0", + "content-type": "~1.0.4", + "debug": "2.6.9", + "depd": "~1.1.2", + "http-errors": "1.7.2", + "iconv-lite": "0.4.24", + "on-finished": "~2.3.0", + "qs": "6.7.0", + "raw-body": "2.4.0", + "type-is": "~1.6.17" + }, + "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": "5.1.2", + "resolved": "https://registry.npmjs.org/boxen/-/boxen-5.1.2.tgz", + "integrity": "sha512-9gYgQKXx+1nP8mP7CzFyaUARhg7D3n1dF/FnErWmu9l6JvGpNUN278h0aSb+QjoiKSWG+iZ3uHrcqk0qrY9RQQ==", + "dependencies": { + "ansi-align": "^3.0.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" + }, + "engines": { + "node": ">=10" + }, + "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==", + "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==", + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/bson": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/bson/-/bson-1.1.6.tgz", + "integrity": "sha512-EvVNVeGo4tHxwi8L6bPj3y3itEvStdwvvlojVxxbyYfoaxJ6keLgrTuKdyfEAszFK+H3olzBuafE0yoh0D1gdg==", + "engines": { + "node": ">=0.6.19" + } + }, + "node_modules/bytes": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", + "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==", + "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==", + "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==", + "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==", + "engines": { + "node": ">=8" + } + }, + "node_modules/camelcase": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.2.0.tgz", + "integrity": "sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "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==", + "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==", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/chokidar": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.2.tgz", + "integrity": "sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ==", + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "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==" + }, + "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==", + "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=", + "dependencies": { + "mimic-response": "^1.0.0" + } + }, + "node_modules/color": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/color/-/color-3.2.1.tgz", + "integrity": "sha512-aBl7dZI9ENN6fUGC7mWpMTPNHmWUSNan9tuWN6ahh5ZLNk9baLJOnSMlrQkHcrfFgz2/RigjUVAjdx36VcemKA==", + "dependencies": { + "color-convert": "^1.9.3", + "color-string": "^1.6.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==", + "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==" + }, + "node_modules/color-string": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.0.tgz", + "integrity": "sha512-9Mrz2AQLefkH1UvASKj6v6hj/7eWgjnT/cVsR8CumieLoT+g900exWeNogqtweI8dxloXN9BDQTYro1oWu/5CQ==", + "dependencies": { + "color-name": "^1.0.0", + "simple-swizzle": "^0.2.2" + } + }, + "node_modules/color/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/color/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, + "node_modules/colors": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", + "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==", + "engines": { + "node": ">=0.1.90" + } + }, + "node_modules/colorspace": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/colorspace/-/colorspace-1.1.4.tgz", + "integrity": "sha512-BgvKJiuVu1igBUF2kEjRCZXol6wiiGbY5ipL/oVPwm0BL9sIpMIzM8IK7vwuxIIzOXMV3Ey5w+vxhm0rR/TN8w==", + "dependencies": { + "color": "^3.1.3", + "text-hex": "1.0.x" + } + }, + "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/component-emitter": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", + "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==" + }, + "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=" + }, + "node_modules/configstore": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/configstore/-/configstore-5.0.1.tgz", + "integrity": "sha512-aMKprgk5YhBNyH25hj8wGt2+D52Sw1DRRIzqBwLp2Ya9mFmY8KPvvtvmna8SxVR9JMZ4kzMD68N22vlaRpkeFA==", + "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.3", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz", + "integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==", + "dependencies": { + "safe-buffer": "5.1.2" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/content-disposition/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "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-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" + }, + "node_modules/core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + }, + "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==", + "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==", + "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=", + "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==", + "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==" + }, + "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/denque": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/denque/-/denque-1.5.0.tgz", + "integrity": "sha512-CYiCSgIF1p6EUByQPlGkKnP1M9g0ZV3qMIrqMqZqdwazygIA/YP2vrbcyl1h/WppKJTdl1F85cXIle+394iDAQ==", + "engines": { + "node": ">=0.10" + } + }, + "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.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.1", + "prism-media": "^1.2.9", + "setimmediate": "^1.0.5", + "tweetnacl": "^1.0.3", + "ws": "^7.4.4" + }, + "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==", + "dependencies": { + "is-obj": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/duplexer3": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", + "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=" + }, + "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/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==" + }, + "node_modules/enabled": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/enabled/-/enabled-2.0.0.tgz", + "integrity": "sha512-AKrN98kuwOzMIdAizXGI86UFBoo26CL21UM763y1h/GMSJ4/OHU9k2YlsmBpyScFo/wbLzWQJBMCW4+IO3/+OQ==" + }, + "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==", + "dependencies": { + "once": "^1.4.0" + } + }, + "node_modules/engine.io-client": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-5.1.2.tgz", + "integrity": "sha512-blRrgXIE0A/eurWXRzvfCLG7uUFJqfTGFsyJzXSK71srMMGJ2VraBLg8Mdw28uUxSpVicepBN9X7asqpD1mZcQ==", + "dependencies": { + "base64-arraybuffer": "0.1.4", + "component-emitter": "~1.3.0", + "debug": "~4.3.1", + "engine.io-parser": "~4.0.1", + "has-cors": "1.1.0", + "parseqs": "0.0.6", + "parseuri": "0.0.6", + "ws": "~7.4.2", + "yeast": "0.1.2" + } + }, + "node_modules/engine.io-client/node_modules/debug": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", + "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/engine.io-client/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/engine.io-client/node_modules/ws": { + "version": "7.4.6", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.6.tgz", + "integrity": "sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==", + "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/engine.io-parser": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-4.0.2.tgz", + "integrity": "sha512-sHfEQv6nmtJrq6TKuIz5kyEKH/qSdK56H/A+7DnAuUPWosnIZAS2NHNcPLmyjtY3cGS/MqJdZbUjW97JU72iYg==", + "dependencies": { + "base64-arraybuffer": "0.1.4" + }, + "engines": { + "node": ">=8.0.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==", + "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.1", + "resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz", + "integrity": "sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==", + "dependencies": { + "accepts": "~1.3.7", + "array-flatten": "1.1.1", + "body-parser": "1.19.0", + "content-disposition": "0.5.3", + "content-type": "~1.0.4", + "cookie": "0.4.0", + "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.5", + "qs": "6.7.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.1.2", + "send": "0.17.1", + "serve-static": "1.14.1", + "setprototypeof": "1.1.1", + "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/cookie": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz", + "integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg==", + "engines": { + "node": ">= 0.6" + } + }, + "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/express/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "node_modules/fecha": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/fecha/-/fecha-4.2.1.tgz", + "integrity": "sha512-MMMQ0ludy/nBs1/o0zVOiKTpG7qMbonKUzjJgQFEuvq6INZ1OraKPRAWkBq5vlKLOUMpmNYG1JoN3oDPUQ9m3Q==" + }, + "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==", + "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/fn.name": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fn.name/-/fn.name-1.1.0.tgz", + "integrity": "sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw==" + }, + "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==", + "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==", + "dependencies": { + "pump": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/global-dirs": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-3.0.0.tgz", + "integrity": "sha512-v8ho2DS5RiCjftj1nD9NmnfaOzTdud7RRnVd9kFNOjqZbISlx5DQ+OrTkywgd0dIt7oFCvKetZSHoHcP3sDdiA==", + "dependencies": { + "ini": "2.0.0" + }, + "engines": { + "node": ">=10" + }, + "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==", + "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.8", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.8.tgz", + "integrity": "sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg==" + }, + "node_modules/has-cors": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-cors/-/has-cors-1.1.0.tgz", + "integrity": "sha1-XkdHk/fqmEPRu5nCPu9J/xJv/zk=" + }, + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "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==", + "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==" + }, + "node_modules/http-errors": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz", + "integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==", + "dependencies": { + "depd": "~1.1.2", + "inherits": "2.0.3", + "setprototypeof": "1.1.1", + "statuses": ">= 1.5.0 < 2", + "toidentifier": "1.0.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/http-errors/node_modules/inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + }, + "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=" + }, + "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=", + "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=", + "engines": { + "node": ">=0.8.19" + } + }, + "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": "2.0.0", + "resolved": "https://registry.npmjs.org/ini/-/ini-2.0.0.tgz", + "integrity": "sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA==", + "engines": { + "node": ">=10" + } + }, + "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-arrayish": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", + "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==" + }, + "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==", + "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==", + "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=", + "engines": { + "node": ">=0.10.0" + } + }, + "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==", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-installed-globally": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.4.0.tgz", + "integrity": "sha512-iwGqO3J21aaSkC7jWnHP/difazwS7SFeIqxv6wEtLU8Y5KlzFTjyqcSIT0d8s4+dDhKytsk9PJZ2BkS5eZwQRQ==", + "dependencies": { + "global-dirs": "^3.0.0", + "is-path-inside": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-npm": { + "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==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "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==", + "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==", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" + }, + "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==" + }, + "node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "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=" + }, + "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==", + "dependencies": { + "json-buffer": "3.0.0" + } + }, + "node_modules/kuler": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/kuler/-/kuler-2.0.0.tgz", + "integrity": "sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A==" + }, + "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==", + "dependencies": { + "package-json": "^6.3.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/logform": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/logform/-/logform-2.4.0.tgz", + "integrity": "sha512-CPSJw4ftjf517EhXZGGvTHHkYobo7ZCc0kvwUoOYcjfR2UVrI66RHj8MCrfAdEitdmFqbu2BYdYs8FHHZSb6iw==", + "dependencies": { + "@colors/colors": "1.5.0", + "fecha": "^4.2.0", + "ms": "^2.1.1", + "safe-stable-stringify": "^2.3.1", + "triple-beam": "^1.3.0" + } + }, + "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==", + "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==", + "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==", + "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/memory-pager": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/memory-pager/-/memory-pager-1.5.0.tgz", + "integrity": "sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg==", + "optional": true + }, + "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.48.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.48.0.tgz", + "integrity": "sha512-FM3QwxV+TnZYQ2aRqhlKBMHxk10lTbMt3bBkMAp54ddrNeVSfcQYOOKuGuy3Ddrm38I04If834fOUSq1yzslJQ==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.31", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.31.tgz", + "integrity": "sha512-XGZnNzm3QvgKxa8dpzyhFTHmpP3l5YNusmne07VUOXxou9CqUqYa/HBy124RqtVh/O2pECas/MOcsDgpilPOPg==", + "dependencies": { + "mime-db": "1.48.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==", + "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==", + "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==" + }, + "node_modules/moment-duration-format": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/moment-duration-format/-/moment-duration-format-2.3.2.tgz", + "integrity": "sha512-cBMXjSW+fjOb4tyaVHuaVE/A5TqkukDWiOfxxAjY+PEqmmBQlLwn+8OzwPiG3brouXKY5Un4pBjAeB6UToXHaQ==" + }, + "node_modules/mongodb": { + "version": "3.6.8", + "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-3.6.8.tgz", + "integrity": "sha512-sDjJvI73WjON1vapcbyBD3Ao9/VN3TKYY8/QX9EPbs22KaCSrQ5rXo5ZZd44tWJ3wl3FlnrFZ+KyUtNH6+1ZPQ==", + "dependencies": { + "bl": "^2.2.1", + "bson": "^1.1.4", + "denque": "^1.4.1", + "optional-require": "^1.0.3", + "safe-buffer": "^5.1.2" + }, + "engines": { + "node": ">=4" + }, + "optionalDependencies": { + "saslprep": "^1.0.0" + }, + "peerDependenciesMeta": { + "aws4": { + "optional": true + }, + "bson-ext": { + "optional": true + }, + "kerberos": { + "optional": true + }, + "mongodb-client-encryption": { + "optional": true + }, + "mongodb-extjson": { + "optional": true + }, + "snappy": { + "optional": true + } + } + }, + "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.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": { + "version": "2.0.14", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.14.tgz", + "integrity": "sha512-frcpDx+PviKEQRSYzwhckuO2zoHcBYLHI754RE9z5h1RGtrngerc04mLpQQCPWBkH/2ObrX7We9YiwVSYZpFJQ==", + "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": "^5.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=", + "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==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/normalize-url": { + "version": "4.5.1", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.1.tgz", + "integrity": "sha512-9UZCFRHQdNrfTpGg8+1INIg93B6zE0aXMVFkw1WFwvO4SlZywU6aLg5Of0Ap/PgcbSw4LNxvMWXMeugwMCX0AA==", + "engines": { + "node": ">=8" + } + }, + "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=", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/one-time": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/one-time/-/one-time-1.0.0.tgz", + "integrity": "sha512-5DXOiRKwuSEcQ/l0kGCF6Q3jcADFv5tSmRaJck/OqkVFcOzutB134KRSfF0xDrL39MNnqxbHBbUUcjZIhTgb2g==", + "dependencies": { + "fn.name": "1.x.x" + } + }, + "node_modules/optional-require": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/optional-require/-/optional-require-1.0.3.tgz", + "integrity": "sha512-RV2Zp2MY2aeYK5G+B/Sps8lW5NHAzE5QClbFP15j+PWmP+T9PxlJXBOOLoSAdgwFvS4t0aMR4vpedMkbHfh0nA==", + "engines": { + "node": ">=4" + } + }, + "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==", + "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==", + "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==", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/parseqs": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/parseqs/-/parseqs-0.0.6.tgz", + "integrity": "sha512-jeAGzMDbfSHHA091hr0r31eYfTig+29g3GKKE/PPbEQ65X0lmMwlEoqmhzu0iztID5uJpZsFlUPDP8ThPL7M8w==" + }, + "node_modules/parseuri": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/parseuri/-/parseuri-0.0.6.tgz", + "integrity": "sha512-AUjen8sAkGgao7UyCX6Ahv0gIK2fABKmYjvP4xmy5JaKvcbTRueIqIPHLAfq30xJddqSE033IOMUSOMCcK3Sow==" + }, + "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/picomatch": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", + "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "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=", + "engines": { + "node": ">=4" + } + }, + "node_modules/prism-media": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/prism-media/-/prism-media-1.3.1.tgz", + "integrity": "sha512-nyYAa3KB4qteJIqdguKmwxTJgy55xxUtkJ3uRnOvO5jO+frci+9zpRXw6QZVcfDeva3S654fU9+26P2OSTzjHw==", + "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/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" + }, + "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==" + }, + "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==", + "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==", + "dependencies": { + "escape-goat": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/qs": { + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", + "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/randombytes": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.0.3.tgz", + "integrity": "sha1-Z0yZdgkBw8QRJ3GjHlIdw0nMCew=" + }, + "node_modules/randomstring": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/randomstring/-/randomstring-1.2.1.tgz", + "integrity": "sha512-eMnfell9XuU3jfCx3f4xCaFAt0YMFPZhx9R3PSStmLarDKg5j5vivqKhf/8pvG+VX/YkxsckHK/VPUrKa5V07A==", + "dependencies": { + "array-uniq": "1.0.2", + "randombytes": "2.0.3" + }, + "bin": { + "randomstring": "bin/randomstring" + }, + "engines": { + "node": "*" + } + }, + "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.0", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz", + "integrity": "sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q==", + "dependencies": { + "bytes": "3.1.0", + "http-errors": "1.7.2", + "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==", + "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/rc/node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" + }, + "node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/readable-stream/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "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==", + "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==", + "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=", + "dependencies": { + "lowercase-keys": "^1.0.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/safe-stable-stringify": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.3.1.tgz", + "integrity": "sha512-kYBSfT+troD9cDA85VDnHZ1rpHC50O0g1e6WlGHVCz/g+JS+9WKLj+XwFYyR8UbrZN8ll9HUpDAAddY58MGisg==", + "engines": { + "node": ">=10" + } + }, + "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/saslprep": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/saslprep/-/saslprep-1.0.3.tgz", + "integrity": "sha512-/MY/PEMbk2SuY5sScONwhUDsV2p77Znkb/q3nSVstq/yQzYJOH/Azh29p9oJLsl3LnQwSvZDKagDGBsBwSooag==", + "optional": true, + "dependencies": { + "sparse-bitfield": "^3.0.3" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "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==", + "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==", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/send": { + "version": "0.17.1", + "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz", + "integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==", + "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.7.2", + "mime": "1.6.0", + "ms": "2.1.1", + "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/send/node_modules/ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" + }, + "node_modules/serve-static": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz", + "integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==", + "dependencies": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.17.1" + }, + "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.1.1", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", + "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==" + }, + "node_modules/signal-exit": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.5.tgz", + "integrity": "sha512-KWcOiKeQj6ZyXx7zq4YxSMgHRlod4czeBQZrPb8OKcohcqAXShm7E20kEMle9WBt26hFcAf0qLOcp5zmY7kOqQ==" + }, + "node_modules/simple-swizzle": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", + "integrity": "sha1-pNprY1/8zMoz9w0Xy5JZLeleVXo=", + "dependencies": { + "is-arrayish": "^0.3.1" + } + }, + "node_modules/socket.io-client": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-4.1.2.tgz", + "integrity": "sha512-RDpWJP4DQT1XeexmeDyDkm0vrFc0+bUsHDKiVGaNISJvJonhQQOMqV9Vwfg0ZpPJ27LCdan7iqTI92FRSOkFWQ==", + "dependencies": { + "@types/component-emitter": "^1.2.10", + "backo2": "~1.0.2", + "component-emitter": "~1.3.0", + "debug": "~4.3.1", + "engine.io-client": "~5.1.1", + "parseuri": "0.0.6", + "socket.io-parser": "~4.0.4" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/socket.io-client/node_modules/debug": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", + "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/socket.io-client/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/socket.io-parser": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.0.4.tgz", + "integrity": "sha512-t+b0SS+IxG7Rxzda2EVvyBZbvFPBCjJoyHuE0P//7OAsN23GItzDRdWa6ALxZI/8R5ygK7jAR6t028/z+7295g==", + "dependencies": { + "@types/component-emitter": "^1.2.10", + "component-emitter": "~1.3.0", + "debug": "~4.3.1" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/socket.io-parser/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/socket.io-parser/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/sparse-bitfield": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/sparse-bitfield/-/sparse-bitfield-3.0.3.tgz", + "integrity": "sha1-/0rm5oZWBWuks+eSqzM004JzyhE=", + "optional": true, + "dependencies": { + "memory-pager": "^1.0.2" + } + }, + "node_modules/stack-trace": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", + "integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA=", + "engines": { + "node": "*" + } + }, + "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.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/string_decoder/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "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=", + "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==", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/text-hex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/text-hex/-/text-hex-1.0.0.tgz", + "integrity": "sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg==" + }, + "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==", + "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==", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/toidentifier": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", + "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==", + "engines": { + "node": ">=0.6" + } + }, + "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==", + "dependencies": { + "nopt": "~1.0.10" + }, + "bin": { + "nodetouch": "bin/nodetouch.js" + } + }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" + }, + "node_modules/triple-beam": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/triple-beam/-/triple-beam-1.3.0.tgz", + "integrity": "sha512-XrHUvV5HpdLmIj4uVMxHggLbFSZYIn7HEWsqePZcI50pco+MPqJ50wMGY794X7AOOhxOBAjbkqfAbEe/QMp2Lw==" + }, + "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.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==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "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==", + "dependencies": { + "is-typedarray": "^1.0.0" + } + }, + "node_modules/undefsafe": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz", + "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==" + }, + "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==", + "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": "5.1.0", + "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-5.1.0.tgz", + "integrity": "sha512-ItnICHbeMh9GqUy31hFPrD1kcuZ3rpxDZbf4KUDavXwS0bW5m7SLbDQpGX3UYr072cbrF5hFUs3r5tUsPwjfHw==", + "dependencies": { + "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.4.0", + "is-npm": "^5.0.0", + "is-yarn-global": "^0.3.0", + "latest-version": "^5.1.0", + "pupa": "^2.1.1", + "semver": "^7.3.4", + "semver-diff": "^3.1.1", + "xdg-basedir": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/yeoman/update-notifier?sponsor=1" + } + }, + "node_modules/update-notifier/node_modules/semver": { + "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" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "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=", + "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/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/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", + "integrity": "sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg==", + "dependencies": { + "string-width": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/winston": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/winston/-/winston-3.6.0.tgz", + "integrity": "sha512-9j8T75p+bcN6D00sF/zjFVmPp+t8KMPB1MzbbzYjeN9VWxdsYnTB40TkbNUEXAmILEfChMvAMgidlX64OG3p6w==", + "dependencies": { + "@dabh/diagnostics": "^2.0.2", + "async": "^3.2.3", + "is-stream": "^2.0.0", + "logform": "^2.4.0", + "one-time": "^1.0.0", + "readable-stream": "^3.4.0", + "safe-stable-stringify": "^2.3.1", + "stack-trace": "0.0.x", + "triple-beam": "^1.3.0", + "winston-transport": "^4.5.0" + }, + "engines": { + "node": ">= 12.0.0" + } + }, + "node_modules/winston-transport": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/winston-transport/-/winston-transport-4.5.0.tgz", + "integrity": "sha512-YpZzcUzBedhlTAfJg6vJDlyEai/IFMIVcaEZZyl3UXIl4gmqRpU7AE89AHLkbzLUsv0NVmw7ts+iztqKxxPW1Q==", + "dependencies": { + "logform": "^2.3.2", + "readable-stream": "^3.6.0", + "triple-beam": "^1.3.0" + }, + "engines": { + "node": ">= 6.4.0" + } + }, + "node_modules/winston-transport/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/winston/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/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==", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + }, + "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==", + "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.5.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.1.tgz", + "integrity": "sha512-2c6faOUH/nhoQN6abwMloF7Iyl0ZS2E9HGtsiLrWn0zOOMWlhtDmdf/uihDt6jnuCxgtwGBNy6Onsoy2s2O2Ow==", + "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==", + "engines": { + "node": ">=8" + } + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + }, + "node_modules/yeast": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/yeast/-/yeast-0.1.2.tgz", + "integrity": "sha1-AI4G2AlDIMNy28L47XagymyKxBk=" + } + }, "dependencies": { + "@colors/colors": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", + "integrity": "sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==" + }, + "@dabh/diagnostics": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@dabh/diagnostics/-/diagnostics-2.0.3.tgz", + "integrity": "sha512-hrlQOIi7hAfzsMqlGSFyVucrx38O+j6wiGOf//H2ecvIEqYN4ADBSS2iLMh5UFyDunCNniUIPk/q3riFv45xRA==", + "requires": { + "colorspace": "1.1.x", + "enabled": "2.0.x", + "kuler": "^2.0.0" + } + }, "@discordjs/collection": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.1.6.tgz", @@ -99,6 +2583,11 @@ "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.2.tgz", "integrity": "sha1-X8w3OSB3VyPP1k1lxkvvU7+eum0=" }, + "async": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.3.tgz", + "integrity": "sha512-spZRyzKL5l5BZQrr/6m/SqFdBN0q3OCI0f9rjfBzCMBIP4p75P620rR3gTmaksNOhmzgdxcaxdNfMy6anrbM0g==" + }, "asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", @@ -298,6 +2787,30 @@ "mimic-response": "^1.0.0" } }, + "color": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/color/-/color-3.2.1.tgz", + "integrity": "sha512-aBl7dZI9ENN6fUGC7mWpMTPNHmWUSNan9tuWN6ahh5ZLNk9baLJOnSMlrQkHcrfFgz2/RigjUVAjdx36VcemKA==", + "requires": { + "color-convert": "^1.9.3", + "color-string": "^1.6.0" + }, + "dependencies": { + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + } + } + }, "color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -311,6 +2824,29 @@ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, + "color-string": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.0.tgz", + "integrity": "sha512-9Mrz2AQLefkH1UvASKj6v6hj/7eWgjnT/cVsR8CumieLoT+g900exWeNogqtweI8dxloXN9BDQTYro1oWu/5CQ==", + "requires": { + "color-name": "^1.0.0", + "simple-swizzle": "^0.2.2" + } + }, + "colors": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", + "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==" + }, + "colorspace": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/colorspace/-/colorspace-1.1.4.tgz", + "integrity": "sha512-BgvKJiuVu1igBUF2kEjRCZXol6wiiGbY5ipL/oVPwm0BL9sIpMIzM8IK7vwuxIIzOXMV3Ey5w+vxhm0rR/TN8w==", + "requires": { + "color": "^3.1.3", + "text-hex": "1.0.x" + } + }, "combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -461,6 +2997,11 @@ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" }, + "enabled": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/enabled/-/enabled-2.0.0.tgz", + "integrity": "sha512-AKrN98kuwOzMIdAizXGI86UFBoo26CL21UM763y1h/GMSJ4/OHU9k2YlsmBpyScFo/wbLzWQJBMCW4+IO3/+OQ==" + }, "encodeurl": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", @@ -506,7 +3047,8 @@ "ws": { "version": "7.4.6", "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.6.tgz", - "integrity": "sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==" + "integrity": "sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==", + "requires": {} } } }, @@ -600,6 +3142,11 @@ } } }, + "fecha": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/fecha/-/fecha-4.2.1.tgz", + "integrity": "sha512-MMMQ0ludy/nBs1/o0zVOiKTpG7qMbonKUzjJgQFEuvq6INZ1OraKPRAWkBq5vlKLOUMpmNYG1JoN3oDPUQ9m3Q==" + }, "fill-range": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", @@ -637,6 +3184,11 @@ } } }, + "fn.name": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fn.name/-/fn.name-1.1.0.tgz", + "integrity": "sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw==" + }, "forwarded": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", @@ -777,6 +3329,11 @@ "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==" }, + "is-arrayish": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", + "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==" + }, "is-binary-path": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", @@ -840,6 +3397,11 @@ "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==" }, + "is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==" + }, "is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", @@ -868,6 +3430,11 @@ "json-buffer": "3.0.0" } }, + "kuler": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/kuler/-/kuler-2.0.0.tgz", + "integrity": "sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A==" + }, "latest-version": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-5.1.0.tgz", @@ -876,6 +3443,18 @@ "package-json": "^6.3.0" } }, + "logform": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/logform/-/logform-2.4.0.tgz", + "integrity": "sha512-CPSJw4ftjf517EhXZGGvTHHkYobo7ZCc0kvwUoOYcjfR2UVrI66RHj8MCrfAdEitdmFqbu2BYdYs8FHHZSb6iw==", + "requires": { + "@colors/colors": "1.5.0", + "fecha": "^4.2.0", + "ms": "^2.1.1", + "safe-stable-stringify": "^2.3.1", + "triple-beam": "^1.3.0" + } + }, "lowercase-keys": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", @@ -961,6 +3540,11 @@ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" }, + "moment-duration-format": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/moment-duration-format/-/moment-duration-format-2.3.2.tgz", + "integrity": "sha512-cBMXjSW+fjOb4tyaVHuaVE/A5TqkukDWiOfxxAjY+PEqmmBQlLwn+8OzwPiG3brouXKY5Un4pBjAeB6UToXHaQ==" + }, "mongodb": { "version": "3.6.8", "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-3.6.8.tgz", @@ -1043,6 +3627,14 @@ "wrappy": "1" } }, + "one-time": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/one-time/-/one-time-1.0.0.tgz", + "integrity": "sha512-5DXOiRKwuSEcQ/l0kGCF6Q3jcADFv5tSmRaJck/OqkVFcOzutB134KRSfF0xDrL39MNnqxbHBbUUcjZIhTgb2g==", + "requires": { + "fn.name": "1.x.x" + } + }, "optional-require": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/optional-require/-/optional-require-1.0.3.tgz", @@ -1104,7 +3696,8 @@ "prism-media": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/prism-media/-/prism-media-1.3.1.tgz", - "integrity": "sha512-nyYAa3KB4qteJIqdguKmwxTJgy55xxUtkJ3uRnOvO5jO+frci+9zpRXw6QZVcfDeva3S654fU9+26P2OSTzjHw==" + "integrity": "sha512-nyYAa3KB4qteJIqdguKmwxTJgy55xxUtkJ3uRnOvO5jO+frci+9zpRXw6QZVcfDeva3S654fU9+26P2OSTzjHw==", + "requires": {} }, "process-nextick-args": { "version": "2.0.1", @@ -1253,6 +3846,11 @@ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" }, + "safe-stable-stringify": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.3.1.tgz", + "integrity": "sha512-kYBSfT+troD9cDA85VDnHZ1rpHC50O0g1e6WlGHVCz/g+JS+9WKLj+XwFYyR8UbrZN8ll9HUpDAAddY58MGisg==" + }, "safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", @@ -1355,6 +3953,14 @@ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.5.tgz", "integrity": "sha512-KWcOiKeQj6ZyXx7zq4YxSMgHRlod4czeBQZrPb8OKcohcqAXShm7E20kEMle9WBt26hFcAf0qLOcp5zmY7kOqQ==" }, + "simple-swizzle": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", + "integrity": "sha1-pNprY1/8zMoz9w0Xy5JZLeleVXo=", + "requires": { + "is-arrayish": "^0.3.1" + } + }, "socket.io-client": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-4.1.2.tgz", @@ -1418,21 +4024,16 @@ "memory-pager": "^1.0.2" } }, + "stack-trace": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", + "integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA=" + }, "statuses": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=" }, - "string-width": { - "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.1" - } - }, "string_decoder": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", @@ -1448,6 +4049,16 @@ } } }, + "string-width": { + "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.1" + } + }, "strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", @@ -1469,6 +4080,11 @@ "has-flag": "^3.0.0" } }, + "text-hex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/text-hex/-/text-hex-1.0.0.tgz", + "integrity": "sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg==" + }, "to-readable-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/to-readable-stream/-/to-readable-stream-1.0.0.tgz", @@ -1500,6 +4116,11 @@ "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" }, + "triple-beam": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/triple-beam/-/triple-beam-1.3.0.tgz", + "integrity": "sha512-XrHUvV5HpdLmIj4uVMxHggLbFSZYIn7HEWsqePZcI50pco+MPqJ50wMGY794X7AOOhxOBAjbkqfAbEe/QMp2Lw==" + }, "tweetnacl": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", @@ -1621,6 +4242,57 @@ "string-width": "^4.0.0" } }, + "winston": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/winston/-/winston-3.6.0.tgz", + "integrity": "sha512-9j8T75p+bcN6D00sF/zjFVmPp+t8KMPB1MzbbzYjeN9VWxdsYnTB40TkbNUEXAmILEfChMvAMgidlX64OG3p6w==", + "requires": { + "@dabh/diagnostics": "^2.0.2", + "async": "^3.2.3", + "is-stream": "^2.0.0", + "logform": "^2.4.0", + "one-time": "^1.0.0", + "readable-stream": "^3.4.0", + "safe-stable-stringify": "^2.3.1", + "stack-trace": "0.0.x", + "triple-beam": "^1.3.0", + "winston-transport": "^4.5.0" + }, + "dependencies": { + "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" + } + } + } + }, + "winston-transport": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/winston-transport/-/winston-transport-4.5.0.tgz", + "integrity": "sha512-YpZzcUzBedhlTAfJg6vJDlyEai/IFMIVcaEZZyl3UXIl4gmqRpU7AE89AHLkbzLUsv0NVmw7ts+iztqKxxPW1Q==", + "requires": { + "logform": "^2.3.2", + "readable-stream": "^3.6.0", + "triple-beam": "^1.3.0" + }, + "dependencies": { + "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" + } + } + } + }, "wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", @@ -1650,7 +4322,8 @@ "ws": { "version": "7.5.1", "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.1.tgz", - "integrity": "sha512-2c6faOUH/nhoQN6abwMloF7Iyl0ZS2E9HGtsiLrWn0zOOMWlhtDmdf/uihDt6jnuCxgtwGBNy6Onsoy2s2O2Ow==" + "integrity": "sha512-2c6faOUH/nhoQN6abwMloF7Iyl0ZS2E9HGtsiLrWn0zOOMWlhtDmdf/uihDt6jnuCxgtwGBNy6Onsoy2s2O2Ow==", + "requires": {} }, "xdg-basedir": { "version": "4.0.0", diff --git a/package.json b/package.json index df839da..ad2f4af 100644 --- a/package.json +++ b/package.json @@ -11,11 +11,14 @@ "author": "Braeden Sowinski", "license": "ISC", "dependencies": { + "colors": "^1.4.0", "discord.js": "^12.5.3", "express": "^4.17.1", + "moment-duration-format": "^2.3.2", "mongodb": "^3.6.8", "nodemon": "^2.0.14", "randomstring": "^1.2.1", - "socket.io-client": "^4.1.2" + "socket.io-client": "^4.1.2", + "winston": "^3.6.0" } } diff --git a/util/Logger.js b/util/Logger.js new file mode 100644 index 0000000..68c24b4 --- /dev/null +++ b/util/Logger.js @@ -0,0 +1,28 @@ +const winston = require("winston"); +const colors = require("colors"); + +class Logger { + constructor(LoggingFile) { + this.logger = winston.createLogger({ + transports: [new winston.transports.File({ filename: LoggingFile })], + }); + } + + log(Text) { + let d = new Date(); + this.logger.log({ + level: "info", + message: + `${d.getHours()}:${ + d.getMinutes + } - ${d.getDate()}:${d.getMonth()}:${d.getFullYear()} | Info: ` + Text, + }); + console.log( + colors.green( + `${d.getDate()}:${d.getMonth()}:${d.getFullYear()} - ${d.getHours()}:${d.getMinutes()}` + ) + colors.yellow(" | Info: " + Text) + ); + } +} + +module.exports = Logger; \ No newline at end of file diff --git a/util/RegisterSlashCommands.js b/util/RegisterSlashCommands.js new file mode 100644 index 0000000..a17c707 --- /dev/null +++ b/util/RegisterSlashCommands.js @@ -0,0 +1,35 @@ +const fs = require("fs"); +const path = require("path"); + +/** + * Register slash commands for a guild + * @param {require("../LPS")} client + * @param {string} guild + */ +module.exports = (client, guild) => { + + let commandsDir = path.join(__dirname, "..", "commands");; + + fs.readdir(commandsDir, (err, files) => { + if (err) throw err; + files.forEach(async (file) => { + let cmd = require(commandsDir + "/" + file); + if (!cmd.SlashCommand || !cmd.SlashCommand.run) return; + let dataStuff = { + name: cmd.name, + description: cmd.description, + options: cmd.SlashCommand.options, + }; + + //Creating variables like this, So you might understand my code :) + let ClientAPI = client.api.applications(client.user.id); + let GuildAPI = ClientAPI.guilds(guild); + + try { + await GuildAPI.commands.post({ data: dataStuff }); + } catch (e) { + console.log(e); + } + }); + }); +}; \ No newline at end of file