hullcss-discord-bot/commands/admin/lock.js

20 lines
661 B
JavaScript
Raw Normal View History

2022-08-27 21:25:29 +01:00
const { Client, Message, Permissions } = require('discord.js');
2022-07-04 21:33:45 +01:00
module.exports = {
2022-08-27 21:25:29 +01:00
name: 'lock',
aliases: [''],
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
2022-07-04 21:33:45 +01:00
*/
2022-08-27 21:25:29 +01:00
run: async(client, message, args) => {
2022-07-04 21:33:45 +01:00
2022-08-27 21:25:29 +01:00
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});
2022-07-04 21:33:45 +01:00
2022-08-27 21:25:29 +01:00
message.channel.send("Channel has been locked.")
}
}