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

+5 -5
View File
@@ -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.` });
});
}
}