From a62d1e954d9e8be0a8acf3802dd4f87c367ac2a5 Mon Sep 17 00:00:00 2001 From: SpaceEEC Date: Sat, 28 Oct 2017 19:03:27 +0200 Subject: [PATCH] fix(Presence): pass client and default to offline (#2071) --- src/structures/GuildMember.js | 2 +- src/structures/Presence.js | 2 +- src/structures/User.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/structures/GuildMember.js b/src/structures/GuildMember.js index 935ba1084..8b83796cf 100644 --- a/src/structures/GuildMember.js +++ b/src/structures/GuildMember.js @@ -125,7 +125,7 @@ class GuildMember extends Base { * @readonly */ get presence() { - return this.frozenPresence || this.guild.presences.get(this.id) || new Presence(); + return this.frozenPresence || this.guild.presences.get(this.id) || new Presence(this.client); } /** diff --git a/src/structures/Presence.js b/src/structures/Presence.js index 91bee3ac3..e788124fc 100644 --- a/src/structures/Presence.js +++ b/src/structures/Presence.js @@ -19,7 +19,7 @@ class Presence { * * **`dnd`** - user is in Do Not Disturb * @type {string} */ - this.status = data.status || this.status; + this.status = data.status || this.status || 'offline'; const activity = data.game || data.activity; /** diff --git a/src/structures/User.js b/src/structures/User.js index 2a184b1d4..859cdeeb2 100644 --- a/src/structures/User.js +++ b/src/structures/User.js @@ -93,7 +93,7 @@ class User extends Base { for (const guild of this.client.guilds.values()) { if (guild.presences.has(this.id)) return guild.presences.get(this.id); } - return new Presence(); + return new Presence(this.client); } /**