What I would like to eliminate in this code is that the program only reacts to numbers, not other characters, then it says "Not an appropriate value" Can anyone help me with this?
e.g:
- User: -clearr
- Bot: How many messages do you want to delete?
- User: asd
- Bot: asd message successfully deleted!
This code:
module.exports = {
name: 'clearr',
description: "Clear messages!",
async execute(client, message, args) {
if(!args[0]) {
let filter = m => m.author.id === '365113443898097666'
message.channel.send(`How many messages do you want to delete?`).then(() => {
message.channel.awaitMessages(filter, {
max: 1,
time: 10000,
errors: ['time']
})
.then(message => {
message = message.first()
message.channel.bulkDelete(message);
message.channel.send (`\`${message} message\` successfully deleted!`)
.then(message => {
message.delete({ timeout: 5000 })
})
.catch(console.error);
})
})
}
}
}
Thank you very much in advance for your replies!