discord.js存在状态离线问题


client.on('message', message => {
let onlineCount = 0;
const guild = client.guilds.cache.get("538745138047090708");
guild.members.cache.find(member => {
if (member.presence.status == "online"){
onlineCount += 1
}
})
message.channel.send(`Online Players In Server: ${onlineCount}`)};

正如您在图片中看到的,机器人说服务器中的在线玩家是0,但事实并非如此。服务器上有太多在线内容,但我不知道如何修复

点击获取图像

由于我的声誉很低,我不能对你的问题发表评论。自10月27日起不和机器人需要启用存在意图。你可以在applications>BotName>Bot下找到

如果您无法通过按钮启用它,您需要联系不和支持团队。这是文章

最新更新