wolfcountBot/commands/Management/resetwolfcount.js

49 lines
1.7 KiB
JavaScript
Raw Normal View History

2023-04-28 07:48:43 -04:00
const { EmbedBuilder } = require('discord.js');
const wolfcount = require('../../models/wolfcount');
2023-05-24 04:31:35 -04:00
const { spawn } = require("child_process");
2023-04-28 07:48:43 -04:00
ownerList = [
'213966480621043712',
'237542879227019264',
'294840381080600576'
];
module.exports = {
name: "wolfcountreset",
private: true,
description: "Reset the wolfcount",
run: async (client, interaction) => {
if (ownerList.includes(interaction.user.id)) {
resetcount = 0
// Reset the wolf count
wolfcount.findByIdAndUpdate("6447da87681fd1bc486a4923", {count: resetcount}).then(() => {
console.log('');
console.log('Count reset!');
}).catch((error) => {
console.error(error);
});
const embed = new EmbedBuilder()
.setColor("#FF0000")
.setTitle("🐺 count reset")
.setDescription(`The count has been reset. (Requested by: ${interaction.user.tag})`)
.setTimestamp()
.setFooter({ text: `Requested by ${interaction.user.tag}`, iconURL: `${interaction.user.displayAvatarURL()}` });
interaction.followUp({ embeds: [embed] });
2023-05-24 04:31:35 -04:00
basecount = resetcount;
2023-04-28 07:48:43 -04:00
} else {
const embed = new EmbedBuilder()
.setColor("#FF0000")
.setTitle("🐺 no perms")
.setDescription(`You have no perms to do this.`)
.setTimestamp()
.setFooter({ text: `Requested by ${interaction.user.tag}`, iconURL: `${interaction.user.displayAvatarURL()}` });
interaction.followUp({ embeds: [embed] });
}
},
};