From 8d36759b6d2ac133a3fe00bcfa723db8de86c038 Mon Sep 17 00:00:00 2001 From: advaith Date: Mon, 31 Jul 2023 21:37:06 -0700 Subject: [PATCH] feat(ClientPresence): allow setting activity state --- packages/discord.js/src/structures/ClientPresence.js | 1 + packages/discord.js/src/structures/ClientUser.js | 2 ++ packages/discord.js/typings/index.d.ts | 3 ++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/discord.js/src/structures/ClientPresence.js b/packages/discord.js/src/structures/ClientPresence.js index 5b448d78643b..05be4b8b6438 100644 --- a/packages/discord.js/src/structures/ClientPresence.js +++ b/packages/discord.js/src/structures/ClientPresence.js @@ -56,6 +56,7 @@ class ClientPresence extends Presence { data.activities.push({ type: activity.type, name: activity.name, + state: activity.state, url: activity.url, }); } diff --git a/packages/discord.js/src/structures/ClientUser.js b/packages/discord.js/src/structures/ClientUser.js index 3e1a2b10ef92..b93904cf48d4 100644 --- a/packages/discord.js/src/structures/ClientUser.js +++ b/packages/discord.js/src/structures/ClientUser.js @@ -99,6 +99,7 @@ class ClientUser extends User { * Options for setting activities * @typedef {Object} ActivitiesOptions * @property {string} name Name of the activity + * @property {string} [state] State of the activity * @property {ActivityType} [type] Type of the activity * @property {string} [url] Twitch / YouTube stream URL */ @@ -150,6 +151,7 @@ class ClientUser extends User { * Options for setting an activity. * @typedef {Object} ActivityOptions * @property {string} name Name of the activity + * @property {string} [state] State of the activity * @property {string} [url] Twitch / YouTube stream URL * @property {ActivityType} [type] Type of the activity * @property {number|number[]} [shardId] Shard Id(s) to have the activity set on diff --git a/packages/discord.js/typings/index.d.ts b/packages/discord.js/typings/index.d.ts index 9b13c11eb558..169aa439c25a 100644 --- a/packages/discord.js/typings/index.d.ts +++ b/packages/discord.js/typings/index.d.ts @@ -4323,8 +4323,9 @@ export type ActivitiesOptions = Omit; export interface ActivityOptions { name: string; + state?: string; url?: string; - type?: Exclude; + type?: ActivityType; shardId?: number | readonly number[]; }