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

fix(userUpdate): Uncached users throwing undefined #1366

Merged
merged 2 commits into from
May 10, 2022

Conversation

Dramex
Copy link
Contributor

@Dramex Dramex commented Apr 27, 2022

when you update the bot username or avatar or discriminator it fires an undefined on the userUpdate event.

when you update the bot username or avatar or discriminator it fires an undefined on the userUpdate event.
@bsian03 bsian03 added the bug label May 9, 2022
@bsian03 bsian03 changed the title fix updating bot username, avatar, discriminator returns undefined fix(userUpdate): Uncached users not being inserted into cache May 9, 2022
bsian03
bsian03 previously approved these changes May 9, 2022
Copy link
Collaborator

@bsian03 bsian03 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not merging yet

@bsian03 bsian03 changed the title fix(userUpdate): Uncached users not being inserted into cache fix(userUpdate): Uncached users throwing undefined May 10, 2022
@bsian03 bsian03 merged commit c223725 into abalabahaha:dev May 10, 2022
@Dramex
Copy link
Contributor Author

Dramex commented May 10, 2022

@bsian03 The old logic should be fine btw because USER_UPDATE fires only with the current user update ( the bot ) in our case which should always be cached on ready

the cache was fine, the issue was user.update() does not return anything, and its actually not being used outside so I used client.users.update() instead

update(data) {

the event userUpdate on eris is used when members get updated too. which different than discord USER_UPDATE

^ just to clerify

@bsian03
Copy link
Collaborator

bsian03 commented May 10, 2022

That was my brain freaking out that the thing would've been breaking (didn't clock it would be only the bot earlier, but did last night), hence the change. Also you missed out the client param in the update.

Oh well, doesn't hurt to have a fallback. Who knows, discord might change something 🤷

DonovanDMC added a commit to DonovanArchive/ErisPRUpdateBot that referenced this pull request May 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants