discord.js-pagination icon indicating copy to clipboard operation
discord.js-pagination copied to clipboard

Changed reaction remove to not look at the .users object of the reaction

Open asynch8 opened this issue 3 years ago • 3 comments

Issue: Crash when trying to remove emojis in the emoji collector. Discord-js version: 11.6.4 Errors: TypeError: reaction.users.remove is not a function at ReactionCollector.<anonymous> (\node_modules\discord.js-pagination\index.js:14:19) TypeError: curPage.reactions.removeAll is not a function at ReactionCollector.<anonymous> (\node_modules\discord.js-pagination\index.js:28:22) ` I was having an issue with the pagination crashing whenever someone reacted to a message, and when the collector ends. This is due to the helper functions being used probably have been added in later discord.js versions. This PR fixes the issue by instead relying on a function that is part of the base class of the reacts. Only tested in v11.6.4

asynch8 avatar Aug 09 '21 09:08 asynch8

I was having an issue with the pagination crashing whenever someone reacted to a message([email protected]). This PR fixes the issue. Only tested in v11.6.4

What was the error being thown? What troubleshooting steps did you perform? Did you check the documentation differences between what it's built on (v12 - deprecated) and what you're using (v11 - deprecated)?

What is your logic that connects this fix to a solution to the error you were getting?

Just because something works does not mean it's a fix or the proper (or even a correct) solution. Some times things work by chance or by coincidence - I'm just putting this out there so others don't follow suit in terms of approach. Not sayings it's right or wrong, just that when you make a PR for something, you should be including more detail and rationale.

However, discord.js v12 is already deprecated, v11 was deprecated quite a while ago and at some point it may stop working as the discord API itself gets updated.

I would highly recommend updating your code to discord.js v13. Happy to help.

psibean avatar Aug 10 '21 14:08 psibean

just that when you make a PR for something, you should be including more detail and rationale.

Yes, true, I should've been more descriptive. That's my bad, I patched for my own sake and didn't put much thought into the PR. I updated my main post with more details

I'm using an earlier version for reasons, but yes, thanks for the hint!

asynch8 avatar Aug 11 '21 10:08 asynch8

just that when you make a PR for something, you should be including more detail and rationale.

Yes, true, I should've been more descriptive. That's my bad, I patched for my own sake and didn't put much thought into the PR. I updated my main post with more details

I'm using an earlier version for reasons, but yes, thanks for the hint!

Sorry if I came across as harsh! Best of luck. If you ever do need help updating, feel free to reach out!

psibean avatar Aug 11 '21 10:08 psibean