update/update license

This commit is contained in:
SowinskiBraeden committed 2022-03-16 17:58:54 -07:00
1 parent 441bb0672c
commit 495c4755ae
12 files changed
+532 -143

No files matched your search

+1 -1
View File
@@ -52,7 +52,7 @@ module.exports = {
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);
message.channel.send({ embeds: [firearmResult] });
}
}
socket.disconnect();
+4 -3
View File
@@ -22,7 +22,6 @@ module.exports = {
cmd.name
}${cmd.usage ? " " + cmd.usage : ""}\` - ${cmd.description}` : null
);
let Embed = new MessageEmbed()
.setAuthor(
`Commands of ${client.user.username}`,
@@ -36,7 +35,9 @@ module.exports = {
).setDescription(`${Commands.join("\n")}
Lines Police CAD Bot Version: v${client.config.Version}`);
if (!args[0]) message.channel.send(Embed);
if (!args[0]) {
message.channel.send({ embeds: [Embed] });
}
else {
let cmd =
client.commands.get(args[0]) ||
@@ -74,7 +75,7 @@ module.exports = {
}`
);
message.channel.send(embed);
message.channel.send({ embeds: [embed] });
}
},
+2 -3
View File
@@ -26,12 +26,11 @@ module.exports = {
let user = await client.dbo.collection("users").findOne({"user.discord.id":message.author.id}).then(user => user);
if (!user) return message.channel.send(`You are not logged in.`);
let data;
if (args.length==0) return message.channel.send(`You must provide a \`First Name\`, \`Last Name\` and \`DOB\`(yyyy-mm-dd).`);
if (args.length==1) return message.channel.send(`You're missing a \`Last Name\` and \`DOB\`(yyyy-mm-dd).`);
if (args.length==2) return message.channel.send(`You're missing a \`DOB\`(yyyy-mm-dd).`);
data = {
let data = {
user: user,
query: {
firstName: args[0],
@@ -104,7 +103,7 @@ module.exports = {
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);
message.channel.send({ embeds: [nameResult] });
}
}
socket.disconnect();
+1 -1
View File
@@ -61,7 +61,7 @@ module.exports = {
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);
message.channel.send({ embeds: [plateResult] });
}
}
socket.disconnect();
+3 -3
View File
@@ -21,11 +21,11 @@ module.exports = {
const stats = new MessageEmbed()
.setColor('#0099ff')
.setTitle("Current LPC-Bot Statistics")
.setURL('https://discord.gg/w2g2FFmHbF')
.setURL(client.config.SupportServer)
.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)
return message.channel.send({ embeds: [stats] });
},
SlashCommand: {
/**
@@ -43,7 +43,7 @@ module.exports = {
const stats = new MessageEmbed()
.setColor('#0099ff')
.setTitle("Current LPC-Bot Statistics")
.setURL('https://discord.gg/w2g2FFmHbF')
.setURL(client.config.SupportServer)
.addField(" \u200B ", "**Channels** : ` " + `${client.channels.cache.size}` + " `")
.addField(" \u200B ", "**Servers** : ` " + `${client.guilds.cache.size}` + " `")
.addField(" \u200B ", "**Users** : ` " + `${client.users.cache.size}` + " `")
+237
View File
@@ -0,0 +1,237 @@
const { MessageEmbed, MessageActionRow, MessageButton } = require('discord.js');
const io = require('socket.io-client');
module.exports = {
name: "updatelicense",
description: "Update Drivers License Status",
usage: "[firstName] [lastName] [DOB]",
permissions: {
channel: ["VIEW_CHANNEL", "SEND_MESSAGES", "EMBED_LINKS"],
member: [],
},
aliases: [],
/**
*
* @param {require("../structures/LinesPoliceCadBot")} client
* @param {import("discord.js").Message} message
* @param {string[]} args
* @param {*} param3
*/
run: async (client, message, args) => {
let user = await client.dbo.collection("users").findOne({"user.discord.id":message.author.id}).then(user => user);
if (!user) return message.channel.send(`You are not logged in.`);
if (args.length==0) return message.channel.send(`You must provide a \`First Name\`, \`Last Name\`, \`DOB\`(yyyy-mm-dd).`);
if (args.length==1) return message.channel.send(`You're missing a \`Last Name\` and \`DOB\`(yyyy-mm-dd).`);
if (args.length==2) return message.channel.send(`You're missing a \`DOB\`(yyyy-mm-dd).`);
let data = {
user: user,
query: {
firstName: args[0],
lastName: args[1],
dateOfBirth: args[2],
activeCommunityID: user.user.activeCommunity
}
}
const socket = io.connect(client.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.`);
}
}
let nameResult;
let row;
for (let i = 0; i < results.civilians.length; i++) {
// Get Drivers Licence Status
let licenseStatus;
if (results.civilians[i].civilian.licenseStatus == 1) licenseStatus = 'Valid';
if (results.civilians[i].civilian.licenseStatus == 2) licenseStatus = 'Revoked';
if (results.civilians[i].civilian.licenseStatus == 3) licenseStatus = 'None';
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', client.config.IconURL, '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: `\`${licenseStatus}\``, inline: true },
{ name: `**Gender**`, value: `\`${results.civilians[i].civilian.gender}\``, inline: true }
)
row = new MessageActionRow()
.addComponents(
new MessageButton()
.setCustomId(`license-revoke-${results.civilians[i]._id}`)
.setLabel("Revoke")
.setStyle("DANGER"),
new MessageButton()
.setCustomId(`license-reinstate-${results.civilians[i]._id}`)
.setLabel("Reinstate")
.setStyle("SUCCESS")
)
}
message.channel.send({ embeds: [nameResult], components: [row] });
const filter = i => {
return i.user.id == message.author.id;
}
const collector = message.channel.createMessageComponentCollector({
filter,
max: 1,
time: 20000
});
collector.on('collect', async ButtonInteraction => {
const socket = io.connect(client.config.socket);
let queryString = ButtonInteraction.customId;
let query = {
_id: "",
status: null,
bot_request: true
};
if (queryString.substr(8, 6)=='revoke') {
query.status = 2;
query._id = queryString.substr(15, 24);
} else if (queryString.substr(8, 9)=='reinstate') {
query.status = 1;
query._id = queryString.substr(18, 24);
}
socket.emit("update_drivers_license_status", query);
socket.on("bot_updated_drivers_license_status", (res) => {
if (!res.success) ButtonInteraction.update({ content: 'Failed to update license.', embeds: [], components: [] });
socket.disconnect();
});
return ButtonInteraction.update({ content: 'Successfully updated license.', embeds: [], components: [] });
});
});
},
SlashCommand: {
options: [
{
name: "firstname",
description: "Civilian's First Name",
value: "firstname",
type: 3,
required: true,
},
{
name: "lastname",
description: "Civilian's Last Name",
value: "lastname",
type: 3,
required: true,
},
{
name: "dob",
description: "Civilian's DOB (yyyy-mm-dd)",
value: "dob",
type: 3,
required: true,
},
],
/**
*
* @param {require("../structures/LinesPoliceCadBot")} client
* @param {import("discord.js").Message} message
* @param {string[]} args
* @param {*} param3
*/
run: async (client, interaction, args, { GuildDB }) => {
if (GuildDB.customChannelStatus==true&&!GuildDB.allowedChannels.includes(interaction.channel_id)) {
return interaction.send(`You are not allowed to use the bot in this channel.`);
}
let user = await client.dbo.collection("users").findOne({"user.discord.id":interaction.member.user.id}).then(user => user);
if (!user) return interaction.send(`You are not logged in.`);
let data = {
user: user,
query: {
firstName: args[0].value,
lastName: args[1].value,
dateOfBirth: args[2].value,
activeCommunityID: user.user.activeCommunity
}
}
const socket = io.connect(client.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 interaction.send(`Name \`${args[0].value} ${args[1].value}\` not found.`);
}
}
let nameResult;
let row;
for (let i = 0; i < results.civilians.length; i++) {
// Get Drivers Licence Status
let licenseStatus;
if (results.civilians[i].civilian.licenseStatus == 1) licenseStatus = 'Valid';
if (results.civilians[i].civilian.licenseStatus == 2) licenseStatus = 'Revoked';
if (results.civilians[i].civilian.licenseStatus == 3) licenseStatus = 'None';
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', client.config.IconURL, '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: `\`${licenseStatus}\``, inline: true },
{ name: `**Gender**`, value: `\`${results.civilians[i].civilian.gender}\``, inline: true }
)
row = new MessageActionRow()
.addComponents(
new MessageButton()
.setCustomId(`license-revoke-${results.civilians[i]._id}`)
.setLabel("Revoke")
.setStyle("DANGER"),
new MessageButton()
.setCustomId(`license-reinstate-${results.civilians[i]._id}`)
.setLabel("Reinstate")
.setStyle("SUCCESS")
)
}
interaction.send({ embeds: [nameResult], components: [row] });
client.on("interactionCreate", ButtonInteraction => {
const socket = io.connect(client.config.socket);
let queryString = ButtonInteraction.customId;
let query = {
_id: "",
status: null,
bot_request: true
};
if (queryString.substr(8, 6)=='revoke') {
query.status = 2;
query._id = queryString.substr(15, 24);
} else if (queryString.substr(8, 9)=='reinstate') {
query.status = 1;
query._id = queryString.substr(18, 24);
}
socket.emit("update_drivers_license_status", query);
socket.on("bot_updated_drivers_license_status", (res) => {
if (!res.success) ButtonInteraction.update({ content: 'Failed to update license.', embeds: [], components: [] });
socket.disconnect();
});
return ButtonInteraction.update({ content: 'Successfully updated license.', embeds: [], components: [] });
});
});
},
},
}
+1 -1
View File
@@ -4,7 +4,7 @@ module.exports = {
Admins: ["362791661274660874"], // Admins of the bot
defaultPrefix: "?",
socket: "https://police-cad-dev.herokuapp.com/",
SupportServer: "https://discord.gg/w2g2FFmHbF", //Support Server Link
SupportServer: client.config.SupportServer, //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",
+1 -1
View File
@@ -4,7 +4,7 @@ module.exports = {
Admins: ["362791661274660874"], // Admins of the bot
defaultPrefix: "?",
socket: "https://www.linespolice-cad.com/",
SupportServer: "https://discord.gg/w2g2FFmHbF", //Support Server Link
SupportServer: client.config.SupportServer, //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",
@@ -1,7 +1,7 @@
/**
*
* @param {require("../structures/LinesPoliceCadBot")} client
* @param {require("discord.js").Message} message
* @param {require("discord.js").message} message
* @returns {void} or nothing if you didn't know
*/
@@ -45,13 +45,7 @@ module.exports = async (client, message) => {
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))
.has(cmd.permissions.member))
)
return client.sendError(
message.channel,
+273 -108
View File
@@ -10,7 +10,7 @@
"license": "ISC",
"dependencies": {
"colors": "^1.4.0",
"discord.js": "^12.5.3",
"discord.js": "^13.1.0",
"express": "^4.17.1",
"moment-duration-format": "^2.3.2",
"mongodb": "^3.6.8",
@@ -38,10 +38,41 @@
"kuler": "^2.0.0"
}
},
"node_modules/@discordjs/builders": {
"version": "0.5.0",
"resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-0.5.0.tgz",
"integrity": "sha512-HP5y4Rqw68o61Qv4qM5tVmDbWi4mdTFftqIOGRo33SNPpLJ1Ga3KEIR2ibKofkmsoQhEpLmopD1AZDs3cKpHuw==",
"dependencies": {
"@sindresorhus/is": "^4.0.1",
"discord-api-types": "^0.22.0",
"ow": "^0.27.0",
"ts-mixer": "^6.0.0",
"tslib": "^2.3.0"
},
"engines": {
"node": ">=14.0.0",
"npm": ">=7.0.0"
}
},
"node_modules/@discordjs/builders/node_modules/@sindresorhus/is": {
"version": "4.6.0",
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz",
"integrity": "sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==",
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/sindresorhus/is?sponsor=1"
}
},
"node_modules/@discordjs/collection": {
"version": "0.1.6",
"resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.1.6.tgz",
"integrity": "sha512-utRNxnd9kSS2qhyivo9lMlt5qgAUasH2gb7BEOn6p0efFh24gjGomHzWKMAPn2hEReOPQZCJaRKoURwRotKucQ=="
"version": "0.2.4",
"resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.2.4.tgz",
"integrity": "sha512-PVrEJH+V6Ob0OwfagYQ/57kwt/HNEJxt5jqY4P+S3st9y29t9iokdnGMQoJXG5VEMAQIPbzu9Snw1F6yE8PdLA==",
"engines": {
"node": ">=16.0.0",
"npm": ">=7.0.0"
}
},
"node_modules/@discordjs/form-data": {
"version": "3.0.1",
@@ -56,6 +87,15 @@
"node": ">= 6"
}
},
"node_modules/@sapphire/async-queue": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.3.0.tgz",
"integrity": "sha512-z+CDw5X4UgIEpZL8KM+ThVx1i8V60HBg0l/oFewTNbQQeRDJHdVxHyJykv+SF1H+Rc8EkMS81VTWo95jVYgO/g==",
"engines": {
"node": ">=v14.0.0",
"npm": ">=7.0.0"
}
},
"node_modules/@sindresorhus/is": {
"version": "0.14.0",
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz",
@@ -80,22 +120,24 @@
"resolved": "https://registry.npmjs.org/@types/component-emitter/-/component-emitter-1.2.10.tgz",
"integrity": "sha512-bsjleuRKWmGqajMerkzox19aGbscQX5rmmvvXl3wlIp5gMG1HgkiwPxsN5p070fBDKTNSPgojVbuY1+HWMbFhg=="
},
"node_modules/@types/node": {
"version": "17.0.21",
"resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.21.tgz",
"integrity": "sha512-DBZCJbhII3r90XbQxI8Y9IjjiiOGlZ0Hr32omXIZvwwZ7p4DMMXGrKXVyPfuoBOri9XNtL0UK69jYIBIsRX3QQ=="
},
"node_modules/@types/ws": {
"version": "7.4.7",
"resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.4.7.tgz",
"integrity": "sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==",
"dependencies": {
"@types/node": "*"
}
},
"node_modules/abbrev": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
"integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q=="
},
"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",
@@ -337,6 +379,14 @@
"node": ">=8"
}
},
"node_modules/callsites": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
"integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==",
"engines": {
"node": ">=6"
}
},
"node_modules/camelcase": {
"version": "6.2.0",
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.2.0.tgz",
@@ -630,23 +680,32 @@
"resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz",
"integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA="
},
"node_modules/discord-api-types": {
"version": "0.22.0",
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.22.0.tgz",
"integrity": "sha512-l8yD/2zRbZItUQpy7ZxBJwaLX/Bs2TGaCthRppk8Sw24LOIWg12t9JEreezPoYD0SQcC2htNNo27kYEpYW/Srg==",
"deprecated": "No longer supported. Install the latest release!",
"engines": {
"node": ">=12"
}
},
"node_modules/discord.js": {
"version": "12.5.3",
"resolved": "https://registry.npmjs.org/discord.js/-/discord.js-12.5.3.tgz",
"integrity": "sha512-D3nkOa/pCkNyn6jLZnAiJApw2N9XrIsXUAdThf01i7yrEuqUmDGc7/CexVWwEcgbQR97XQ+mcnqJpmJ/92B4Aw==",
"deprecated": "no longer supported",
"version": "13.1.0",
"resolved": "https://registry.npmjs.org/discord.js/-/discord.js-13.1.0.tgz",
"integrity": "sha512-gxO4CXKdHpqA+WKG+f5RNnd3srTDj5uFJHgOathksDE90YNq/Qijkd2WlMgTTMS6AJoEnHxI7G9eDQHCuZ+xDA==",
"dependencies": {
"@discordjs/collection": "^0.1.6",
"@discordjs/builders": "^0.5.0",
"@discordjs/collection": "^0.2.1",
"@discordjs/form-data": "^3.0.1",
"abort-controller": "^3.0.0",
"@sapphire/async-queue": "^1.1.4",
"@types/ws": "^7.4.7",
"discord-api-types": "^0.22.0",
"node-fetch": "^2.6.1",
"prism-media": "^1.2.9",
"setimmediate": "^1.0.5",
"tweetnacl": "^1.0.3",
"ws": "^7.4.4"
"ws": "^7.5.1"
},
"engines": {
"node": ">=12.0.0"
"node": ">=16.6.0",
"npm": ">=7.0.0"
}
},
"node_modules/dot-prop": {
@@ -785,14 +844,6 @@
"node": ">= 0.6"
}
},
"node_modules/event-target-shim": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz",
"integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==",
"engines": {
"node": ">=6"
}
},
"node_modules/express": {
"version": "4.17.1",
"resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz",
@@ -1259,6 +1310,11 @@
"node": ">=8"
}
},
"node_modules/lodash.isequal": {
"version": "4.5.0",
"resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz",
"integrity": "sha1-QVxEePK8wwEgwizhDtMib30+GOA="
},
"node_modules/logform": {
"version": "2.4.0",
"resolved": "https://registry.npmjs.org/logform/-/logform-2.4.0.tgz",
@@ -1561,6 +1617,61 @@
"node": ">=4"
}
},
"node_modules/ow": {
"version": "0.27.0",
"resolved": "https://registry.npmjs.org/ow/-/ow-0.27.0.tgz",
"integrity": "sha512-SGnrGUbhn4VaUGdU0EJLMwZWSupPmF46hnTRII7aCLCrqixTAC5eKo8kI4/XXf1eaaI8YEVT+3FeGNJI9himAQ==",
"dependencies": {
"@sindresorhus/is": "^4.0.1",
"callsites": "^3.1.0",
"dot-prop": "^6.0.1",
"lodash.isequal": "^4.5.0",
"type-fest": "^1.2.1",
"vali-date": "^1.0.0"
},
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/ow/node_modules/@sindresorhus/is": {
"version": "4.6.0",
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz",
"integrity": "sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==",
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/sindresorhus/is?sponsor=1"
}
},
"node_modules/ow/node_modules/dot-prop": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-6.0.1.tgz",
"integrity": "sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA==",
"dependencies": {
"is-obj": "^2.0.0"
},
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/ow/node_modules/type-fest": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz",
"integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==",
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/p-cancelable": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz",
@@ -1633,31 +1744,6 @@
"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",
@@ -1955,11 +2041,6 @@
"node": ">= 0.8.0"
}
},
"node_modules/setimmediate": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz",
"integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU="
},
"node_modules/setprototypeof": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz",
@@ -2184,10 +2265,15 @@
"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/ts-mixer": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/ts-mixer/-/ts-mixer-6.0.0.tgz",
"integrity": "sha512-nXIb1fvdY5CBSrDIblLn73NW0qRDk5yJ0Sk1qPBF560OdJfQp9jhl+0tzcY09OZ9U+6GpeoI9RjwoIKFIoB9MQ=="
},
"node_modules/tslib": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz",
"integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw=="
},
"node_modules/type-fest": {
"version": "0.20.2",
@@ -2309,6 +2395,14 @@
"node": ">= 0.4.0"
}
},
"node_modules/vali-date": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/vali-date/-/vali-date-1.0.0.tgz",
"integrity": "sha1-G5BKWWCfsyjvB4E4Qgk09rhnCaY=",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/vary": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
@@ -2488,10 +2582,29 @@
"kuler": "^2.0.0"
}
},
"@discordjs/builders": {
"version": "0.5.0",
"resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-0.5.0.tgz",
"integrity": "sha512-HP5y4Rqw68o61Qv4qM5tVmDbWi4mdTFftqIOGRo33SNPpLJ1Ga3KEIR2ibKofkmsoQhEpLmopD1AZDs3cKpHuw==",
"requires": {
"@sindresorhus/is": "^4.0.1",
"discord-api-types": "^0.22.0",
"ow": "^0.27.0",
"ts-mixer": "^6.0.0",
"tslib": "^2.3.0"
},
"dependencies": {
"@sindresorhus/is": {
"version": "4.6.0",
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz",
"integrity": "sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw=="
}
}
},
"@discordjs/collection": {
"version": "0.1.6",
"resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.1.6.tgz",
"integrity": "sha512-utRNxnd9kSS2qhyivo9lMlt5qgAUasH2gb7BEOn6p0efFh24gjGomHzWKMAPn2hEReOPQZCJaRKoURwRotKucQ=="
"version": "0.2.4",
"resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.2.4.tgz",
"integrity": "sha512-PVrEJH+V6Ob0OwfagYQ/57kwt/HNEJxt5jqY4P+S3st9y29t9iokdnGMQoJXG5VEMAQIPbzu9Snw1F6yE8PdLA=="
},
"@discordjs/form-data": {
"version": "3.0.1",
@@ -2503,6 +2616,11 @@
"mime-types": "^2.1.12"
}
},
"@sapphire/async-queue": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.3.0.tgz",
"integrity": "sha512-z+CDw5X4UgIEpZL8KM+ThVx1i8V60HBg0l/oFewTNbQQeRDJHdVxHyJykv+SF1H+Rc8EkMS81VTWo95jVYgO/g=="
},
"@sindresorhus/is": {
"version": "0.14.0",
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz",
@@ -2521,19 +2639,24 @@
"resolved": "https://registry.npmjs.org/@types/component-emitter/-/component-emitter-1.2.10.tgz",
"integrity": "sha512-bsjleuRKWmGqajMerkzox19aGbscQX5rmmvvXl3wlIp5gMG1HgkiwPxsN5p070fBDKTNSPgojVbuY1+HWMbFhg=="
},
"@types/node": {
"version": "17.0.21",
"resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.21.tgz",
"integrity": "sha512-DBZCJbhII3r90XbQxI8Y9IjjiiOGlZ0Hr32omXIZvwwZ7p4DMMXGrKXVyPfuoBOri9XNtL0UK69jYIBIsRX3QQ=="
},
"@types/ws": {
"version": "7.4.7",
"resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.4.7.tgz",
"integrity": "sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==",
"requires": {
"@types/node": "*"
}
},
"abbrev": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
"integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q=="
},
"abort-controller": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz",
"integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==",
"requires": {
"event-target-shim": "^5.0.0"
}
},
"accepts": {
"version": "1.3.7",
"resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz",
@@ -2725,6 +2848,11 @@
}
}
},
"callsites": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
"integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ=="
},
"camelcase": {
"version": "6.2.0",
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.2.0.tgz",
@@ -2959,19 +3087,24 @@
"resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz",
"integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA="
},
"discord-api-types": {
"version": "0.22.0",
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.22.0.tgz",
"integrity": "sha512-l8yD/2zRbZItUQpy7ZxBJwaLX/Bs2TGaCthRppk8Sw24LOIWg12t9JEreezPoYD0SQcC2htNNo27kYEpYW/Srg=="
},
"discord.js": {
"version": "12.5.3",
"resolved": "https://registry.npmjs.org/discord.js/-/discord.js-12.5.3.tgz",
"integrity": "sha512-D3nkOa/pCkNyn6jLZnAiJApw2N9XrIsXUAdThf01i7yrEuqUmDGc7/CexVWwEcgbQR97XQ+mcnqJpmJ/92B4Aw==",
"version": "13.1.0",
"resolved": "https://registry.npmjs.org/discord.js/-/discord.js-13.1.0.tgz",
"integrity": "sha512-gxO4CXKdHpqA+WKG+f5RNnd3srTDj5uFJHgOathksDE90YNq/Qijkd2WlMgTTMS6AJoEnHxI7G9eDQHCuZ+xDA==",
"requires": {
"@discordjs/collection": "^0.1.6",
"@discordjs/builders": "^0.5.0",
"@discordjs/collection": "^0.2.1",
"@discordjs/form-data": "^3.0.1",
"abort-controller": "^3.0.0",
"@sapphire/async-queue": "^1.1.4",
"@types/ws": "^7.4.7",
"discord-api-types": "^0.22.0",
"node-fetch": "^2.6.1",
"prism-media": "^1.2.9",
"setimmediate": "^1.0.5",
"tweetnacl": "^1.0.3",
"ws": "^7.4.4"
"ws": "^7.5.1"
}
},
"dot-prop": {
@@ -3075,11 +3208,6 @@
"resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",
"integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc="
},
"event-target-shim": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz",
"integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ=="
},
"express": {
"version": "4.17.1",
"resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz",
@@ -3443,6 +3571,11 @@
"package-json": "^6.3.0"
}
},
"lodash.isequal": {
"version": "4.5.0",
"resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz",
"integrity": "sha1-QVxEePK8wwEgwizhDtMib30+GOA="
},
"logform": {
"version": "2.4.0",
"resolved": "https://registry.npmjs.org/logform/-/logform-2.4.0.tgz",
@@ -3640,6 +3773,39 @@
"resolved": "https://registry.npmjs.org/optional-require/-/optional-require-1.0.3.tgz",
"integrity": "sha512-RV2Zp2MY2aeYK5G+B/Sps8lW5NHAzE5QClbFP15j+PWmP+T9PxlJXBOOLoSAdgwFvS4t0aMR4vpedMkbHfh0nA=="
},
"ow": {
"version": "0.27.0",
"resolved": "https://registry.npmjs.org/ow/-/ow-0.27.0.tgz",
"integrity": "sha512-SGnrGUbhn4VaUGdU0EJLMwZWSupPmF46hnTRII7aCLCrqixTAC5eKo8kI4/XXf1eaaI8YEVT+3FeGNJI9himAQ==",
"requires": {
"@sindresorhus/is": "^4.0.1",
"callsites": "^3.1.0",
"dot-prop": "^6.0.1",
"lodash.isequal": "^4.5.0",
"type-fest": "^1.2.1",
"vali-date": "^1.0.0"
},
"dependencies": {
"@sindresorhus/is": {
"version": "4.6.0",
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz",
"integrity": "sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw=="
},
"dot-prop": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-6.0.1.tgz",
"integrity": "sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA==",
"requires": {
"is-obj": "^2.0.0"
}
},
"type-fest": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz",
"integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA=="
}
}
},
"p-cancelable": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz",
@@ -3693,12 +3859,6 @@
"resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz",
"integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc="
},
"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==",
"requires": {}
},
"process-nextick-args": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
@@ -3938,11 +4098,6 @@
"send": "0.17.1"
}
},
"setimmediate": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz",
"integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU="
},
"setprototypeof": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz",
@@ -4121,10 +4276,15 @@
"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",
"integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw=="
"ts-mixer": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/ts-mixer/-/ts-mixer-6.0.0.tgz",
"integrity": "sha512-nXIb1fvdY5CBSrDIblLn73NW0qRDk5yJ0Sk1qPBF560OdJfQp9jhl+0tzcY09OZ9U+6GpeoI9RjwoIKFIoB9MQ=="
},
"tslib": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz",
"integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw=="
},
"type-fest": {
"version": "0.20.2",
@@ -4215,6 +4375,11 @@
"resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz",
"integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM="
},
"vali-date": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/vali-date/-/vali-date-1.0.0.tgz",
"integrity": "sha1-G5BKWWCfsyjvB4E4Qgk09rhnCaY="
},
"vary": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
+1 -1
View File
@@ -12,7 +12,7 @@
"license": "ISC",
"dependencies": {
"colors": "^1.4.0",
"discord.js": "^12.5.3",
"discord.js": "^13.1.0",
"express": "^4.17.1",
"moment-duration-format": "^2.3.2",
"mongodb": "^3.6.8",
+6 -13
View File
@@ -8,8 +8,8 @@ const fs = require('fs');
class LinesPoliceCadBot extends Client {
constructor(config) {
super()
constructor(options, config) {
super(options)
this.config = config;
this.commands = new Collection();
@@ -32,14 +32,8 @@ class LinesPoliceCadBot extends Client {
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);
}
if (interaction.type==3) return;
const command = interaction.data.name.toLowerCase();
const args = interaction.data.options;
@@ -61,7 +55,6 @@ class LinesPoliceCadBot extends Client {
},
});
};
let cmd = client.commands.get(command);
if (cmd.SlashCommand && cmd.SlashCommand.run)
cmd.SlashCommand.run(this, interaction, args, { GuildDB });
@@ -277,7 +270,7 @@ class LinesPoliceCadBot extends Client {
// const help = new MessageEmbed()
// .setColor('#0099ff')
// .setTitle('**Commands:**')
// .setURL('https://discord.gg/w2g2FFmHbF')
// .setURL(client.config.SupportServer)
// .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({
@@ -334,7 +327,7 @@ class LinesPoliceCadBot extends Client {
// const stats = new MessageEmbed()
// .setColor('#0099ff')
// .setTitle("Current LPC-Bot Statistics")
// .setURL('https://discord.gg/w2g2FFmHbF')
// .setURL(client.config.SupportServer)
// .addField(" \u200B ", "**Channels** : ` " + `${client.channels.cache.size}` + " `")
// .addField(" \u200B ", "**Servers** : ` " + `${client.guilds.cache.size}` + " `")
// .addField(" \u200B ", "**Users** : ` " + `${client.users.cache.size}` + " `")