mirror of
https://github.com/danbulant/discord.js
synced 2026-05-27 22:11:53 +00:00
fix: nullable activity
This commit is contained in:
parent
e58ff642f5
commit
bd154bdd9e
1 changed files with 6 additions and 2 deletions
|
|
@ -54,12 +54,16 @@ class ClientPresenceStore extends PresenceStore {
|
|||
application_id: applicationID || undefined,
|
||||
secrets: activity.secrets || undefined,
|
||||
instance: activity.instance || undefined,
|
||||
} : this.clientPresence.activity,
|
||||
} : null,
|
||||
};
|
||||
|
||||
if ((status || afk || since) && !activity) {
|
||||
packet.game = this.clientPresence.activity;
|
||||
}
|
||||
|
||||
if (packet.game) {
|
||||
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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue