fix deprecation issues

This commit is contained in:
SowinskiBraeden committed 2022-09-30 10:52:40 -07:00
1 parent 4b0d89899a
commit a1cc29c43c
31 files changed
+586 -1933

No files matched your search

+7 -7
View File
@@ -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();