I have a user command and I implemented a field that shows the users status, dnd, idle and online works fine and if the user appears offline it works fine but if the user is actually offline it gives the error cannot read properties of null (reading 'status')
Code:
const statusTypes = {
online: '<:online:313956277808005120> Online',
idle: '<:away:313956277220802560> Idle',
dnd: '<:dnd:313956276893646850> Do Not Disturb',
offline: '<:offline:313956277237710868> Offline'
};
// embed field
{
name: 'Status',
value: `${statusTypes[member.presence.status]}`,
inline: true
},