From d81ba8356c13f42a85e98e37014bdc9c60f660d8 Mon Sep 17 00:00:00 2001 From: SpaceEEC Date: Sat, 4 Jan 2020 23:09:28 +0100 Subject: [PATCH 1/2] feat(Presence): add support for multiple activites --- src/structures/Presence.js | 7 +++---- typings/index.d.ts | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/structures/Presence.js b/src/structures/Presence.js index 2eccf7cb2dcd..616a33a235ca 100644 --- a/src/structures/Presence.js +++ b/src/structures/Presence.js @@ -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 diff --git a/typings/index.d.ts b/typings/index.d.ts index de3f707a8efb..30262327d2b9 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -1136,7 +1136,7 @@ declare module 'discord.js' { export class Presence { constructor(client: Client, data?: object); - public activity: Activity | null; + public activites: Activity[]; public clientStatus: ClientPresenceStatusData | null; public flags: Readonly; public guild: Guild | null; From caa919dec89590df39270bbe89aea1ab0ef070d8 Mon Sep 17 00:00:00 2001 From: SpaceEEC Date: Mon, 13 Jan 2020 21:26:59 +0100 Subject: [PATCH 2/2] typings(Presence): fix spelling of 'activities' Co-Authored-By: Amish Shah --- typings/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/typings/index.d.ts b/typings/index.d.ts index 30262327d2b9..dca4405bc1c2 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -1136,7 +1136,7 @@ declare module 'discord.js' { export class Presence { constructor(client: Client, data?: object); - public activites: Activity[]; + public activities: Activity[]; public clientStatus: ClientPresenceStatusData | null; public flags: Readonly; public guild: Guild | null;