docs: improve examples (#2200)

* docs: improve examples


another

* remove conflict

* some nuances

* backport
This commit is contained in:
Isabella
2018-01-03 18:14:36 -06:00
committed by Crawl
parent db5bdcd855
commit c79823002b
6 changed files with 50 additions and 16 deletions

View File

@@ -223,8 +223,8 @@ class GuildChannel extends Channel {
* @returns {Promise<GuildChannel>}
* @example
* // Edit a channel
* channel.edit({name: 'new-channel'})
* .then(c => console.log(`Edited channel ${c}`))
* channel.edit({ name: 'new-channel' })
* .then(console.log)
* .catch(console.error);
*/
edit(data, reason) {
@@ -298,6 +298,11 @@ class GuildChannel extends Channel {
* @param {boolean} [options.unique=false] Create a unique invite, or use an existing one with similar settings
* @param {string} [reason] Reason for creating the invite
* @returns {Promise<Invite>}
* @example
* // Create an invite to a channel
* channel.createInvite()
* .then(invite => console.log(`Created an invite with a code of ${invite.code}`))
* .catch(console.error);
*/
createInvite(options = {}, reason) {
return this.client.rest.methods.createChannelInvite(this, options, reason);