fix: nullable activity

This commit is contained in:
Lewdcario
2018-01-25 02:06:28 -06:00
parent e58ff642f5
commit bd154bdd9e

View File

@@ -54,12 +54,16 @@ class ClientPresenceStore extends PresenceStore {
application_id: applicationID || undefined, application_id: applicationID || undefined,
secrets: activity.secrets || undefined, secrets: activity.secrets || undefined,
instance: activity.instance || undefined, instance: activity.instance || undefined,
} : this.clientPresence.activity, } : null,
}; };
if ((status || afk || since) && !activity) {
packet.game = this.clientPresence.activity;
}
if (packet.game) { if (packet.game) {
packet.game.type = typeof packet.game.type === 'number' ? packet.game.type = typeof packet.game.type === 'number' ?
packet.game.type : ActivityTypes.indexOf(packet.game.type) packet.game.type : ActivityTypes.indexOf(packet.game.type);
} }
this.clientPresence.patch(packet); this.clientPresence.patch(packet);