Skip to content

Commit

Permalink
feat(ClientPresence): allow setting activity state
Browse files Browse the repository at this point in the history
  • Loading branch information
advaith1 authored and Jiralite committed Aug 12, 2023
1 parent 0a9a3ed commit 8d36759
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/discord.js/src/structures/ClientPresence.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class ClientPresence extends Presence {
data.activities.push({
type: activity.type,
name: activity.name,
state: activity.state,
url: activity.url,
});
}
Expand Down
2 changes: 2 additions & 0 deletions packages/discord.js/src/structures/ClientUser.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion packages/discord.js/typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4323,8 +4323,9 @@ export type ActivitiesOptions = Omit<ActivityOptions, 'shardId'>;

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

Expand Down

0 comments on commit 8d36759

Please sign in to comment.