Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

typings: Make activity name required #9765

Merged
merged 3 commits into from
Aug 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/discord.js/src/structures/ClientUser.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down Expand Up @@ -149,15 +149,15 @@ 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
*/

/**
* 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
Expand Down
4 changes: 2 additions & 2 deletions packages/discord.js/typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1044,7 +1044,7 @@ export class ClientUser extends User {
public verified: boolean;
public edit(options: ClientUserEditOptions): Promise<this>;
public setActivity(options?: ActivityOptions): ClientPresence;
public setActivity(name: string, options?: ActivityOptions): ClientPresence;
public setActivity(name: string, options?: Omit<ActivityOptions, 'name'>): ClientPresence;
public setAFK(afk?: boolean, shardId?: number | number[]): ClientPresence;
public setAvatar(avatar: BufferResolvable | Base64Resolvable | null): Promise<this>;
public setPresence(data: PresenceData): ClientPresence;
Expand Down Expand Up @@ -4322,7 +4322,7 @@ export interface WebhookFields extends PartialWebhookFields {
export type ActivitiesOptions = Omit<ActivityOptions, 'shardId'>;

export interface ActivityOptions {
name?: string;
name: string;
url?: string;
type?: Exclude<ActivityType, ActivityType.Custom>;
shardId?: number | readonly number[];
Expand Down