From 9192d6f37a979624ece84039bb137d53dbe07c73 Mon Sep 17 00:00:00 2001 From: Jaw0r3k Date: Fri, 11 Aug 2023 21:07:29 +0200 Subject: [PATCH 1/2] fix: activity name is required --- packages/discord.js/typings/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/discord.js/typings/index.d.ts b/packages/discord.js/typings/index.d.ts index d6f3b27d6481..fd49dad7367e 100644 --- a/packages/discord.js/typings/index.d.ts +++ b/packages/discord.js/typings/index.d.ts @@ -1044,7 +1044,7 @@ export class ClientUser extends User { public verified: boolean; public edit(options: ClientUserEditOptions): Promise; public setActivity(options?: ActivityOptions): ClientPresence; - public setActivity(name: string, options?: ActivityOptions): ClientPresence; + public setActivity(name: string, options?: Omit): ClientPresence; public setAFK(afk?: boolean, shardId?: number | number[]): ClientPresence; public setAvatar(avatar: BufferResolvable | Base64Resolvable | null): Promise; public setPresence(data: PresenceData): ClientPresence; @@ -4322,7 +4322,7 @@ export interface WebhookFields extends PartialWebhookFields { export type ActivitiesOptions = Omit; export interface ActivityOptions { - name?: string; + name: string; url?: string; type?: Exclude; shardId?: number | readonly number[]; From d8d795d1b45268618c0b4a4ba2adacabe23423f1 Mon Sep 17 00:00:00 2001 From: Jaw0r3k Date: Sat, 12 Aug 2023 13:06:33 +0200 Subject: [PATCH 2/2] chore: add suggested changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Aura Román --- packages/discord.js/src/structures/ClientUser.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/discord.js/src/structures/ClientUser.js b/packages/discord.js/src/structures/ClientUser.js index 040e732910c2..3e1a2b10ef92 100644 --- a/packages/discord.js/src/structures/ClientUser.js +++ b/packages/discord.js/src/structures/ClientUser.js @@ -98,7 +98,7 @@ class ClientUser extends User { /** * Options for setting activities * @typedef {Object} ActivitiesOptions - * @property {string} [name] Name of the activity + * @property {string} name Name of the activity * @property {ActivityType} [type] Type of the activity * @property {string} [url] Twitch / YouTube stream URL */ @@ -149,7 +149,7 @@ class ClientUser extends User { /** * Options for setting an activity. * @typedef {Object} ActivityOptions - * @property {string} [name] Name of the activity + * @property {string} name Name 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 @@ -157,7 +157,7 @@ class ClientUser extends User { /** * Sets the activity the client user is playing. - * @param {string|ActivityOptions} [name] Activity being played, or options for setting the activity + * @param {string|ActivityOptions} name Activity being played, or options for setting the activity * @param {ActivityOptions} [options] Options for setting the activity * @returns {ClientPresence} * @example