From ec9211c3ced30efa329f5ead370a91fbf9e1abd2 Mon Sep 17 00:00:00 2001 From: Lewdcario Date: Wed, 18 Apr 2018 20:21:17 -0500 Subject: [PATCH] docs: inconsistencies --- src/stores/GuildChannelStore.js | 4 ++-- src/stores/GuildMemberStore.js | 4 +++- src/structures/Invite.js | 2 +- src/structures/Role.js | 9 +++++++-- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/stores/GuildChannelStore.js b/src/stores/GuildChannelStore.js index 8521c9a9e..f629c258b 100644 --- a/src/stores/GuildChannelStore.js +++ b/src/stores/GuildChannelStore.js @@ -24,8 +24,8 @@ class GuildChannelStore extends DataStore { /** * Can be used to overwrite permissions when creating a channel. * @typedef {Object} PermissionOverwriteOptions - * @property {PermissionResolvable[]|number} [allowed] The permissions to allow - * @property {PermissionResolvable[]|number} [denied] The permissions to deny + * @property {PermissionResolvable} [allowed] The permissions to allow + * @property {PermissionResolvable} [denied] The permissions to deny * @property {RoleResolvable|UserResolvable} id ID of the role or member this overwrite is for */ diff --git a/src/stores/GuildMemberStore.js b/src/stores/GuildMemberStore.js index 1245037bf..023dc9ba8 100644 --- a/src/stores/GuildMemberStore.js +++ b/src/stores/GuildMemberStore.js @@ -80,7 +80,9 @@ class GuildMemberStore extends DataStore { * guild.members.fetch('66564597481480192') * .then(console.log) * .catch(console.error); - * guild.members.fetch({ user, cache: false }) // Fetch and don't cache + * @example + * // Fetch a single member without caching + * guild.members.fetch({ user, cache: false }) * .then(console.log) * .catch(console.error); * @example diff --git a/src/structures/Invite.js b/src/structures/Invite.js index b10c1de24..f03221972 100644 --- a/src/structures/Invite.js +++ b/src/structures/Invite.js @@ -76,7 +76,7 @@ class Invite extends Base { if (data.inviter) { /** * The user who created this invite - * @type {User} + * @type {?User} */ this.inviter = this.client.users.add(data.inviter); } diff --git a/src/structures/Role.js b/src/structures/Role.js index a8e100ef6..6767d296e 100644 --- a/src/structures/Role.js +++ b/src/structures/Role.js @@ -148,7 +148,7 @@ class Role extends Base { * @property {ColorResolvable} [color] The color of the role, either a hex string or a base 10 number * @property {boolean} [hoist] Whether or not the role should be hoisted * @property {number} [position] The position of the role - * @property {PermissionResolvable|PermissionResolvable[]} [permissions] The permissions of the role + * @property {PermissionResolvable} [permissions] The permissions of the role * @property {boolean} [mentionable] Whether or not the role should be mentionable */ @@ -252,7 +252,7 @@ class Role extends Base { /** * Sets the permissions of the role. - * @param {PermissionResolvable[]} permissions The permissions of the role + * @param {PermissionResolvable} permissions The permissions of the role * @param {string} [reason] Reason for changing the role's permissions * @returns {Promise} * @example @@ -260,6 +260,11 @@ class Role extends Base { * role.setPermissions(['KICK_MEMBERS', 'BAN_MEMBERS']) * .then(updated => console.log(`Updated permissions to ${updated.permissions.bitfield}`)) * .catch(console.error); + * @example + * // Remove all permissions from a role + * role.setPermissions(0) + * .then(updated => console.log(`Updated permissions to ${updated.permissions.bitfield}`)) + * .catch(console.error); */ setPermissions(permissions, reason) { return this.edit({ permissions }, reason);