Code:
// Commands
if (msg.startsWith(prefix + 'purge')) {
async function purge() {
message.delete();
if (!message.member.roles.find("name", "Hasses-Bästisar")){
message.channel.send('Du behöver ha ranken hasses-bästisar för att använda purge commandot');
return;
}
if (isNaN(args[0])) {
// skickar ett meddelande i kanalen
message.channel.send('Skriv number hur många messages du vill ta bort :) \n Skriv: ' + prefix + 'purge <nummer>');
// Canclar skripten
return;
}
const fetched = await message.channel.fetchMessage({limit: args[0]});
console.log(fetched.size + ' messages found, deleting...');
// Raderar meddelanden
message.channel.bulkDelete(fetched)
.catch(error => message.channel.send('Error: ${error}'));
}
purge();
}
ERROR DOWN BELOW
Code:
Bot started
(node:3120) DeprecationWarning: Collection#find: pass a function instead
(node:3120) DeprecationWarning: Collection#find: pass a function instead
(node:3120) DeprecationWarning: Collection#find: pass a function instead
(node:3120) DeprecationWarning: Collection#find: pass a function instead
(node:3120) DeprecationWarning: Collection#find: pass a function instead
(node:3120) DeprecationWarning: Collection#find: pass a function instead
(node:3120) DeprecationWarning: Collection#find: pass a function instead
(node:3120) DeprecationWarning: Collection#find: pass a function instead
