Discord.js: How read users status with a bot on server?

I wrote a little bot and need the status(Online,Offline,Idle) of all users on the server. I found https://discord.js.org/#/docs/main/master/class/Client?scrollTo=users

bot.on('ready', function() { console.log(bot.users); });

This show all users with:

'352....128': User { username: 'NAME', id: '352....128', discriminator: '5000' avatar: null, bot: false },

So there is no status. The Bot have no access for this? In embed.js I can read the status of all online and idle users (offline users are not listed): https://discordapp.com/api/guilds/SERVERID/embed.json

{"username": "NAME", "status": "online", "nick": "NICK", "avatar_url": "...", "avatar": "...", "discriminator": "5000", "id": "..."}

Is embed.json the only way to get the status of all online and idle users? So I need to install this package? https://www.npmjs.com/package/jsonfile and read this file?

Answer

You can find it here: https://discord.js.org/#/docs/main/stable/typedef/PresenceStatus

You can either use:

user.presence.status

or:

member.user.presence.status

It’s returns “online”, “idle”, “dnd” or “offline”