mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 00:23:30 +01:00
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 <amishshah.2k@gmail.com> Co-authored-by: Amish Shah <amishshah.2k@gmail.com>
This commit is contained in:
@@ -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
|
||||
|
||||
2
typings/index.d.ts
vendored
2
typings/index.d.ts
vendored
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user