2022-10-26 12:38:28 +02:00
|
|
|
const { EmbedBuilder } = require("discord.js");
|
2021-11-18 18:56:42 +01:00
|
|
|
module.exports = {
|
|
|
|
name: "unmute",
|
|
|
|
UserPerms: ["MANAGE_MESSAGES"],
|
|
|
|
BotPerms: ["MANAGE_ROLES"],
|
|
|
|
usage: "(User)",
|
|
|
|
description: "Unmute an user",
|
|
|
|
category: "Moderation",
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
type: 6,
|
|
|
|
name: "user",
|
|
|
|
description: "The user you want to unmute",
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
run: async (client, interaction, args, utils, data) => {
|
|
|
|
try {
|
|
|
|
const user = interaction.guild.members.cache.get(args[0]);
|
|
|
|
const mutedrole = interaction.guild.roles.cache.get(data.Guild.Muterole);
|
|
|
|
if (!mutedrole) {
|
|
|
|
interaction.followUp({ content: "Mute role not found in database" });
|
|
|
|
}
|
|
|
|
await user.roles.remove(mutedrole);
|
2022-10-26 12:38:28 +02:00
|
|
|
const embed = new EmbedBuilder()
|
2021-11-18 18:56:42 +01:00
|
|
|
.setTitle("User Unmuted")
|
|
|
|
.addField("**Moderator**", interaction.user.tag, true)
|
|
|
|
.addField("**User**", user.user.tag, true)
|
2022-10-26 12:38:28 +02:00
|
|
|
.setFooter({
|
|
|
|
text: `Made by ${client.author}`,
|
|
|
|
iconURL: client.user.displayAvatarURL(),
|
|
|
|
})
|
2021-11-18 18:56:42 +01:00
|
|
|
.setTimestamp()
|
|
|
|
.setThumbnail(interaction.user.displayAvatarURL({ dynamic: true }))
|
|
|
|
.setColor(client.color);
|
|
|
|
interaction.followUp({ embeds: [embed] });
|
|
|
|
} catch (e) {
|
|
|
|
console.log(e);
|
|
|
|
interaction.followUp({ content: `**Error**: ${e.message}` });
|
|
|
|
}
|
|
|
|
},
|
|
|
|
};
|