types(ClientPresence): add type declarations and docs (#6450)

This commit is contained in:
Rodry
2021-08-17 21:49:36 +01:00
committed by GitHub
parent 76cf52cd0d
commit 6cac03a394
3 changed files with 35 additions and 11 deletions

View File

@@ -33,8 +33,8 @@ class ClientUser extends User {
}
/**
* ClientUser's presence
* @type {Presence}
* Represents the client user's presence
* @type {ClientPresence}
* @readonly
*/
get presence() {
@@ -109,7 +109,7 @@ class ClientUser extends User {
/**
* Sets the full presence of the client user.
* @param {PresenceData} data Data for the presence
* @returns {Presence}
* @returns {ClientPresence}
* @example
* // Set the client user's presence
* client.user.setPresence({ activities: [{ name: 'with discord.js' }], status: 'idle' });
@@ -131,7 +131,7 @@ class ClientUser extends User {
* Sets the status of the client user.
* @param {PresenceStatusData} status Status to change to
* @param {number|number[]} [shardId] Shard id(s) to have the activity set on
* @returns {Presence}
* @returns {ClientPresence}
* @example
* // Set the client user's status
* client.user.setStatus('idle');
@@ -153,7 +153,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 {ActivityOptions} [options] Options for setting the activity
* @returns {Presence}
* @returns {ClientPresence}
* @example
* // Set the client user's activity
* client.user.setActivity('discord.js', { type: 'WATCHING' });
@@ -169,7 +169,7 @@ class ClientUser extends User {
* Sets/removes the AFK flag for the client user.
* @param {boolean} afk Whether or not the user is AFK
* @param {number|number[]} [shardId] Shard Id(s) to have the AFK flag set on
* @returns {Presence}
* @returns {ClientPresence}
*/
setAFK(afk, shardId) {
return this.setPresence({ afk, shardId });