mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 16:43:31 +01:00
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>
This commit is contained in:
@@ -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
|
||||
|
||||
4
packages/discord.js/typings/index.d.ts
vendored
4
packages/discord.js/typings/index.d.ts
vendored
@@ -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;
|
||||
@@ -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[];
|
||||
|
||||
Reference in New Issue
Block a user