bulkDelete erroring: invalid int value

Hey everyone, I hope you're doing well. I'm currently facing an issue with the channel.bulkDelete() function in Discord.js, and I could really use some assistance. I'm attempting to use bulkDelete to delete messages stored in the toDelete variable. The toDelete variable is of type Collection<string, Message<true>>, and as per the documentation and a quick check in the Discord.js codebase (screenshot attached), this is an accepted type for the bulkDelete function. However, when I run the code, I encounter the following error:
DiscordAPIError[50035]: Invalid Form Body
limit[NUMBER_TYPE_MAX]: int value should be less than or equal to 100.
DiscordAPIError[50035]: Invalid Form Body
limit[NUMBER_TYPE_MAX]: int value should be less than or equal to 100.
It seems to be expecting a numerical limit less than or equal to 100, even though passing a collection of messages should also be a valid option according to the documentation. Has anyone else faced a similar issue? If so, could you share how you resolved it? Any insights or solutions would be greatly appreciated! Thanks in advance!
No description
5 Replies
d.js toolkit
d.js toolkit13mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by OP
treble/luna
treble/luna13mo ago
bulkdelete can only delete 100 messages at a time
blame
blameOP13mo ago
When I was testing this I was going for 2 messages
treble/luna
treble/luna13mo ago
and how is messages defined and todelete
blame
blameOP13mo ago
Okay thank you. I feel embarrased now messages is fetched where I've set the limit to an enormous facepalm leave now
Want results from more Discord servers?
Add your server