Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

asynch8
Copy link

@asynch8 asynch8 commented Aug 9, 2021

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

@psibean
Copy link

psibean commented Aug 10, 2021

I was having an issue with the pagination crashing whenever someone reacted to a message(discord.js@11.6.4). 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.

@asynch8
Copy link
Author

asynch8 commented Aug 11, 2021

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!

@psibean
Copy link

psibean commented Aug 11, 2021

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants