From f02ff9a7bd548cad763963906793c987e35bf214 Mon Sep 17 00:00:00 2001 From: Kieran Date: Mon, 4 Jul 2022 21:33:45 +0100 Subject: [PATCH] Create lock.js --- commands/admin/lock.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 commands/admin/lock.js diff --git a/commands/admin/lock.js b/commands/admin/lock.js new file mode 100644 index 0000000..8db2ca4 --- /dev/null +++ b/commands/admin/lock.js @@ -0,0 +1,20 @@ +const { Discord, Client, Message, MessageEmbed, Permissions } = require('discord.js'); + +module.exports = { + name: 'lock', + aliases: [''], + /** + * @param {Client} client + * @param {Message} message + * @param {String[]} args + */ + run: async(client, message, args) => { + + const permission = message.member.permissions.has(Permissions.FLAGS.MANAGE_CHANNELS) + if (!permission)return message.reply({ contents: "You don't have permission to use this command" }); + + message.channel.permissionOverwrites.edit(message.guild.roles.everyone.id, {SEND_MESSAGES: false}); + + message.channel.send("Channel has been locked.") + } +} \ No newline at end of file