From 4e961fcdcff1341a8894b5b73b96cab537cfdc7c Mon Sep 17 00:00:00 2001 From: Shubham Parihar Date: Fri, 12 Feb 2021 14:55:49 +0530 Subject: [PATCH] feat: make changes to PresenceData typings and docs --- src/structures/ClientUser.js | 9 +++------ typings/index.d.ts | 7 +------ 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/src/structures/ClientUser.js b/src/structures/ClientUser.js index 33b4be56daf9..c38c9922590f 100644 --- a/src/structures/ClientUser.js +++ b/src/structures/ClientUser.js @@ -95,11 +95,7 @@ class ClientUser extends Structures.get('User') { * @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 {?number|number[]} [shardID] Shard Id(s) to have the activity set on + * @property {Array} [activities] Activity the user is playing */ /** @@ -108,7 +104,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' }) * .then(console.log) * .catch(console.error); */ @@ -144,6 +140,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 5f6874f37407..dfb13af43d93 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -3062,12 +3062,7 @@ declare module 'discord.js' { interface PresenceData { status?: PresenceStatusData; afk?: boolean; - activity?: { - name?: string; - type?: ActivityType | number; - url?: string; - }; - shardID?: number | number[]; + activities?: ActivityOptions[]; } type PresenceResolvable = Presence | UserResolvable | Snowflake;