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:
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!5 Replies
- 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 OPbulkdelete can only delete 100 messages at a time
When I was testing this I was going for 2 messages
and how is messages defined
and todelete
Okay thank you. I feel embarrased now
messages is fetched where I've set the limit to an enormous leave now