Skip to content

Commit

Permalink
feat(Presence): add support for multiple activities (#3661)
Browse files Browse the repository at this point in the history
* feat(Presence): add support for multiple activites

* typings(Presence): fix spelling of 'activities'

Co-Authored-By: Amish Shah <[email protected]>

Co-authored-by: Amish Shah <[email protected]>
  • Loading branch information
SpaceEEC and amishshah committed Jan 13, 2020
1 parent c23cc7a commit ee0b7c1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions src/structures/Presence.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,11 @@ class Presence {
*/
this.status = data.status || this.status || 'offline';

const activity = data.game || data.activity;
/**
* The activity of this presence
* @type {?Activity}
* The activities of this presence
* @type {Activity[]}
*/
this.activity = activity ? new Activity(this, activity) : null;
this.activities = data.activities ? data.activities.map(activity => new Activity(this, activity)) : [];

/**
* The devices this presence is on
Expand Down
2 changes: 1 addition & 1 deletion typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1140,7 +1140,7 @@ declare module 'discord.js' {

export class Presence {
constructor(client: Client, data?: object);
public activity: Activity | null;
public activities: Activity[];
public clientStatus: ClientPresenceStatusData | null;
public flags: Readonly<ActivityFlags>;
public guild: Guild | null;
Expand Down

0 comments on commit ee0b7c1

Please sign in to comment.