mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 08:33:30 +01:00
feat(Activity): add missing fields (#4984)
Co-authored-by: Jan <66554238+Vaporox@users.noreply.github.com>
This commit is contained in:
@@ -138,6 +138,14 @@ class Presence {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The platform of this activity:
|
||||
* * **`desktop`**
|
||||
* * **`samsung`** - playing on Samsung Galaxy
|
||||
* * **`xbox`** - playing on Xbox Live
|
||||
* @typedef {string} ActivityPlatform
|
||||
*/
|
||||
|
||||
/**
|
||||
* Represents an activity that is part of a user's presence.
|
||||
*/
|
||||
@@ -146,7 +154,13 @@ class Activity {
|
||||
Object.defineProperty(this, 'presence', { value: presence });
|
||||
|
||||
/**
|
||||
* The name of the activity being played
|
||||
* The ID of the activity
|
||||
* @type {string}
|
||||
*/
|
||||
this.id = data.id;
|
||||
|
||||
/**
|
||||
* The name of the activity
|
||||
* @type {string}
|
||||
*/
|
||||
this.name = data.name;
|
||||
@@ -194,6 +208,18 @@ class Activity {
|
||||
}
|
||||
: null;
|
||||
|
||||
/**
|
||||
* The ID of the song on Spotify
|
||||
* @type {?string}
|
||||
*/
|
||||
this.syncID = data.sync_id ?? null;
|
||||
|
||||
/**
|
||||
* The platform the game is being played on
|
||||
* @type {?ActivityPlatform}
|
||||
*/
|
||||
this.platform = data.platform ?? null;
|
||||
|
||||
/**
|
||||
* Party of the activity
|
||||
* @type {?Object}
|
||||
@@ -222,6 +248,18 @@ class Activity {
|
||||
*/
|
||||
this.emoji = data.emoji ? new Emoji(presence.client, data.emoji) : null;
|
||||
|
||||
/**
|
||||
* The ID of the game or Spotify session
|
||||
* @type {?string}
|
||||
*/
|
||||
this.sessionID = data.session_id ?? null;
|
||||
|
||||
/**
|
||||
* The labels of the buttons of this rich presence
|
||||
* @type {string[]}
|
||||
*/
|
||||
this.buttons = data.buttons ?? [];
|
||||
|
||||
/**
|
||||
* Creation date of the activity
|
||||
* @type {number}
|
||||
|
||||
Reference in New Issue
Block a user