Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix(ClientPresence): correctly set activity state on CUSTOM activity …
…type (#9954)

* fix(ClientPresence): correctly set activity state on CUSTOM activity type

* Update ClientPresence.js
  • Loading branch information
vladfrangu committed Nov 12, 2023
1 parent 07caef4 commit f475336
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/structures/ClientPresence.js
Expand Up @@ -4,6 +4,8 @@ const { Presence } = require('./Presence');
const { TypeError } = require('../errors');
const { ActivityTypes, Opcodes } = require('../util/Constants');

const CustomStatusActivityTypes = [ActivityTypes.CUSTOM, ActivityTypes[ActivityTypes.CUSTOM]];

/**
* Represents the client's presence.
* @extends {Presence}
Expand Down Expand Up @@ -52,7 +54,7 @@ class ClientPresence extends Presence {

activity.type ??= ActivityTypes.PLAYING;

if (activity.type === ActivityTypes.CUSTOM && !activity.state) {
if (CustomStatusActivityTypes.includes(activity.type) && !activity.state) {
activity.state = activity.name;
activity.name = 'Custom Status';
}
Expand Down

0 comments on commit f475336

Please sign in to comment.