Skip to content

Commit

Permalink
fix: add presence to ClientPresence from ClientOptions (#5041)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mirdukkk committed Dec 13, 2020
1 parent 9042d19 commit 9c7fe34
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/client/Client.js
Expand Up @@ -131,7 +131,7 @@ class Client extends BaseClient {
* @private
* @type {ClientPresence}
*/
this.presence = new ClientPresence(this);
this.presence = new ClientPresence(this, options.presence);

Object.defineProperty(this, 'token', { writable: true });
if (!browser && !this.token && 'DISCORD_TOKEN' in process.env) {
Expand Down
2 changes: 1 addition & 1 deletion src/structures/ClientPresence.js
Expand Up @@ -11,7 +11,7 @@ class ClientPresence extends Presence {
* @param {Object} [data={}] The data for the client presence
*/
constructor(client, data = {}) {
super(client, Object.assign(data, { status: 'online', user: { id: null } }));
super(client, Object.assign(data, { status: data.status || 'online', user: { id: null } }));
}

async set(presence) {
Expand Down
2 changes: 1 addition & 1 deletion src/structures/Presence.js
Expand Up @@ -155,7 +155,7 @@ class Activity {
* The type of the activity status
* @type {ActivityType}
*/
this.type = ActivityTypes[data.type];
this.type = ActivityTypes[data.type] || ActivityTypes[ActivityTypes.indexOf(data.type)];

/**
* If the activity is being streamed, a link to the stream
Expand Down

0 comments on commit 9c7fe34

Please sign in to comment.