const Discord = require("discord.js");

module.exports = {
  name: "clear",
  category: "moderation",
  description: "Deletes messages.",
  usage: "bclear <number_of_messages_to_be_deleted>",
  run: async (client, message, args) => {

  if(!message.member.hasPermission("MANAGE_MESSAGES")) return message.reply("<:Unauthorized:606722250309107713> You do not have `MANAGE MEMBERS` permission!");
  if(!args[0]) return message.channel.send("Please specify the number.");
  message.channel.bulkDelete(args[0]).then(() => {
  message.channel.send(`Cleared ${args[0]} messages.`).then(msg => msg.delete(2900));
});

}

}