presenceUpdate not emitting
So basically presenceUpdate wont fire if i have user caches disabled which makes it fail to get user and not send, but now i have enabled cached and have set sweepers to clear that cache every hour so it can refill again, but for some reason, client emits events before the sweepers runs, after it runs, no more events come in? im not sure what that sweeper does but like why does it prevent cache from refilling? i wouldn't really want to have all caches full just to get user's current presence
14 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!i triple checked this
please @ me
You likely will want to enable partials for GuildMember so that events can emit for uncached entities
i tried that when i had caches disabled and it didnt do anything
ngl seems like i had them whole this time on anyway
so yeah partials dont work in this case
Partial user too?
yes
hmm, Im not sure
i mean as you can see in first image, from my understanding, if i have cache disabled or smth, then it can't add user, and then it returns on 3rd line, maybe there should be also check like
if (!user && !this.client.partials.includes(Partials.User)) return;
or at that point if that wont be added or suggested should i just listen to raw and switch op codenah I agree, thats what partials are intended for
unless your presence cache is also 0?
its not
never was
my config
after 1h (3600s), no presence events come trough
its for sure little weird behavior
ill try to play around with source code
there's certainly an issue, but the issue is not that
_add
doesn't return anything. Discord sends partial user (only id) for any presence update except going from offline
to any other, so this check fails
if (!user && data.user.username)
as data.user.username
doesn't exist resulting in user being undefined
if caching is disabled.
This should be handled differently accounting for partials yes