approximateMemberCount no longer showing

Since today Discord API (via discord.js) is not returning approximateMemberCount, which has been working for 5 years just fine. We just call await this.client.guilds.fetch(id, { withCounts: true, cache: true }), but now the guild object only gives null for approximateMemberCount. Nothing on our end has changed, and the issue persists on local and production environments. Intents are as follows:
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.GuildPresences,
GatewayIntentBits.GuildIntegrations
]
})
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.GuildPresences,
GatewayIntentBits.GuildIntegrations
]
})
Also the bot is only on one server. Updating to d,js 14.24 did not resolve the issue. What might be the issue here?
8 Replies
d.js toolkit
d.js toolkit5d ago
Miksu
MiksuOP5d ago
% node -v
v20.15.1
% npm list discord.js
xx
└── discord.js@14.24.2
% node -v
v20.15.1
% npm list discord.js
xx
└── discord.js@14.24.2
d.js docs
d.js docs5d ago
:method: GuildManager#fetch() discord.js@14.24.2 Obtains one or multiple guilds from Discord, or the guild cache if it's already available.
Miksu
MiksuOP5d ago
I did have older until it broke today after years of working, but yeah, now it's upgraded too But right, I'll try checking that, one moment like 13 iirc mysterious:D client.guilds.fetch({ guild: id, withCounts: true, cache: true }) but still I'm getting guild object with approximateMemberCount: null I set cache property to false, it's still null Yes, I get all other data from the Guild object such as memberCount: 1941, Not sure why we use the approx number, maybe it's faster to fetch it vs. exact number of online users? codebase hasn't been touched for ages:D ah sorry I meant approximatePresenceCount for the online members, but it's still null Sorry for the confusion I'm not sure what that means
d.js docs
d.js docs5d ago
:property: Guild#presences discord.js@14.24.2 A manager of the presences belonging to this guild
Miksu
MiksuOP5d ago
I need a quick way to get online member count let me see alright, so that'll be the realtime data because I have that intent? that works, thanks man!
d.js toolkit
d.js toolkit5d ago
The issue has been marked as solved by support staff

Did you find this page helpful?