docs: improve examples (master branch) (#2209)

* docs: improve examples

* more improvements


fix


maybe this


another example


collectors

* stuff
This commit is contained in:
Isabella
2018-01-03 18:12:05 -06:00
committed by Crawl
parent 61da73fee0
commit 45127bb408
7 changed files with 56 additions and 26 deletions

View File

@@ -272,8 +272,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);
*/
async edit(data, reason) {
@@ -386,6 +386,11 @@ class GuildChannel extends Channel {
* @param {boolean} [options.unique=false] Create a unique invite, or use an existing one with similar settings
* @param {string} [options.reason] Reason for creating this
* @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({ temporary = false, maxAge = 86400, maxUses = 0, unique, reason } = {}) {
return this.client.api.channels(this.id).invites.post({ data: {