Update setStatus docs for DND, other docs - setStatus code needs updating

This commit is contained in:
Schuyler Cebulskie
2016-09-26 23:16:29 -04:00
parent 9ebe5e64b7
commit ecbc591c95

View File

@@ -37,7 +37,7 @@ class ClientUser extends User {
* // set username * // set username
* client.user.setUsername('discordjs') * client.user.setUsername('discordjs')
* .then(user => console.log(`My new username is ${user.username}`)) * .then(user => console.log(`My new username is ${user.username}`))
* .catch(console.log); * .catch(console.error);
*/ */
setUsername(username) { setUsername(username) {
return this.client.rest.methods.updateCurrentUser({ username }); return this.client.rest.methods.updateCurrentUser({ username });
@@ -52,7 +52,7 @@ class ClientUser extends User {
* // set email * // set email
* client.user.setEmail('bob@gmail.com') * client.user.setEmail('bob@gmail.com')
* .then(user => console.log(`My new email is ${user.email}`)) * .then(user => console.log(`My new email is ${user.email}`))
* .catch(console.log); * .catch(console.error);
*/ */
setEmail(email) { setEmail(email) {
return this.client.rest.methods.updateCurrentUser({ email }); return this.client.rest.methods.updateCurrentUser({ email });
@@ -65,9 +65,9 @@ class ClientUser extends User {
* @returns {Promise<ClientUser>} * @returns {Promise<ClientUser>}
* @example * @example
* // set password * // set password
* client.user.setPassword('password') * client.user.setPassword('password123')
* .then(user => console.log('New password set!')) * .then(user => console.log('New password set!'))
* .catch(console.log); * .catch(console.error);
*/ */
setPassword(password) { setPassword(password) {
return this.client.rest.methods.updateCurrentUser({ password }); return this.client.rest.methods.updateCurrentUser({ password });
@@ -81,7 +81,7 @@ class ClientUser extends User {
* // set avatar * // set avatar
* client.user.setAvatar(fs.readFileSync('./avatar.png')) * client.user.setAvatar(fs.readFileSync('./avatar.png'))
* .then(user => console.log(`New avatar set!`)) * .then(user => console.log(`New avatar set!`))
* .catch(console.log); * .catch(console.error);
*/ */
setAvatar(avatar) { setAvatar(avatar) {
return this.client.rest.methods.updateCurrentUser({ avatar }); return this.client.rest.methods.updateCurrentUser({ avatar });
@@ -89,16 +89,21 @@ class ClientUser extends User {
/** /**
* Set the status and playing game of the logged in client. * Set the status and playing game of the logged in client.
* @param {string} [status] The status, can be `online` or `idle` * @param {string} [status] The status, can be `online`, `idle`, or `dnd`
* @param {string|Object} [game] The game that is being played * @param {string|Object} [game] The game that is being played
* @param {string} [url] If you want to display as streaming, set this as the URL to the stream (must be a * @param {string} [url] If you want to display as streaming, set this as the URL to the stream (must be a
* twitch.tv URl) * twitch.tv URl)
* @returns {Promise<ClientUser>} * @returns {Promise<ClientUser>}
* @example * @example
* // set status * // set status
* client.user.setStatus('status', 'game') * client.user.setStatus('dnd')
* .then(user => console.log('Changed status!')) * .then(user => console.log('Changed status!'))
* .catch(console.log); * .catch(console.error);
* @example
* // set game
* client.user.setStatus(null, 'Cool Game 2042')
* .then(user => console.log('Changed game!'))
* .catch(console.error);
*/ */
setStatus(status, game = null, url = null) { setStatus(status, game = null, url = null) {
return new Promise(resolve => { return new Promise(resolve => {