discord_bot/commands/moderation/unlock.js

27 lines
784 B
JavaScript

const Discord = module.require("discord.js");
module.exports = {
name: "unlock",
description: "Unlocks a Channel",
usage: "unlock <channel>",
args: true,
category: "moderation",
permissions: "MANAGE_CHANNELS",
run: async(client, message, args) => {
if (!message.member.hasPermission('MANAGE_SERVER', 'MANAGE_CHANNELS')) {
return message.channel.send("Sie haben nicht genügend Berechtigungen")
}
message.channel.overwritePermissions([
{
id: message.guild.id,
null : ['SEND_MESSAGES'],
},
],);
const embed = new Discord.MessageEmbed()
.setTitle("Channel Updates")
.setDescription(`🔓 ${message.channel} has been Unlocked`)
.setColor("RANDOM");
await message.channel.send(embed);
message.delete();
}
}