From ed866067b4bf9b537da37e62399f09612643a80b Mon Sep 17 00:00:00 2001 From: Matthew R Date: Sat, 25 Apr 2020 16:24:09 -0400 Subject: [PATCH] fixes for undefined platforms --- src/commands/whois.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/commands/whois.ts b/src/commands/whois.ts index 3c5f13f..c592a81 100644 --- a/src/commands/whois.ts +++ b/src/commands/whois.ts @@ -70,11 +70,11 @@ export default class Whois extends Command { embed.addField('Status', `${member.status[0].toUpperCase()}${member.status.slice(1)}`, true); if (member.bot) { embed.addField('Platform', 'API/WebSocket', true); - } else if (member.clientStatus.web === 'online' || member.clientStatus.web === 'idle' || member.clientStatus.web === 'dnd') { + } else if (member.clientStatus?.web === 'online' || member.clientStatus?.web === 'idle' || member.clientStatus?.web === 'dnd') { embed.addField('Platform', 'Web', true); - } else if (member.clientStatus.desktop === 'online' || member.clientStatus.desktop === 'idle' || member.clientStatus.desktop === 'dnd') { + } else if (member.clientStatus?.desktop === 'online' || member.clientStatus?.desktop === 'idle' || member.clientStatus?.desktop === 'dnd') { embed.addField('Platform', 'Desktop', true); - } else if (member.clientStatus.mobile === 'online' || member.clientStatus.mobile === 'idle' || member.clientStatus.mobile === 'dnd') { + } else if (member.clientStatus?.mobile === 'online' || member.clientStatus?.mobile === 'idle' || member.clientStatus?.mobile === 'dnd') { embed.addField('Platform', 'Mobile', true); } embed.addField('Joined At', `${moment(new Date(member.joinedAt)).format('dddd, MMMM Do YYYY, h:mm:ss A')} ET`, true);