Skip to content

Commit 0a9a3ed

Browse files
jaw0r3kkodiakhq[bot]kyranet
authoredAug 12, 2023
typings: Make activity name required (#9765)
* fix: activity name is required * chore: add suggested changes Co-authored-by: Aura Román <kyradiscord@gmail.com> --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> Co-authored-by: Aura Román <kyradiscord@gmail.com>
1 parent 346fa57 commit 0a9a3ed

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed
 

‎packages/discord.js/src/structures/ClientUser.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ class ClientUser extends User {
9898
/**
9999
* Options for setting activities
100100
* @typedef {Object} ActivitiesOptions
101-
* @property {string} [name] Name of the activity
101+
* @property {string} name Name of the activity
102102
* @property {ActivityType} [type] Type of the activity
103103
* @property {string} [url] Twitch / YouTube stream URL
104104
*/
@@ -149,15 +149,15 @@ class ClientUser extends User {
149149
/**
150150
* Options for setting an activity.
151151
* @typedef {Object} ActivityOptions
152-
* @property {string} [name] Name of the activity
152+
* @property {string} name Name of the activity
153153
* @property {string} [url] Twitch / YouTube stream URL
154154
* @property {ActivityType} [type] Type of the activity
155155
* @property {number|number[]} [shardId] Shard Id(s) to have the activity set on
156156
*/
157157

158158
/**
159159
* Sets the activity the client user is playing.
160-
* @param {string|ActivityOptions} [name] Activity being played, or options for setting the activity
160+
* @param {string|ActivityOptions} name Activity being played, or options for setting the activity
161161
* @param {ActivityOptions} [options] Options for setting the activity
162162
* @returns {ClientPresence}
163163
* @example

‎packages/discord.js/typings/index.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1044,7 +1044,7 @@ export class ClientUser extends User {
10441044
public verified: boolean;
10451045
public edit(options: ClientUserEditOptions): Promise<this>;
10461046
public setActivity(options?: ActivityOptions): ClientPresence;
1047-
public setActivity(name: string, options?: ActivityOptions): ClientPresence;
1047+
public setActivity(name: string, options?: Omit<ActivityOptions, 'name'>): ClientPresence;
10481048
public setAFK(afk?: boolean, shardId?: number | number[]): ClientPresence;
10491049
public setAvatar(avatar: BufferResolvable | Base64Resolvable | null): Promise<this>;
10501050
public setPresence(data: PresenceData): ClientPresence;
@@ -4322,7 +4322,7 @@ export interface WebhookFields extends PartialWebhookFields {
43224322
export type ActivitiesOptions = Omit<ActivityOptions, 'shardId'>;
43234323

43244324
export interface ActivityOptions {
4325-
name?: string;
4325+
name: string;
43264326
url?: string;
43274327
type?: Exclude<ActivityType, ActivityType.Custom>;
43284328
shardId?: number | readonly number[];

0 commit comments

Comments
 (0)
Please sign in to comment.