2022-09-26 22:25:50 +02:00

25 lines
781 B
JavaScript

const Discord = require('discord.js');
const ms = require('ms');
module.exports.run = async function(bot, message, args){
message.delete();
//if (!message.member.hasPermission("KICK_MEMBERS")) return message.channel.send("You do not have the needed permission");
let toRemove = parseInt(args[0]);
if(args[0] > 200) return message.channel.send("Invalid arguments");
setTimeout(function () {
message.channel.bulkDelete(args[0])
.then(message.channel.send(`Ich habe ${toRemove} Nachrichten gelöscht!`)
.then(msg => {
setTimeout(() => {
msg.delete();
},5000)
})
);
}, ms("500ms"));
}
module.exports.help = {
name: "clear"
}