Skip to content

Commit

Permalink
feat: make changes to PresenceData typings and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
iShibi committed Feb 12, 2021
1 parent ee5bc1a commit 4e961fc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
9 changes: 3 additions & 6 deletions src/structures/ClientUser.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,7 @@ class ClientUser extends Structures.get('User') {
* @typedef {Object} PresenceData
* @property {PresenceStatusData} [status] Status of the user
* @property {boolean} [afk] Whether the user is AFK
* @property {Object} [activity] Activity the user is playing
* @property {string} [activity.name] Name of the activity
* @property {ActivityType|number} [activity.type] Type of the activity
* @property {string} [activity.url] Twitch / YouTube stream URL
* @property {?number|number[]} [shardID] Shard Id(s) to have the activity set on
* @property {Array<ActivityOptions>} [activities] Activity the user is playing
*/

/**
Expand All @@ -108,7 +104,7 @@ class ClientUser extends Structures.get('User') {
* @returns {Presence}
* @example
* // Set the client user's presence
* client.user.setPresence({ activity: { name: 'with discord.js' }, status: 'idle' })
* client.user.setPresence({ activities: [{ name: 'with discord.js' }], status: 'idle' })
* .then(console.log)
* .catch(console.error);
*/
Expand Down Expand Up @@ -144,6 +140,7 @@ class ClientUser extends Structures.get('User') {
* Options for setting an activity.
* @typedef ActivityOptions
* @type {Object}
* @property {string} [name] Name of the activity
* @property {string} [url] Twitch / YouTube stream URL
* @property {ActivityType|number} [type] Type of the activity
* @property {number|number[]} [shardID] Shard Id(s) to have the activity set on
Expand Down
7 changes: 1 addition & 6 deletions typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3062,12 +3062,7 @@ declare module 'discord.js' {
interface PresenceData {
status?: PresenceStatusData;
afk?: boolean;
activity?: {
name?: string;
type?: ActivityType | number;
url?: string;
};
shardID?: number | number[];
activities?: ActivityOptions[];
}

type PresenceResolvable = Presence | UserResolvable | Snowflake;
Expand Down

0 comments on commit 4e961fc

Please sign in to comment.