docs(ClientUser): #setPresence does not return a promise (#5485)

This commit is contained in:
Souji
2021-04-05 23:26:28 +02:00
committed by GitHub
parent 2b52cdc915
commit 599f0f5cef

View File

@@ -108,9 +108,7 @@ class ClientUser extends Structures.get('User') {
* @returns {Presence} * @returns {Presence}
* @example * @example
* // Set the client user's presence * // Set the client user's presence
* client.user.setPresence({ activity: { name: 'with discord.js' }, status: 'idle' }) * client.user.setPresence({ activity: { name: 'with discord.js' }, status: 'idle' });
* .then(console.log)
* .catch(console.error);
*/ */
setPresence(data) { setPresence(data) {
return this.client.presence.set(data); return this.client.presence.set(data);
@@ -132,9 +130,7 @@ class ClientUser extends Structures.get('User') {
* @returns {Presence} * @returns {Presence}
* @example * @example
* // Set the client user's status * // Set the client user's status
* client.user.setStatus('idle') * client.user.setStatus('idle');
* .then(console.log)
* .catch(console.error);
*/ */
setStatus(status, shardID) { setStatus(status, shardID) {
return this.setPresence({ status, shardID }); return this.setPresence({ status, shardID });
@@ -156,9 +152,7 @@ class ClientUser extends Structures.get('User') {
* @returns {Presence} * @returns {Presence}
* @example * @example
* // Set the client user's activity * // Set the client user's activity
* client.user.setActivity('discord.js', { type: 'WATCHING' }) * client.user.setActivity('discord.js', { type: 'WATCHING' });
* .then(presence => console.log(`Activity set to ${presence.activities[0].name}`))
* .catch(console.error);
*/ */
setActivity(name, options = {}) { setActivity(name, options = {}) {
if (!name) return this.setPresence({ activities: null, shardID: options.shardID }); if (!name) return this.setPresence({ activities: null, shardID: options.shardID });