discord_bot/commands/moderation/lock.js

25 lines
709 B
JavaScript

const Discord = module.require("discord.js");
module.exports = {
name: "lock",
category: "moderation",
description: "Sperrt einen Kanal"
}
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,
deny : ['SEND_MESSAGES'],
},
],);
const embed = new Discord.MessageEmbed()
.setTitle("Channel Updates")
.setDescription(`🔒 ${message.channel} wurde verschlossen`)
.setColor("RANDOM");
await message.channel.send(embed);
message.delete();
}