Answer the question
In order to leave comments, you need to log in
What is wrong with these lines?
const messageArray = message.content.split(' ');
const args = messageArray.slice(1);
robot.on("message", message => {
if (!message.member.permissions.has("MANAGE_MESSAGES")) return message.channel.send('Lack of Perms!');
let deleteAmount;
if (isNaN(args[0]) || parseInt(args[0]) <= 0) { return message.reply('Please put a number only!') }
if (parseInt(args[0]) > 100) {
return message.reply('You can only delete 100 messages at a time!')
} else {
deleteAmount = parseInt(args[0]);
}
message.channel.bulkDelete(deleteAmount + 1, true);
message.reply(`**Successfully** Deleted ***${deleteAmount}*** Messages.`)
})
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question