TypeError: Cannot read property 'id' of undefined
at /home/user/Documents/Luna-master/Commands/Moderation/prune.js:75:95
at /home/user/Documents/Luna-master/node_modules/@discordjs/collection/dist/index.js:220:20
at Function.from ()
at Map.map (/home/user/Documents/Luna-master/node_modules/@discordjs/collection/dist/index.js:218:22)
at /home/user/Documents/Luna-master/Commands/Moderation/prune.js:75:82
at processTicksAndRejections (node:internal/process/task_queues:94:5)
at async Prune.run (/home/user/Documents/Luna-master/Commands/Moderation/prune.js:67:9)
The bot doesn't erase the amount of messages as specified.
If I tell it to delete 69 messages it only deletes 37.
Does this do anything? The error left after removing this line.
if (removed.size > 0) { this.client.db.prepare("INSERT INTO Event('Type', 'DATA') VALUES(?, ?)").run( "PRUNE", JSON.stringify({ by: message.author.id, deleted: removed.map((x) => x.id) }), ); }
TypeError: Cannot read property 'id' of undefined at /home/user/Documents/Luna-master/Commands/Moderation/prune.js:75:95 at /home/user/Documents/Luna-master/node_modules/@discordjs/collection/dist/index.js:220:20 at Function.from ()
at Map.map (/home/user/Documents/Luna-master/node_modules/@discordjs/collection/dist/index.js:218:22)
at /home/user/Documents/Luna-master/Commands/Moderation/prune.js:75:82
at processTicksAndRejections (node:internal/process/task_queues:94:5)
at async Prune.run (/home/user/Documents/Luna-master/Commands/Moderation/prune.js:67:9)
The bot doesn't erase the amount of messages as specified. If I tell it to delete 69 messages it only deletes 37.