26 Commits
Author SHA1 Message Date
SowinskiBraeden ec0096cdd3 improper return 2022-05-15 09:46:41 -07:00
SowinskiBraeden 66966c7fd6 Trigger Heroku deploy after enabling collectstatic 2022-05-13 16:14:27 -07:00
SowinskiBraeden 6b1f010f32 fix plateSearch GuildDB undefined err 2022-05-11 14:02:45 -07:00
SowinskiBraeden 62077831b4 fix channel provide args 2022-05-10 21:06:11 -07:00
SowinskiBraeden 7ab1b78de1 fix interaction send not in comm 2022-05-10 11:42:53 -07:00
SowinskiBraeden 8e80c38255 Trigger Heroku deploy after enabling collectstatic 2022-05-06 22:33:32 -07:00
SowinskiBraeden d39e0226fc fix incorrect message ping in firearm search 2022-05-06 22:22:39 -07:00
SowinskiBraeden 759a1032c3 fix sockets and remove deprecated version 2022-05-06 22:15:25 -07:00
SowinskiBraeden 424d5721b5 fix panic feedback 2022-05-06 14:20:55 -07:00
SowinskiBraeden a0a2308270 add objectid def 2022-05-06 14:12:11 -07:00
SowinskiBraeden a1edacd4db remove debug 2022-05-06 13:58:29 -07:00
SowinskiBraeden 8ace046edf fix check status 2022-05-06 13:56:31 -07:00
SowinskiBraeden b07139bda9 bug fixes 2022-05-06 13:52:06 -07:00
SowinskiBraeden 449131e990 fix undefined exists func 2022-05-06 13:42:50 -07:00
SowinskiBraeden cd799a8974 fix undefined exists func 2022-05-06 13:39:38 -07:00
SowinskiBraeden c41849eb51 add log message 2022-03-28 17:21:56 -07:00
SowinskiBraeden adb40b3bb8 bot leave server 2022-03-28 17:20:48 -07:00
SowinskiBraeden 7565a75575 fix client not respond on /account 2022-03-21 16:47:40 -07:00
SowinskiBraeden e79ba906af update procfile 2022-03-19 14:26:00 -07:00
SowinskiBraeden a4025837a7 change error output to log 2022-03-19 14:14:54 -07:00
SowinskiBraeden 9c835a2503 fix version display and DefaultPrefix 2022-03-17 16:47:05 -07:00
SowinskiBraeden 2e43637d67 fix configs 2022-03-17 16:24:31 -07:00
SowinskiBraeden 50fcd6900c clean 2022-03-17 16:10:23 -07:00
SowinskiBraeden 96fc4f8fe4 update .gitignore 2022-03-17 16:00:49 -07:00
SowinskiBraeden 9a4bd50dd6 remove logs 2022-03-17 16:00:25 -07:00
SowinskiBraeden 98ea99e879 Merge pull request #11 from SowinskiBraeden/reformat-code
Reformat code
2022-03-17 15:59:14 -07:00
19 changed files with 28 additions and 147 deletions

No files matched your search

+1
View File
@@ -12,3 +12,4 @@ dev.js
# Logs
logs/*
Logs.log
-93
View File
@@ -1,93 +0,0 @@
{"level":"info","message":"21:function getMinutes() { [native code] } - 7:2:2022 | Info: Client has been logged in"}
{"level":"info","message":"21:function getMinutes() { [native code] } - 7:2:2022 | Info: Command Loaded: help"}
{"level":"info","message":"21:function getMinutes() { [native code] } - 7:2:2022 | Info: Command Loaded: stats"}
{"level":"info","message":"21:function getMinutes() { [native code] } - 7:2:2022 | Info: Client has been logged in"}
{"level":"info","message":"21:function getMinutes() { [native code] } - 7:2:2022 | Info: Command Loaded: help"}
{"level":"info","message":"21:function getMinutes() { [native code] } - 7:2:2022 | Info: Command Loaded: stats"}
{"level":"info","message":"21:function getMinutes() { [native code] } - 7:2:2022 | Info: Command Loaded: help"}
{"level":"info","message":"21:function getMinutes() { [native code] } - 7:2:2022 | Info: Command Loaded: stats"}
{"level":"info","message":"21:function getMinutes() { [native code] } - 7:2:2022 | Info: Event Loaded: guildCreate"}
{"level":"info","message":"21:function getMinutes() { [native code] } - 7:2:2022 | Info: Event Loaded: message"}
{"level":"info","message":"21:function getMinutes() { [native code] } - 7:2:2022 | Info: Event Loaded: ready"}
{"level":"info","message":"21:function getMinutes() { [native code] } - 7:2:2022 | Info: Event Loaded: guildCreate"}
{"level":"info","message":"21:function getMinutes() { [native code] } - 7:2:2022 | Info: Event Loaded: message"}
{"level":"info","message":"21:function getMinutes() { [native code] } - 7:2:2022 | Info: Event Loaded: ready"}
{"level":"info","message":"21:function getMinutes() { [native code] } - 7:2:2022 | Info: Command Loaded: help"}
{"level":"info","message":"21:function getMinutes() { [native code] } - 7:2:2022 | Info: Command Loaded: stats"}
{"level":"info","message":"21:function getMinutes() { [native code] } - 7:2:2022 | Info: Successfully Logged in as LPC-Bot Alpha#5344"}
{"level":"info","message":"21:function getMinutes() { [native code] } - 7:2:2022 | Info: Command Loaded: help"}
{"level":"info","message":"21:function getMinutes() { [native code] } - 7:2:2022 | Info: Command Loaded: stats"}
{"level":"info","message":"21:function getMinutes() { [native code] } - 7:2:2022 | Info: Event Loaded: guildCreate"}
{"level":"info","message":"21:function getMinutes() { [native code] } - 7:2:2022 | Info: Event Loaded: message"}
{"level":"info","message":"21:function getMinutes() { [native code] } - 7:2:2022 | Info: Event Loaded: ready"}
{"level":"info","message":"21:function getMinutes() { [native code] } - 7:2:2022 | Info: Successfully Logged in as LPC-Bot Alpha#5344"}
{"level":"info","message":"21:function getMinutes() { [native code] } - 7:2:2022 | Info: Command Loaded: help"}
{"level":"info","message":"21:function getMinutes() { [native code] } - 7:2:2022 | Info: Command Loaded: stats"}
{"level":"info","message":"21:function getMinutes() { [native code] } - 7:2:2022 | Info: Event Loaded: guildCreate"}
{"level":"info","message":"21:function getMinutes() { [native code] } - 7:2:2022 | Info: Event Loaded: message"}
{"level":"info","message":"21:function getMinutes() { [native code] } - 7:2:2022 | Info: Event Loaded: ready"}
{"level":"info","message":"21:function getMinutes() { [native code] } - 7:2:2022 | Info: Successfully Logged in as LPC-Bot Alpha#5344"}
{"level":"info","message":"22:function getMinutes() { [native code] } - 7:2:2022 | Info: Command Loaded: help"}
{"level":"info","message":"22:function getMinutes() { [native code] } - 7:2:2022 | Info: Command Loaded: stats"}
{"level":"info","message":"22:function getMinutes() { [native code] } - 7:2:2022 | Info: Event Loaded: guildCreate"}
{"level":"info","message":"22:function getMinutes() { [native code] } - 7:2:2022 | Info: Event Loaded: message"}
{"level":"info","message":"22:function getMinutes() { [native code] } - 7:2:2022 | Info: Event Loaded: ready"}
{"level":"info","message":"22:function getMinutes() { [native code] } - 7:2:2022 | Info: Successfully Logged in as LPC-Bot Alpha#5344"}
{"level":"info","message":"22:function getMinutes() { [native code] } - 7:2:2022 | Info: Command Loaded: help"}
{"level":"info","message":"22:function getMinutes() { [native code] } - 7:2:2022 | Info: Command Loaded: stats"}
{"level":"info","message":"22:function getMinutes() { [native code] } - 7:2:2022 | Info: Event Loaded: guildCreate"}
{"level":"info","message":"22:function getMinutes() { [native code] } - 7:2:2022 | Info: Event Loaded: message"}
{"level":"info","message":"22:function getMinutes() { [native code] } - 7:2:2022 | Info: Event Loaded: ready"}
{"level":"info","message":"22:function getMinutes() { [native code] } - 7:2:2022 | Info: Successfully Logged in as LPC-Bot Alpha#5344"}
{"level":"info","message":"22:function getMinutes() { [native code] } - 7:2:2022 | Info: Command Loaded: help"}
{"level":"info","message":"22:function getMinutes() { [native code] } - 7:2:2022 | Info: Command Loaded: stats"}
{"level":"info","message":"22:function getMinutes() { [native code] } - 7:2:2022 | Info: Event Loaded: guildCreate"}
{"level":"info","message":"22:function getMinutes() { [native code] } - 7:2:2022 | Info: Event Loaded: message"}
{"level":"info","message":"22:function getMinutes() { [native code] } - 7:2:2022 | Info: Event Loaded: ready"}
{"level":"info","message":"22:function getMinutes() { [native code] } - 7:2:2022 | Info: Successfully Logged in as LPC-Bot Alpha#5344"}
{"level":"info","message":"22:function getMinutes() { [native code] } - 7:2:2022 | Info: Command Loaded: help"}
{"level":"info","message":"22:function getMinutes() { [native code] } - 7:2:2022 | Info: Command Loaded: stats"}
{"level":"info","message":"22:function getMinutes() { [native code] } - 7:2:2022 | Info: Event Loaded: guildCreate"}
{"level":"info","message":"22:function getMinutes() { [native code] } - 7:2:2022 | Info: Event Loaded: message"}
{"level":"info","message":"22:function getMinutes() { [native code] } - 7:2:2022 | Info: Event Loaded: ready"}
{"level":"info","message":"22:function getMinutes() { [native code] } - 7:2:2022 | Info: Successfully Logged in as LPC-Bot Alpha#5344"}
{"level":"info","message":"22:function getMinutes() { [native code] } - 7:2:2022 | Info: Command Loaded: help"}
{"level":"info","message":"22:function getMinutes() { [native code] } - 7:2:2022 | Info: Command Loaded: stats"}
{"level":"info","message":"22:function getMinutes() { [native code] } - 7:2:2022 | Info: Event Loaded: guildCreate"}
{"level":"info","message":"22:function getMinutes() { [native code] } - 7:2:2022 | Info: Event Loaded: message"}
{"level":"info","message":"22:function getMinutes() { [native code] } - 7:2:2022 | Info: Event Loaded: ready"}
{"level":"info","message":"22:function getMinutes() { [native code] } - 7:2:2022 | Info: Successfully Logged in as LPC-Bot Alpha#5344"}
{"level":"info","message":"22:function getMinutes() { [native code] } - 7:2:2022 | Info: Event Loaded: guildCreate"}
{"level":"info","message":"22:function getMinutes() { [native code] } - 7:2:2022 | Info: Event Loaded: message"}
{"level":"info","message":"22:function getMinutes() { [native code] } - 7:2:2022 | Info: Event Loaded: ready"}
{"level":"info","message":"22:function getMinutes() { [native code] } - 7:2:2022 | Info: Command Loaded: help"}
{"level":"info","message":"22:function getMinutes() { [native code] } - 7:2:2022 | Info: Command Loaded: stats"}
{"level":"info","message":"22:function getMinutes() { [native code] } - 7:2:2022 | Info: Successfully Logged in as LPC-Bot Alpha#5344"}
{"level":"info","message":"22:function getMinutes() { [native code] } - 7:2:2022 | Info: Command Loaded: help"}
{"level":"info","message":"22:function getMinutes() { [native code] } - 7:2:2022 | Info: Command Loaded: stats"}
{"level":"info","message":"22:function getMinutes() { [native code] } - 7:2:2022 | Info: Event Loaded: guildCreate"}
{"level":"info","message":"22:function getMinutes() { [native code] } - 7:2:2022 | Info: Event Loaded: message"}
{"level":"info","message":"22:function getMinutes() { [native code] } - 7:2:2022 | Info: Event Loaded: ready"}
{"level":"info","message":"22:function getMinutes() { [native code] } - 7:2:2022 | Info: Successfully Logged in as LPC-Bot Alpha#5344"}
{"level":"info","message":"22:function getMinutes() { [native code] } - 7:2:2022 | Info: Event Loaded: guildCreate"}
{"level":"info","message":"22:function getMinutes() { [native code] } - 7:2:2022 | Info: Event Loaded: message"}
{"level":"info","message":"22:function getMinutes() { [native code] } - 7:2:2022 | Info: Event Loaded: ready"}
{"level":"info","message":"22:function getMinutes() { [native code] } - 7:2:2022 | Info: Command Loaded: help"}
{"level":"info","message":"22:function getMinutes() { [native code] } - 7:2:2022 | Info: Command Loaded: stats"}
{"level":"info","message":"22:function getMinutes() { [native code] } - 7:2:2022 | Info: Successfully Logged in as LPC-Bot Alpha#5344"}
{"level":"info","message":"22:function getMinutes() { [native code] } - 7:2:2022 | Info: Command Loaded: help"}
{"level":"info","message":"22:function getMinutes() { [native code] } - 7:2:2022 | Info: Command Loaded: stats"}
{"level":"info","message":"22:function getMinutes() { [native code] } - 7:2:2022 | Info: Event Loaded: guildCreate"}
{"level":"info","message":"22:function getMinutes() { [native code] } - 7:2:2022 | Info: Event Loaded: message"}
{"level":"info","message":"22:function getMinutes() { [native code] } - 7:2:2022 | Info: Event Loaded: ready"}
{"level":"info","message":"22:function getMinutes() { [native code] } - 7:2:2022 | Info: Successfully Logged in as LPC-Bot Alpha#5344"}
{"level":"info","message":"22:function getMinutes() { [native code] } - 7:2:2022 | Info: Interaction"}
{"level":"info","message":"11:function getMinutes() { [native code] } - 8:2:2022 | Info: Command Loaded: help"}
{"level":"info","message":"11:function getMinutes() { [native code] } - 8:2:2022 | Info: Command Loaded: stats"}
{"level":"info","message":"11:function getMinutes() { [native code] } - 8:2:2022 | Info: Event Loaded: guildCreate"}
{"level":"info","message":"11:function getMinutes() { [native code] } - 8:2:2022 | Info: Event Loaded: message"}
{"level":"info","message":"11:function getMinutes() { [native code] } - 8:2:2022 | Info: Event Loaded: ready"}
{"level":"info","message":"11:function getMinutes() { [native code] } - 8:2:2022 | Info: Error: ENOENT: no such file or directory, scandir 'C:\\Users\\flami\\Desktop\\Projects\\commands'"}
{"level":"info","message":"11:function getMinutes() { [native code] } - 8:2:2022 | Info: Error: ENOENT: no such file or directory, scandir 'C:\\Users\\flami\\Desktop\\Projects\\events'"}
{"level":"info","message":"11:function getMinutes() { [native code] } - 8:2:2022 | Info: Error: ENOENT: no such file or directory, scandir 'C:\\Users\\flami\\Desktop\\Projects\\commands'"}
{"level":"info","message":"11:function getMinutes() { [native code] } - 8:2:2022 | Info: Error: ENOENT: no such file or directory, scandir 'C:\\Users\\flami\\Desktop\\Projects\\events'"}
+2 -2
View File
@@ -1,2 +1,2 @@
Worker: node index.js
BetaWorker: node beta.js
Worker: node --optimize_for_size --max-old-space-size=2560 index.js
BetaWorker: node --optimize_for_size --max-old-space-size=2560 beta.js
-6
View File
@@ -1,6 +0,0 @@
const LinesPoliceCadBot = require('./structures/LinesPoliceCadBot');
const config = require('./config/beta-config');
const { Intents } = require('discord.js');
let client = new LinesPoliceCadBot({ intents:[Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES]}, config);
client.build()
+1 -1
View File
@@ -39,7 +39,7 @@ module.exports = {
client.users.fetch(interaction.member.user.id)
.then(duser => duser.send(`<@${interaction.member.user.id}> Logged in as **${user.user.username}** | **${user.user.email}**`).catch(err => {client.log(err)}))
.catch(err => {client.log(err)});
return
return interaction.send('Your account details have been sent in your dm.');
},
},
}
+1 -3
View File
@@ -30,7 +30,6 @@ module.exports = {
let targetUser = await client.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(targetUserID);
console.log(targetUserID, targetUser);
if (!targetUser) return message.channel.send(`Cannot find **${args[0].value}** ${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}`);
@@ -73,8 +72,7 @@ module.exports = {
let targetUser = await client.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(targetUserID);
console.debug(targetUserID, targetUser, User);
if (!targetUser) return message.channel.send(`Cannot find **${args[0].value}** <@${interaction.member.user.id}>`);
if (!targetUser) return interaction.send(`Cannot find **${args[0].value}** <@${interaction.member.user.id}>`);
if (targetUser.user.activeCommunity!=user.user.activeCommunity) {
return interaction.send(`You are not in the same community as \`${User.tag}\` <@${interaction.member.user.id}>`);
}
+2 -1
View File
@@ -1,4 +1,5 @@
const { MessageEmbed } = require('discord.js');
const ObjectId = require('mongodb').ObjectId;
module.exports = {
name: "community",
@@ -40,7 +41,7 @@ module.exports = {
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.`);
if (user.user.activeCommunity==null) return message.channel.send(`You are not in a community.`);
if (user.user.activeCommunity==null) return interaction.send(`You are not in a community.`);
let community = await client.dbo.collection("communities").findOne({_id:ObjectId(user.user.activeCommunity)}).then(community => community);
if (!community) return interaction.send(`Community not found.`);
return interaction.send(`You are in the community \`${community.community.name}\``);
+1 -1
View File
@@ -100,7 +100,7 @@ module.exports = {
socket.on('bot_firearm_search_results', results => {
if (results.user._id==user._id) {
if (results.firearms.length==0) {
return interaction.send(`No Firearms found ${message.author}`);
return interaction.send(`No Firearms found <@${interaction.member.user.id}>`);
}
for (let i = 0; i < results.firearms.length; i++) {
+1 -1
View File
@@ -119,7 +119,7 @@ module.exports = {
}help [Command] | Have a nice day!`
).setDescription(`${Commands.join("\n")}
Lines Police CAD Bot Version: v${client.Version}`);
Lines Police CAD Bot Version: v${client.config.Version}`);
if (!args) return interaction.send(Embed);
else {
let cmd =
+1 -1
View File
@@ -116,7 +116,7 @@ module.exports = {
socket.emit('panic_button_update', req);
socket.disconnect();
let guild = await client.dbo.collection("prefixes").findOne({"server.serverID":GuildDB.serverID}).then(guild => guild);
if (guild.server.pingOnPanic) return message.channel.send(`Attention <@&${guild.server.pingRole}>! \`${user.user.username}\` has activated panic`);
if (guild.server.pingOnPanic) return interaction.send(`Attention <@&${guild.server.pingRole}>! \`${user.user.username}\` has activated panic`);
return;
}
},
+1 -1
View File
@@ -17,7 +17,7 @@ module.exports = {
* @param {string[]} args
* @param {*} param3
*/
run: async (client, message, args) => {
run: async (client, message, args, { GuildDB }) => {
let useCommand = await client.verifyUseCommand(GuildDB.serverID, message.member.roles.cache, false);
if (!useCommand) return message.channel.send("You don't have permission to use this command");
+3 -3
View File
@@ -16,7 +16,7 @@ module.exports = {
* @param {string[]} args
* @param {*} param3
*/
run: async (client, message) => {
run: async (client, message, args) => {
if (args.length==0) return message.channel.send(`You must provide a channel.`);
let channelid = args[0].replace('<#', '').replace('>', '');
let channel = client.channels.cache.get(channelid);
@@ -54,11 +54,11 @@ module.exports = {
let channelid = args[0].value;
let channel = client.channels.cache.get(channelid);
if (!channel) return message.channel.send(`Cannot find that channel.`);
if (!channel) return interaction.send(`Cannot find that channel.`);
if (channel.type=="voice") return interaction.send(`Connot set voice channel to preferred channel.`);
if (channel.deleted) return interaction.send(`Connot set deleted channel to preferred channel.`);
let guild = await client.dbo.collection("prefixes").findOne({"server.serverID":interaction.guild.id}).then(guild => guild);
if (exists(guild.server.allowedChannels)&&guild.server.allowedChannels.includes(channelid)) return interaction.send(`The channel <#${args[0].value}> has already been added.`);
if (client.exists(guild.server.allowedChannels)&&guild.server.allowedChannels.includes(channelid)) return interaction.send(`The channel <#${args[0].value}> has already been added.`);
client.dbo.collection("prefixes").updateOne({"server.serverID":interaction.guild.id},{$push:{"server.allowedChannels":channelid},$set:{"server.hasCustomChannels":true}},function(err, res) {
if (err) throw err;
return interaction.send(`Successfully added <#${args[0].value}> to allowed channels.`);
+1 -1
View File
@@ -59,7 +59,7 @@ module.exports = {
return interaction.send(`Uh Oh! The role <@&${args[0].value}> connot be found.`);
} else {
let guild = await client.dbo.collection("prefixes").findOne({"server.serverID":interaction.guild.id}).then(guild => guild);
if (exists(guild.server.allowedRoles)&&guild.server.allowedRoles.includes(roleid)) return interaction.send(`The role <@&${args[0].value}> has already been added.`);
if (client.exists(guild.server.allowedRoles)&&guild.server.allowedRoles.includes(roleid)) return interaction.send(`The role <@&${args[0].value}> has already been added.`);
client.dbo.collection("prefixes").updateOne({"server.serverID":interaction.guild.id},{$push:{"server.allowedRoles":roleid},$set:{"server.hasCustomRoles":true}},function(err, res) {
if (err) throw err;
return interaction.send(`Successfully added <@&${args[0].value}> to allowed roles.`);
+2 -2
View File
@@ -86,8 +86,8 @@ module.exports = {
if (!useCommand) return interaction.send("You don't have permission to use this command");
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 ${message.author}`);
if (user.user.activeCommunity==null) return message.channel.send(`You must join a community to use this command.`);
if (!user) return interaction.send(`You are not logged in <@${interactoin.member.user.id}>`);
if (user.user.activeCommunity==null) return interaction.send(`You must join a community to use this command.`);
let onDuty=null;
let updateDuty=false;
let status = args[0].value;
-24
View File
@@ -1,24 +0,0 @@
module.exports = {
Dev: "DEVELOPMENT",
Version: "3.0.0 Beta",
Admins: ["362791661274660874"], // Admins of the bot
defaultPrefix: "?",
socket: "https://police-cad-dev.herokuapp.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-cad.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
},
}
+3 -3
View File
@@ -2,10 +2,10 @@ module.exports = {
Dev: "PRODUCTION",
Version: "3.0.0",
Admins: ["362791661274660874"], // Admins of the bot
defaultPrefix: "?",
socket: "https://linespolice-cad.com/",
DefaultPrefix: "?",
socket: "https://www.linespolice-cad.com/",
SupportServer: "https://discord.gg/w2g2FFmHbF", //Support Server Link
Token: process.env.TOKEN || "", //Discord Bot Token
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-cad.png",
EmbedColor: "#0099ff",
+1 -1
View File
@@ -2,5 +2,5 @@ const LinesPoliceCadBot = require('./structures/LinesPoliceCadBot');
const config = require('./config/config');
const { Intents } = require('discord.js');
let client = new LinesPoliceCadBot({ intents:[Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES]}, config);
let client = new LinesPoliceCadBot({ intents:[Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES]}, config);
client.build()
+1 -2
View File
@@ -103,7 +103,7 @@ class LinesPoliceCadBot extends Client {
});
}
exists(n){return null!=n&&null!=n&&""!=n}
exists(n) {return null != n && undefined != n && "" != n}
LoadCommands() {
let CommandsDir = path.join(__dirname, '..', 'commands');
@@ -245,7 +245,6 @@ class LinesPoliceCadBot extends Client {
Channel.send(embed);
}
build() {
this.login(this.config.Token);
}
+6 -1
View File
@@ -28,7 +28,12 @@ module.exports = (client, guild) => {
try {
await GuildAPI.commands.post({ data: dataStuff });
} catch (e) {
console.log(e);
client.log('Error: API missing permissions, re-invite the bot');
// Forces bot to leave server
let guildID = client.guilds.cache.get(guild);
if (guildID) guildID.leave();
client.log(`Server stats is now down to ${client.guilds.cache.size}`);
}
});
});