fix deprecation issues
This commit is contained in:
31 files changed
+586
-1933
No files matched your search
+3
-3
@@ -1,4 +1,4 @@
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const { EmbedBuilder } = require('discord.js');
|
||||
|
||||
module.exports = {
|
||||
name: "account",
|
||||
@@ -19,14 +19,14 @@ module.exports = {
|
||||
*/
|
||||
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.`);
|
||||
return interaction.send({ content: `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==null) return interaction.send(`You are not logged in.`);
|
||||
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 interaction.send('Your account details have been sent in your dm.');
|
||||
return interaction.send({ content: 'Your account details have been sent in your dm.' });
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const { EmbedBuilder } = require('discord.js');
|
||||
|
||||
module.exports = {
|
||||
name: "channels",
|
||||
@@ -19,12 +19,12 @@ module.exports = {
|
||||
*/
|
||||
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.`);
|
||||
return interaction.send({ content: `You are not allowed to use the bot in this channel.` });
|
||||
}
|
||||
|
||||
let guild = await client.dbo.collection("prefixes").findOne({"server.serverID":interaction.guild.id}).then(guild => guild);
|
||||
if (guild.server.hasCustomChannels==false) {
|
||||
return interaction.send('There are no channels set for the bot.');
|
||||
return interaction.send({ content: 'There are no channels set for the bot.' });
|
||||
}
|
||||
|
||||
let channels = ``;
|
||||
@@ -32,7 +32,7 @@ module.exports = {
|
||||
if (client.exists(guild.server.allowedChannels[i])) continue;
|
||||
else channels += `\n<#${guild.server.allowedChannels[i]}>`;
|
||||
}
|
||||
let channelsEmbed = new MessageEmbed()
|
||||
let channelsEmbed = new EmbedBuilder()
|
||||
.setColor('#0099ff')
|
||||
.setDescription('**Allowed Channels to use the Bot**')
|
||||
.addFields(
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const { EmbedBuilder } = require('discord.js');
|
||||
|
||||
module.exports = {
|
||||
name: "checkstatus",
|
||||
@@ -27,27 +27,27 @@ module.exports = {
|
||||
*/
|
||||
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.`);
|
||||
return interaction.send({ content: `You are not allowed to use the bot in this channel.` });
|
||||
}
|
||||
|
||||
let useCommand = await client.verifyUseCommand(GuildDB.serverID, interaction.member.roles, true);
|
||||
if (!useCommand) return interaction.send("You don't have permission to use this command");
|
||||
if (!useCommand) return interaction.send({ content: "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.`);
|
||||
if (user.user.activeCommunity == null) return interaction.send(`You must join a community to use this command.`);
|
||||
if (!user) return interaction.send({ content: `You are not logged in.` });
|
||||
if (user.user.activeCommunity == null) return interaction.send({ content: `You must join a community to use this command.` });
|
||||
if (!client.exists(args)) {
|
||||
return interaction.send(`<@${interaction.member.user.id}>'s status: \`${user.user.dispatchStatus}\` | Set by: \`${user.user.dispatchStatusSetBy}\``);
|
||||
return interaction.send({ content: `<@${interaction.member.user.id}>'s status: \`${user.user.dispatchStatus}\` | Set by: \`${user.user.dispatchStatusSetBy}\`` });
|
||||
} else {
|
||||
let targetUserID = args[0].value.replace('<@!', '').replace('>', '');
|
||||
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);
|
||||
if (!targetUser) return interaction.send(`Cannot find **${args[0].value}** <@${interaction.member.user.id}>`);
|
||||
if (!targetUser) return interaction.send({ content: `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}>`);
|
||||
return interaction.send({ content: `You are not in the same community as \`${User.tag}\` <@${interaction.member.user.id}>` });
|
||||
}
|
||||
return interaction.send(`<@${interaction.member.user.id}>, \`${User.tag}'s\` status: \`${targetUser.user.dispatchStatus}\` | Set by: \`${targetUser.user.dispatchStatusSetBy}\``);
|
||||
return interaction.send({ content: `<@${interaction.member.user.id}>, \`${User.tag}'s\` status: \`${targetUser.user.dispatchStatus}\` | Set by: \`${targetUser.user.dispatchStatusSetBy}\`` });
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const { EmbedBuilder } = require('discord.js');
|
||||
const ObjectId = require('mongodb').ObjectId;
|
||||
|
||||
module.exports = {
|
||||
@@ -20,15 +20,15 @@ module.exports = {
|
||||
*/
|
||||
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.`);
|
||||
return interaction.send({ content: `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.`);
|
||||
if (user.user.activeCommunity==null) return interaction.send(`You are not in a community.`);
|
||||
if (!user) return interaction.send({ content: `You are not logged in.` });
|
||||
if (user.user.activeCommunity==null) return interaction.send({ content: `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}\``);
|
||||
if (!community) return interaction.send({ content: `Community not found.` });
|
||||
return interaction.send({ content: `You are in the community \`${community.community.name}\`` });
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const { EmbedBuilder } = require('discord.js');
|
||||
|
||||
module.exports = {
|
||||
name: "connect_account",
|
||||
@@ -19,9 +19,9 @@ module.exports = {
|
||||
*/
|
||||
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.`);
|
||||
return interaction.send({ content: `You are not allowed to use the bot in this channel.` });
|
||||
}
|
||||
return interaction.send('Login from Lines Police CAD account management https://www.linespolice-cad.com/');
|
||||
return interaction.send({ content: 'Login from Lines Police CAD `account_management` https://www.linespolice-cad.com/' });
|
||||
},
|
||||
},
|
||||
}
|
||||
+9
-9
@@ -1,4 +1,4 @@
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const { EmbedBuilder } = require('discord.js');
|
||||
const io = require('socket.io-client');
|
||||
|
||||
module.exports = {
|
||||
@@ -37,8 +37,8 @@ module.exports = {
|
||||
run: async (client, interaction, args, { GuildDB }) => {
|
||||
if (!client.config.Admins.includes(interaction.member.user.id)) return;
|
||||
|
||||
if (args.length==0) return message.channel.send('Debug Error: Provide a debug command');
|
||||
if (!client.exists(args[0].value)) return interaction.send('Debug Error: Provide a valid debug command');
|
||||
if (args.length==0) return message.channel.send({ content: 'Debug Error: Provide a debug command' });
|
||||
if (!client.exists(args[0].value)) return interaction.send({ content: 'Debug Error: Provide a valid debug command' });
|
||||
|
||||
let debugConsole = args[1].value;
|
||||
|
||||
@@ -46,33 +46,33 @@ module.exports = {
|
||||
|
||||
if (command == 'server' || args[0] == 'guild') {
|
||||
if (debugConsole) client.log("Debug: Guild >> ");console.debug(GuildDB);
|
||||
return interaction.send("Debug: guild >> read log output")
|
||||
return interaction.send({ content: "Debug: guild >> read log output" })
|
||||
|
||||
} else if (command == "interaction") {
|
||||
if (debugConsole) {
|
||||
client.log("Debug: interaction >> ");
|
||||
console.debug(interaction);
|
||||
}
|
||||
return interaction.send("Debug: interaction >> read log output");
|
||||
return interaction.send({ content: "Debug: interaction >> read log output" });
|
||||
|
||||
} else if (command == "message") {
|
||||
return interaction.send(`Use command with prefix to debug \`message\``);
|
||||
return interaction.send({ content: `Use command with prefix to debug \`message\`` });
|
||||
|
||||
} else if (command == "pingserver") {
|
||||
const socket = io.connect(client.config.socket);
|
||||
socket.emit('botping', {message:'hello there'});
|
||||
socket.on('botpong', (data) => {
|
||||
if (debugConsole) client.log('Debug: Socket responded')
|
||||
return interaction.send(`Debug: Socket responded`)
|
||||
return interaction.send({ content: `Debug: Socket responded` })
|
||||
socket.disconnect();
|
||||
});
|
||||
|
||||
} else if (command == "apicheck") {
|
||||
// TODO: Make axios call to api and get api health
|
||||
return interaction.send('Debug Notice: \`apicheck\` is currently unavailable');
|
||||
return interaction.send({ content: 'Debug Notice: \`apicheck\` is currently unavailable' });
|
||||
|
||||
} else {
|
||||
return interaction.send('Debug Error: Provide a valid debug command');
|
||||
return interaction.send({ content: 'Debug Error: Provide a valid debug command' });
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const { EmbedBuilder } = require('discord.js');
|
||||
|
||||
module.exports = {
|
||||
name: "disconnect_account",
|
||||
@@ -19,13 +19,13 @@ module.exports = {
|
||||
*/
|
||||
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.`);
|
||||
return interaction.send({ content: `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 cannot logout if your not logged in.`);
|
||||
if (!user) return interaction.send({ content: `You cannot logout if your not logged in.` });
|
||||
client.dbo.collection("users").updateOne({"user.discord.id":interaction.member.user.id},{$unset:{"user.discord":""}, $set:{"user.discordConnected":false}},function(err,res) {
|
||||
if (err) throw err;
|
||||
return interaction.send(`Succesfully disconnected you Discord account.`);
|
||||
return interaction.send({ content: `Succesfully disconnected you Discord account.` });
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const { EmbedBuilder } = require('discord.js');
|
||||
const io = require('socket.io-client');
|
||||
|
||||
module.exports = {
|
||||
@@ -28,14 +28,14 @@ module.exports = {
|
||||
*/
|
||||
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.`);
|
||||
return interaction.send({ content: `You are not allowed to use the bot in this channel.` });
|
||||
}
|
||||
|
||||
let useCommand = await client.verifyUseCommand(GuildDB.serverID, interaction.member.roles, true);
|
||||
if (!useCommand) return interaction.send("You don't have permission to use this command");
|
||||
if (!useCommand) return interaction.send({ content: "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.`);
|
||||
if (!user) return interaction.send({ content: `You are not logged in.` });
|
||||
let data = {
|
||||
user: user,
|
||||
query: {
|
||||
@@ -48,11 +48,11 @@ 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 <@${interaction.member.user.id}>`);
|
||||
return interaction.send({ content: `No Firearms found <@${interaction.member.user.id}>` });
|
||||
}
|
||||
|
||||
for (let i = 0; i < results.firearms.length; i++) {
|
||||
let firearmResult = new MessageEmbed()
|
||||
let firearmResult = new EmbedBuilder()
|
||||
.setColor('#0099ff')
|
||||
.setTitle(`**${results.firearms[i].firearm.serialNumber} | ${results.firearms[i]._id}**`)
|
||||
.setURL('https://discord.gg/jgUW656v2t')
|
||||
@@ -67,7 +67,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});
|
||||
interaction.send(firearmResult);
|
||||
interaction.send({ embeds: [firearmResult] });
|
||||
}
|
||||
}
|
||||
socket.disconnect();
|
||||
|
||||
+5
-5
@@ -1,4 +1,4 @@
|
||||
const { MessageEmbed } = require("discord.js");
|
||||
const { EmbedBuilder } = require("discord.js");
|
||||
|
||||
module.exports = {
|
||||
name: "help",
|
||||
@@ -28,7 +28,7 @@ module.exports = {
|
||||
|
||||
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.`);
|
||||
return interaction.send({ content: `You are not allowed to use the bot in this channel.` });
|
||||
}
|
||||
let Commands = client.commands.filter((cmd) => {
|
||||
if (client.exists(cmd.debug)) return !cmd.debug
|
||||
@@ -37,7 +37,7 @@ module.exports = {
|
||||
`\`/${cmd.name}${cmd.usage ? " " + cmd.usage : ""}\` - ${cmd.description}`
|
||||
);
|
||||
|
||||
let Embed = new MessageEmbed()
|
||||
let Embed = new EmbedBuilder()
|
||||
.setColor(client.config.EmbedColor)
|
||||
.setDescription(`${Commands.join("\n")}
|
||||
|
||||
@@ -55,7 +55,7 @@ module.exports = {
|
||||
`❌ | Unable to find that command.`
|
||||
);
|
||||
|
||||
let embed = new MessageEmbed()
|
||||
let embed = new EmbedBuilder()
|
||||
.setAuthor(`Command: ${cmd.name}`, client.config.IconURL)
|
||||
.setDescription(cmd.description)
|
||||
.setColor("GREEN")
|
||||
@@ -73,7 +73,7 @@ module.exports = {
|
||||
true
|
||||
)
|
||||
|
||||
return interaction.send(embed);
|
||||
return interaction.send({ embeds: [embed] });
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const { EmbedBuilder } = require('discord.js');
|
||||
const io = require('socket.io-client');
|
||||
|
||||
module.exports = {
|
||||
@@ -28,11 +28,11 @@ module.exports = {
|
||||
*/
|
||||
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.`);
|
||||
return interaction.send({ content: `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.`);
|
||||
if (!user) return interaction.send({ content: `You are not logged in.` });
|
||||
let myReq = {
|
||||
userID: user._id,
|
||||
communityCode: args[0].value
|
||||
@@ -42,9 +42,9 @@ module.exports = {
|
||||
socket.on('bot_joined_community', (data) => {
|
||||
socket.disconnect()
|
||||
if (data.error) {
|
||||
return interaction.send(`${data.error}`);
|
||||
return interaction.send({ content: `${data.error}` });
|
||||
}
|
||||
return interaction.send(`Successfully joined the community \` ${data.commName} \``)
|
||||
return interaction.send({ content: `Successfully joined the community \` ${data.commName} \`` })
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const { EmbedBuilder } = require('discord.js');
|
||||
const io = require('socket.io-client');
|
||||
|
||||
module.exports = {
|
||||
@@ -20,11 +20,11 @@ module.exports = {
|
||||
*/
|
||||
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.`);
|
||||
return interaction.send({ content: `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.`);
|
||||
if (!user) return interaction.send({ content: `You are not logged in.` });
|
||||
let myReq = {
|
||||
userID: user._id
|
||||
};
|
||||
@@ -33,9 +33,9 @@ module.exports = {
|
||||
socket.on('bot_left_community', (data) => {
|
||||
socket.disconnect()
|
||||
if (data.error) {
|
||||
return interaction.send(`${data.error}`);
|
||||
return interaction.send({ content: `${data.error}` });
|
||||
}
|
||||
return interaction.send(`${data.message}`);
|
||||
return interaction.send({ content: `${data.message}` });
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const { EmbedBuilder } = require('discord.js');
|
||||
const io = require('socket.io-client');
|
||||
|
||||
module.exports = {
|
||||
@@ -42,14 +42,14 @@ module.exports = {
|
||||
*/
|
||||
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.`);
|
||||
return interaction.send({ content: `You are not allowed to use the bot in this channel.` });
|
||||
}
|
||||
|
||||
let useCommand = await client.verifyUseCommand(GuildDB.serverID, interaction.member.roles, true);
|
||||
if (!useCommand) return interaction.send("You don't have permission to use this command");
|
||||
if (!useCommand) return interaction.send({ content: "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.`);
|
||||
if (!user) return interaction.send({ content: `You are not logged in.` });
|
||||
let data;
|
||||
|
||||
data = {
|
||||
@@ -82,7 +82,7 @@ module.exports = {
|
||||
if (firearmLicence == undefined || firearmLicence == null) firearmLicence = 'None';
|
||||
if (firearmLicence == '2') firearmLicence = 'Valid';
|
||||
if (firearmLicence == '3') firearmLicence = 'Revoked';
|
||||
let nameResult = new MessageEmbed()
|
||||
let nameResult = new EmbedBuilder()
|
||||
.setColor('#0099ff')
|
||||
.setTitle(`**${results.civilians[i].civilian.firstName} ${results.civilians[i].civilian.lastName} | ${results.civilians[i]._id}**`)
|
||||
.setURL('https://discord.gg/jgUW656v2t')
|
||||
@@ -125,7 +125,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});
|
||||
interaction.send(nameResult);
|
||||
interaction.send({ embeds: [nameResult] });
|
||||
}
|
||||
}
|
||||
socket.disconnect();
|
||||
|
||||
+8
-8
@@ -1,4 +1,4 @@
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const { EmbedBuilder } = require('discord.js');
|
||||
const io = require('socket.io-client');
|
||||
|
||||
module.exports = {
|
||||
@@ -19,15 +19,15 @@ module.exports = {
|
||||
*/
|
||||
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.`);
|
||||
return interaction.send({ content: `You are not allowed to use the bot in this channel.` });
|
||||
}
|
||||
|
||||
let useCommand = await client.verifyUseCommand(GuildDB.serverID, interaction.member.roles, true);
|
||||
if (!useCommand) return interaction.send("You don't have permission to use this command");
|
||||
if (!useCommand) return interaction.send({ content: "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.`);
|
||||
if (user.user.activeCommunity==null) return interaction.send(`You must join a community to use this command.`);
|
||||
if (!user) return interaction.send({ content: `You are not logged in.` });
|
||||
if (user.user.activeCommunity==null) return interaction.send({ content: `You must join a community to use this command.` });
|
||||
const socket = io.connect(client.config.socket);
|
||||
// If panic is enabled, disable panic
|
||||
if (user.user.dispatchStatus=='Panic') {
|
||||
@@ -53,8 +53,8 @@ module.exports = {
|
||||
// If panic is disabled, enable panic
|
||||
} else {
|
||||
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 interaction.send(`You must join a community to use this command.`);
|
||||
if (!user) return interaction.send({ content: `You are not logged in.` });
|
||||
if (user.user.activeCommunity==null) return interaction.send({ content: `You must join a community to use this command.` });
|
||||
client.forceUpdateStatus('Panic', user);
|
||||
|
||||
let req = {
|
||||
@@ -65,7 +65,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 interaction.send(`Attention <@&${guild.server.pingRole}>! \`${user.user.username}\` has activated panic`);
|
||||
if (guild.server.pingOnPanic) return interaction.send({ content: `Attention <@&${guild.server.pingRole}>! \`${user.user.username}\` has activated panic` });
|
||||
return;
|
||||
}
|
||||
},
|
||||
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const { EmbedBuilder } = require('discord.js');
|
||||
|
||||
module.exports = {
|
||||
name: "ping",
|
||||
@@ -19,9 +19,9 @@ module.exports = {
|
||||
*/
|
||||
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.`);
|
||||
return interaction.send({ content: `You are not allowed to use the bot in this channel.` });
|
||||
}
|
||||
interaction.send('Pong!');
|
||||
interaction.send({ content: 'Pong!' });
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const { EmbedBuilder } = require('discord.js');
|
||||
|
||||
module.exports = {
|
||||
name: "pingonpanic",
|
||||
@@ -19,11 +19,11 @@ module.exports = {
|
||||
*/
|
||||
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.`);
|
||||
return interaction.send({ content: `You are not allowed to use the bot in this channel.` });
|
||||
}
|
||||
|
||||
let guild = await client.dbo.collection("prefixes").findOne({"server.serverID":interaction.guild.id}).then(guild => guild);
|
||||
return interaction.send(`Current Ping on Panic Status: \` ${guild.server.pingOnPanic} \``);
|
||||
return interaction.send({ content: `Current Ping on Panic Status: \` ${guild.server.pingOnPanic} \`` });
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const { EmbedBuilder } = require('discord.js');
|
||||
const io = require('socket.io-client');
|
||||
|
||||
module.exports = {
|
||||
@@ -28,14 +28,14 @@ module.exports = {
|
||||
*/
|
||||
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.`);
|
||||
return interaction.send({ content: `You are not allowed to use the bot in this channel.` });
|
||||
}
|
||||
|
||||
let useCommand = await client.verifyUseCommand(GuildDB.serverID, interaction.member.roles, true);
|
||||
if (!useCommand) return interaction.send("You don't have permission to use this command");
|
||||
if (!useCommand) return interaction.send({ content: "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.`);
|
||||
if (!user) return interaction.send({ content: `You are not logged in.` });
|
||||
let data = {
|
||||
user: user,
|
||||
query: {
|
||||
@@ -49,11 +49,11 @@ module.exports = {
|
||||
|
||||
if (results.user._id==user._id) {
|
||||
if (results.vehicles.length == 0) {
|
||||
return interaction.send(`Plate Number \`${args[0].value}\` not found.`);
|
||||
return interaction.send({ content: `Plate Number \`${args[0].value}\` not found.` });
|
||||
}
|
||||
|
||||
for (let i = 0; i < results.vehicles.length; i++) {
|
||||
let plateResult = new MessageEmbed()
|
||||
let plateResult = new EmbedBuilder()
|
||||
.setColor('#0099ff')
|
||||
.setTitle(`**${results.vehicles[i].vehicle.plate} | ${results.vehicles[i]._id}**`)
|
||||
.setURL('https://discord.gg/jgUW656v2t')
|
||||
@@ -76,7 +76,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 });
|
||||
return interaction.send(plateResult);
|
||||
return interaction.send({ embeds: [plateResult] });
|
||||
}
|
||||
}
|
||||
socket.disconnect();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const { EmbedBuilder } = require('discord.js');
|
||||
|
||||
module.exports = {
|
||||
name: "removechannel",
|
||||
@@ -27,27 +27,27 @@ module.exports = {
|
||||
*/
|
||||
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.`);
|
||||
return interaction.send({ content: `You are not allowed to use the bot in this channel.` });
|
||||
}
|
||||
|
||||
if (args.length==0) return interaction.send(`You must provide a channel.`);
|
||||
if (args.length==0) return interaction.send({ content: `You must provide a channel.` });
|
||||
let channelid = args[0].value;
|
||||
let channel = client.channels.cache.get(channelid);
|
||||
if (!channel) return interaction.send(`Uh Oh! The channel <#${args[0].value}> connot be found.`);
|
||||
if (!channel) return interaction.send({ content: `Uh Oh! The channel <#${args[0].value}> connot be found.` });
|
||||
let guild = await client.dbo.collection("prefixes").findOne({"server.serverID":interaction.guild.id}).then(guild => guild);
|
||||
if (guild.server.hasCustomChannels==false) return interaction.send(`There are no channels to be removed.`);
|
||||
if (!guild.server.allowedChannels.includes(channelid)) return interaction.send(`The channel <#${args[0].value}> is not added to your roles.`);
|
||||
if (guild.server.hasCustomChannels==false) return interaction.send({ content: `There are no channels to be removed.` });
|
||||
if (!guild.server.allowedChannels.includes(channelid)) return interaction.send({ content: `The channel <#${args[0].value}> is not added to your roles.` });
|
||||
for (let i = 0; i < guild.server.allowedChannels.length; i++) {
|
||||
if (guild.server.allowedChannels[i]==channelid) {
|
||||
if ((guild.server.allowedChannels.length-1)==0) {
|
||||
client.dbo.collection("prefixes").updateOne({"server.serverID":interaction.guild.id},{$pull:{"server.allowedChannels":channelid},$set:{"server.hasCustomChannels":false}},function(err, res) {
|
||||
if (err) throw err;
|
||||
return interaction.send(`Successfully removed <#${args[0].value}> from allowed channels! There are no more allowed channels.`);
|
||||
return interaction.send({ content: `Successfully removed <#${args[0].value}> from allowed channels! There are no more allowed channels.` });
|
||||
});
|
||||
} else if ((guild.server.allowedChannels.length-1)>0) {
|
||||
client.dbo.collection("prefixes").updateOne({"server.serverID":interaction.guild.id},{$pull:{"server.allowedChannels":channelid}},function(err, res) {
|
||||
if (err) throw err;
|
||||
return interaction.send(`Successfully removed <#${args[0].value}> from allowed channels.`);
|
||||
return interaction.send({ content: `Successfully removed <#${args[0].value}> from allowed channels.` });
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const { EmbedBuilder } = require('discord.js');
|
||||
|
||||
module.exports = {
|
||||
name: "removerole",
|
||||
@@ -27,28 +27,28 @@ module.exports = {
|
||||
*/
|
||||
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.`);
|
||||
return interaction.send({ content: `You are not allowed to use the bot in this channel.` });
|
||||
}
|
||||
|
||||
let roleid = args[0].value;
|
||||
let role = interaction.guild.roles.cache.find(x => x.id == roleid);
|
||||
if (role == undefined) {
|
||||
return interaction.send(`Uh Oh! The role <@&${args[0].value}> connot be found.`);
|
||||
return interaction.send({ content: `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 (guild.server.hasCustomRoles==false) return interaction.send(`There are no roles to be removed.`);
|
||||
if (!guild.server.allowedRoles.includes(roleid)) return interaction.send(`The role <@&${args[0].value}> is not added to your roles.`);
|
||||
if (guild.server.hasCustomRoles==false) return interaction.send({ content: `There are no roles to be removed.` });
|
||||
if (!guild.server.allowedRoles.includes(roleid)) return interaction.send({ content: `The role <@&${args[0].value}> is not added to your roles.` });
|
||||
for (let i = 0; i < guild.server.allowedRoles.length; i++) {
|
||||
if (guild.server.allowedRoles[i]==roleid) {
|
||||
if ((guild.server.allowedRoles.length-1)==0) {
|
||||
client.dbo.collection("prefixes").updateOne({"server.serverID":interaction.guild.id},{$pull:{"server.allowedRoles":roleid},$set:{"server.hasCustomRoles":false}},function(err, res) {
|
||||
if (err) throw err;
|
||||
return interaction.send(`Successfully removed <@&${args[0].value}> from allowed roles! There are no more allowed roles.`);
|
||||
return interaction.send({ content: `Successfully removed <@&${args[0].value}> from allowed roles! There are no more allowed roles.` });
|
||||
});
|
||||
} else if ((guild.server.allowedRoles.length-1)>0) {
|
||||
client.dbo.collection("prefixes").updateOne({"server.serverID":interaction.guild.id},{$pull:{"server.allowedRoles":roleid}},function(err, res) {
|
||||
if (err) throw err;
|
||||
return interaction.send(`Successfully removed <@&${args[0].value}> from allowed roles.`);
|
||||
return interaction.send({ content: `Successfully removed <@&${args[0].value}> from allowed roles.` });
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -1,4 +1,4 @@
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const { EmbedBuilder } = require('discord.js');
|
||||
|
||||
module.exports = {
|
||||
name: "roles",
|
||||
@@ -19,12 +19,12 @@ module.exports = {
|
||||
*/
|
||||
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.`);
|
||||
return interaction.send({ content: `You are not allowed to use the bot in this channel.` });
|
||||
}
|
||||
|
||||
let guild = await client.dbo.collection("prefixes").findOne({"server.serverID":interaction.guild.id}).then(guild => guild);
|
||||
if (guild.server.hasCustomRoles==false) {
|
||||
return interaction.send('There are no roles set for the bot.');
|
||||
return interaction.send({ content: 'There are no roles set for the bot.' });
|
||||
}
|
||||
|
||||
let roles = ``;
|
||||
@@ -34,7 +34,7 @@ module.exports = {
|
||||
if (roles.length==0) roles += `@${role.name}`;
|
||||
else roles += `\n@${role.name}`;
|
||||
}
|
||||
let rolesEmbed = new MessageEmbed()
|
||||
let rolesEmbed = new EmbedBuilder()
|
||||
.setColor('#0099ff')
|
||||
.setDescription('|**Allowed Roles to use the Bot**')
|
||||
.addFields(
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const { EmbedBuilder } = require('discord.js');
|
||||
|
||||
module.exports = {
|
||||
name: "setchannel",
|
||||
@@ -27,19 +27,19 @@ module.exports = {
|
||||
*/
|
||||
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.`);
|
||||
return interaction.send({ content: `You are not allowed to use the bot in this channel.` });
|
||||
}
|
||||
|
||||
let channelid = args[0].value;
|
||||
let channel = client.channels.cache.get(channelid);
|
||||
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.`);
|
||||
if (!channel) return interaction.send({ content: `Cannot find that channel.` });
|
||||
if (channel.type=="voice") return interaction.send({ content: `Connot set voice channel to preferred channel.` });
|
||||
if (channel.deleted) return interaction.send({ content: `Connot set deleted channel to preferred channel.` });
|
||||
let guild = await client.dbo.collection("prefixes").findOne({"server.serverID":interaction.guild.id}).then(guild => guild);
|
||||
if (client.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({ content: `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.`);
|
||||
return interaction.send({ content: `Successfully added <#${args[0].value}> to allowed channels.` });
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const { EmbedBuilder } = require('discord.js');
|
||||
|
||||
module.exports = {
|
||||
name: "setprefix",
|
||||
@@ -27,12 +27,12 @@ module.exports = {
|
||||
*/
|
||||
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.`);
|
||||
return interaction.send({ content: `You are not allowed to use the bot in this channel.` });
|
||||
}
|
||||
if (args[0].length<1) return interaction.send('Your new prefix must be \`1\` character!')
|
||||
if (args[0].length<1) return interaction.send({ content: 'Your new prefix must be \`1\` character!' })
|
||||
client.dbo.collection("prefixes").updateOne({"server.serverID":GuildDB.serverID},{$set:{"server.prefix":args[0].value}},function(err, res) {
|
||||
if (err) throw err;
|
||||
interaction.send(`The new prefix is now **\`${args[0].value}\`**`);
|
||||
interaction.send({ content: `The new prefix is now **\`${args[0].value}\`**` });
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
+5
-5
@@ -1,4 +1,4 @@
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const { EmbedBuilder } = require('discord.js');
|
||||
|
||||
module.exports = {
|
||||
name: "setrole",
|
||||
@@ -27,19 +27,19 @@ module.exports = {
|
||||
*/
|
||||
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.`);
|
||||
return interaction.send({ content: `You are not allowed to use the bot in this channel.` });
|
||||
}
|
||||
|
||||
let roleid = args[0].value;
|
||||
let role = interaction.guild.roles.cache.find(x => x.id == roleid);
|
||||
if (role == undefined) {
|
||||
return interaction.send(`Uh Oh! The role <@&${args[0].value}> connot be found.`);
|
||||
return interaction.send({ content: `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 (client.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({ content: `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.`);
|
||||
return interaction.send({ content: `Successfully added <@&${args[0].value}> to allowed roles.` });
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
+4
-4
@@ -1,4 +1,4 @@
|
||||
const { MessageEmbed } = require("discord.js");
|
||||
const { EmbedBuilder } = require("discord.js");
|
||||
require("moment-duration-format");
|
||||
|
||||
module.exports = {
|
||||
@@ -19,17 +19,17 @@ module.exports = {
|
||||
*/
|
||||
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.`);
|
||||
return interaction.send({ content: `You are not allowed to use the bot in this channel.` });
|
||||
}
|
||||
const { version } = require("discord.js");
|
||||
const stats = new MessageEmbed()
|
||||
const stats = new EmbedBuilder()
|
||||
.setColor('#0099ff')
|
||||
.setTitle("Current LPC-Bot Statistics")
|
||||
.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}` + " `")
|
||||
interaction.send(stats)
|
||||
interaction.send({ embeds: [stats] })
|
||||
},
|
||||
},
|
||||
};
|
||||
@@ -1,4 +1,4 @@
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const { EmbedBuilder } = require('discord.js');
|
||||
|
||||
module.exports = {
|
||||
name: "togglepingonpanic",
|
||||
@@ -34,24 +34,24 @@ module.exports = {
|
||||
*/
|
||||
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.`);
|
||||
return interaction.send({ content: `You are not allowed to use the bot in this channel.` });
|
||||
}
|
||||
|
||||
if (!args[0].value) {
|
||||
// disable ping on panic and remove ping role
|
||||
client.dbo.collection("prefixes").updateOne({"server.serverID":interaction.guild.id},{$set:{"server.pingOnPanic":false,"server.pingRole":null}},function(err, res) {
|
||||
if (err) throw err;
|
||||
return interaction.send(`Successfully disabled ping role on panic.`);
|
||||
return interaction.send({ content: `Successfully disabled ping role on panic.` });
|
||||
});
|
||||
} else if (args[0].value) {
|
||||
let roleid = args[1].value;
|
||||
let role = interaction.guild.roles.cache.find(x => x.id == roleid);
|
||||
if (role == undefined) {
|
||||
return interaction.send(`Uh Oh! The role <@&${args[1].value}> connot be found.`);
|
||||
return interaction.send({ content: `Uh Oh! The role <@&${args[1].value}> connot be found.` });
|
||||
} else {
|
||||
client.dbo.collection("prefixes").updateOne({"server.serverID":interaction.guild.id},{$set:{"server.pingRole":roleid,"server.pingOnPanic":true}},function(err, res) {
|
||||
if (err) throw err;
|
||||
return interaction.send(`Successfully set <@&${args[1].value}> to be pinged on panic.`);
|
||||
return interaction.send({ content: `Successfully set <@&${args[1].value}> to be pinged on panic.` });
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
+11
-11
@@ -1,4 +1,4 @@
|
||||
const { MessageEmbed, MessageActionRow, MessageButton } = require('discord.js');
|
||||
const { EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle } = require('discord.js');
|
||||
const io = require('socket.io-client');
|
||||
|
||||
module.exports = {
|
||||
@@ -42,14 +42,14 @@ module.exports = {
|
||||
*/
|
||||
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.`);
|
||||
return interaction.send({ content: `You are not allowed to use the bot in this channel.` });
|
||||
}
|
||||
|
||||
let useCommand = await client.verifyUseCommand(GuildDB.serverID, interaction.member.roles, true);
|
||||
if (!useCommand) return interaction.send("You don't have permission to use this command");
|
||||
if (!useCommand) return interaction.send({ content: "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.`);
|
||||
if (!user) return interaction.send({ content: `You are not logged in.` });
|
||||
|
||||
let data = {
|
||||
user: user,
|
||||
@@ -66,7 +66,7 @@ module.exports = {
|
||||
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.`);
|
||||
return interaction.send({ content: `Name \`${args[0].value} ${args[1].value}\` not found.` });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ module.exports = {
|
||||
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()
|
||||
nameResult = new EmbedBuilder()
|
||||
.setColor('#0099ff')
|
||||
.setTitle(`**${results.civilians[i].civilian.firstName} ${results.civilians[i].civilian.lastName} | ${results.civilians[i]._id}**`)
|
||||
.setURL('https://discord.gg/jgUW656v2t')
|
||||
@@ -91,16 +91,16 @@ module.exports = {
|
||||
{ name: `**Drivers License**`, value: `\`${licenseStatus}\``, inline: true },
|
||||
{ name: `**Gender**`, value: `\`${results.civilians[i].civilian.gender}\``, inline: true }
|
||||
)
|
||||
row = new MessageActionRow()
|
||||
row = new ActionRowBuilder()
|
||||
.addComponents(
|
||||
new MessageButton()
|
||||
new ButtonBuilder()
|
||||
.setCustomId(`license-revoke-${results.civilians[i]._id}`)
|
||||
.setLabel("Revoke")
|
||||
.setStyle("DANGER"),
|
||||
new MessageButton()
|
||||
.setStyle(ButtonStyle.Danger),
|
||||
new ButtonBuilder()
|
||||
.setCustomId(`license-reinstate-${results.civilians[i]._id}`)
|
||||
.setLabel("Reinstate")
|
||||
.setStyle("SUCCESS")
|
||||
.setStyle(ButtonStyle.Success)
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const { EmbedBuilder } = require('discord.js');
|
||||
const io = require('socket.io-client');
|
||||
|
||||
module.exports = {
|
||||
@@ -34,15 +34,15 @@ module.exports = {
|
||||
*/
|
||||
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.`);
|
||||
return interaction.send({ content: `You are not allowed to use the bot in this channel.` });
|
||||
}
|
||||
|
||||
let useCommand = await client.verifyUseCommand(GuildDB.serverID, interaction.member.roles, true);
|
||||
if (!useCommand) return interaction.send("You don't have permission to use this command");
|
||||
if (!useCommand) return interaction.send({ content: "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 <@${interactoin.member.user.id}>`);
|
||||
if (user.user.activeCommunity==null) return interaction.send(`You must join a community to use this command.`);
|
||||
if (!user) return interaction.send({ content: `You are not logged in <@${interactoin.member.user.id}>` });
|
||||
if (user.user.activeCommunity==null) return interaction.send({ content: `You must join a community to use this command.` });
|
||||
let onDuty=null;
|
||||
let updateDuty=false;
|
||||
let status = args[0].value;
|
||||
@@ -66,7 +66,7 @@ module.exports = {
|
||||
const socket = io.connect(client.config.socket);
|
||||
socket.emit('bot_update_status', req);
|
||||
socket.on('bot_updated_status', (res) => {
|
||||
interaction.send(`Succesfully updated <@${interaction.member.user.id}>'s status to \`${args[0].value}\``);
|
||||
interaction.send({ content: `Succesfully updated <@${interaction.member.user.id}>'s status to \`${args[0].value}\`` });
|
||||
socket.disconnect();
|
||||
});
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user