added frankenbot
This commit is contained in:
25
bot/Plugins/Commands/clear.js
Normal file
25
bot/Plugins/Commands/clear.js
Normal file
@@ -0,0 +1,25 @@
|
||||
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"
|
||||
}
|
||||
Reference in New Issue
Block a user