diff --git a/src/structures/ClientUser.js b/src/structures/ClientUser.js index 1d91aa2ed24a..77fc783e3e90 100644 --- a/src/structures/ClientUser.js +++ b/src/structures/ClientUser.js @@ -90,15 +90,20 @@ class ClientUser extends Structures.get('User') { return this.edit({ avatar: await DataResolver.resolveImage(avatar) }); } + /** + * Options for setting activities + * @typedef {Object} ActivitiesOptions + * @property {string} [name] Name of the activity + * @property {ActivityType|number} [type] Type of the activity + * @property {string} [url] Twitch / YouTube stream URL + */ + /** * Data resembling a raw Discord presence. * @typedef {Object} PresenceData * @property {PresenceStatusData} [status] Status of the user * @property {boolean} [afk] Whether the user is AFK - * @property {Object} [activity] Activity the user is playing - * @property {string} [activity.name] Name of the activity - * @property {ActivityType|number} [activity.type] Type of the activity - * @property {string} [activity.url] Twitch / YouTube stream URL + * @property {ActivitiesOptions[]} [activities] Activity the user is playing * @property {?number|number[]} [shardID] Shard Id(s) to have the activity set on */ @@ -108,7 +113,7 @@ class ClientUser extends Structures.get('User') { * @returns {Presence} * @example * // Set the client user's presence - * client.user.setPresence({ activity: { name: 'with discord.js' }, status: 'idle' }); + * client.user.setPresence({ activities: [{ name: 'with discord.js' }], status: 'idle' }); */ setPresence(data) { return this.client.presence.set(data); @@ -140,6 +145,7 @@ class ClientUser extends Structures.get('User') { * Options for setting an activity. * @typedef ActivityOptions * @type {Object} + * @property {string} [name] Name of the activity * @property {string} [url] Twitch / YouTube stream URL * @property {ActivityType|number} [type] Type of the activity * @property {number|number[]} [shardID] Shard Id(s) to have the activity set on diff --git a/typings/index.d.ts b/typings/index.d.ts index ea41f7e95631..2ee5349181e6 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -2168,6 +2168,8 @@ declare module 'discord.js' { type ActivityFlagsString = 'INSTANCE' | 'JOIN' | 'SPECTATE' | 'JOIN_REQUEST' | 'SYNC' | 'PLAY'; + type ActivitiesOptions = Omit; + interface ActivityOptions { name?: string; url?: string; @@ -3121,11 +3123,7 @@ declare module 'discord.js' { interface PresenceData { status?: PresenceStatusData; afk?: boolean; - activity?: { - name?: string; - type?: ActivityType | number; - url?: string; - }; + activities?: ActivitiesOptions[]; shardID?: number | number[]; }