From ee0b7c155a1767ed42e2756e53d56368e8b69929 Mon Sep 17 00:00:00 2001 From: SpaceEEC Date: Mon, 13 Jan 2020 21:28:29 +0100 Subject: [PATCH] feat(Presence): add support for multiple activities (#3661) * feat(Presence): add support for multiple activites * typings(Presence): fix spelling of 'activities' Co-Authored-By: Amish Shah Co-authored-by: Amish Shah --- 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 8c207989f..1ad6229a4 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 d4160b59c..9e64598b0 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -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; public guild: Guild | null;