discord.js purge
case 'clear':
if(!args[1]) return message.reply ('Error, please define second argument')
message.channel.bulkDelete(args[1]);
discord.js purge
case 'clear':
if(!args[1]) return message.reply ('Error, please define second argument')
message.channel.bulkDelete(args[1]);
how to make a purge command discord.js
var amount = parseInt(args[0])
if (!amount) return message.channel.send("Please specify the amount of messages you want me to delete")
if (amount > 100 || amount < 1) return message.channel.send("Please select a number *between* 100 and 1")
message.channel.bulkDelete(amount).catch(err => {
message.channel.send(':x: Due to Discord Limitations, I cannot delete messages older than 14 days') })
let msg = await message.channel.send(`Deleted \`${amount}\` messages`)
setTimeout(() => {
msg.delete()
}, 2000)
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us