You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using discord.js we created a bot connected to server which has over 1.2M members.
In this server we try to listen to all presence updates:
import{Client,Partials}from'discord.js';constbot=newClient({intents: 257,partials: [Partials.Channel,Partials.GuildMember,Partials.GuildScheduledEvent,Partials.Message,Partials.Reaction,Partials.ThreadMember,Partials.User,],});bot.on('presenceUpdate',handlePresenceUpdate);bot.on('raw',async(event: {t: string;d: any})=>{if(event.t==='PRESENCE_UPDATE'){awaithandlePresenceUpdateRaw();}});
@ApmMonitor('handlePresenceUpdate',0.01)// only 1% of calls is recorded via APMfunctionhandlePresenceUpdate(){}
@ApmMonitor('handlePresenceUpdateRawViaDiscordJS',0.01)// only 1% of calls is recorded via APMfunctionhandlePresenceUpdateRaw(){}
It looks like discord.js does not emit all presenceUpdate events at the beginning, even when all partials are turned on because when we start/restart the service, the amount of handlePresenceUpdateRawViaDiscordJS calls is much higher than handlePresenceUpdate calls.
For comparison see handlePresenceUpdateRawViaDiscordJS calls before/after restart:
And handlePresenceUpdate calls during the same period:
Is it possible that discord.js tries to cache some additional resource first before it emits presenceUpdate event?
Which package is this bug report for?
discord.js
Issue description
Hello and thank you for this project.
Using discord.js we created a bot connected to server which has over 1.2M members.
In this server we try to listen to all presence updates:
It looks like discord.js does not emit all
presenceUpdate
events at the beginning, even when all partials are turned on because when we start/restart the service, the amount ofhandlePresenceUpdateRawViaDiscordJS
calls is much higher thanhandlePresenceUpdate
calls.For comparison see
handlePresenceUpdateRawViaDiscordJS
calls before/after restart:And
handlePresenceUpdate
calls during the same period:Is it possible that discord.js tries to cache some additional resource first before it emits
presenceUpdate
event?Code sample
Versions
Issue priority
Medium (should be fixed soon)
Which partials do you have configured?
User, Channel, GuildMember, Message, Reaction, GuildScheduledEvent, ThreadMember
Which gateway intents are you subscribing to?
GuildPresences
I have tested this issue on a development release
No response
The text was updated successfully, but these errors were encountered: