GUILD_MEMBER_UPDATE - oldMember & newMember
Stackoverflow ( https://stackoverflow.com/questions/66175307/discord-js-guildmemberupdate-not-being-called-except-on-bot-user-changes ) is telling me guild member update event get oldMember and newMember as parameter.
DiscordJS is telling me they provide it as well. But how to access it in sapphire ?
The run() function in a listener has only the client available.
https://discord.js.org/#/docs/discord.js/main/class/Client?scrollTo=e-guildMemberUpdate
Solution:Jump to solution
Not sure. Check your intents I guess. Haven't dealt with this event in a long time. Regardless, it's more of a DJS question because sapphire literally does absolutely nothing for events. We don't for example proxy forward them or anything, we also just use client.on(...) essentially.
10 Replies
It doesn't only have client available, not sure where you got that from. The parameters match exactly with what DJS says.
For the record this is like asking:
When using
client.on(...
only client is available:
I don't see what's so hard to understand here.
The first parameter is not client
sorry if this question is stupid
so i understand first parameter is oldMember second is newMember
Yes, exactly like the djs docs tell you it is. Like I said, I have no idea where you even got the idea from that it would be client.
yea its a missunderstanding from documentation. And as i checked paramters... parameter 2 is alway: 0
https://www.sapphirejs.dev/docs/Guide/listeners/creating-your-own-listeners
The reason the example shows client is because it's the ready event and that's the only parameter the ready event receives
Solution
Not sure. Check your intents I guess. Haven't dealt with this event in a long time. Regardless, it's more of a DJS question because sapphire literally does absolutely nothing for events. We don't for example proxy forward them or anything, we also just use client.on(...) essentially.
You already helped me what to exspect from this event. Thank you very much i will proceed debugging myself.