diff --git a/src/structures/Guild.js b/src/structures/Guild.js index e78c204e0..f581daecd 100644 --- a/src/structures/Guild.js +++ b/src/structures/Guild.js @@ -344,6 +344,19 @@ class Guild { }); } + /** + * The data for editing a guild + * @typedef {Object} GuildEditData + * @property {string} name The name of the guild + * @property {string} region The region of the guild + * @property {number} verificationLevel The verification level of the guild + * @property {GuildChannelResolvable} afkChannel The AFK channel of the guild + * @property {number} afkTimeout The AFK timeout of the guild + * @property {Base64Resolvable} icon The icon of the guild + * @property {GuildMemberResolvable} owner The owner of the guild + * @property {Base64Resolvable} splash The splash screen of the guild + */ + /** * Updates the Guild with new information - e.g. a new name. * @param {GuildEditData} data The data to update the guild with @@ -377,7 +390,7 @@ class Guild { /** * Edit the region of the Guild. - * @param {Region} region The new region of the guild. + * @param {string} region The new region of the guild. * @returns {Promise} * @example * // edit the guild region @@ -391,7 +404,7 @@ class Guild { /** * Edit the verification level of the Guild. - * @param {VerificationLevel} verificationLevel The new verification level of the guild + * @param {number} verificationLevel The new verification level of the guild * @returns {Promise} * @example * // edit the guild verification level diff --git a/src/structures/Role.js b/src/structures/Role.js index 4bbb6c55b..122183f46 100644 --- a/src/structures/Role.js +++ b/src/structures/Role.js @@ -163,6 +163,17 @@ class Role { return this.constructor.comparePositions(this, role); } + /** + * The data for a role + * @typedef {Object} RoleData + * @property {string} name The name of the role + * @property {number|string} 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 {string[]} permissions The permissions of the role + * @property {boolean} mentionable Whether or not the role should be mentionable + */ + /** * Edits the role * @param {RoleData} data The new data for the role @@ -188,7 +199,7 @@ class Role { * .catch(console.error); */ setName(name) { - return this.client.rest.methods.updateGuildRole(this, { name }); + return this.edit({ name }); } /** @@ -202,7 +213,7 @@ class Role { * .catch(console.error); */ setColor(color) { - return this.client.rest.methods.updateGuildRole(this, { color }); + return this.edit({ color }); } /** @@ -216,7 +227,7 @@ class Role { * .catch(console.error); */ setHoist(hoist) { - return this.client.rest.methods.updateGuildRole(this, { hoist }); + return this.edit({ hoist }); } /** @@ -244,7 +255,7 @@ class Role { * .catch(console.error); */ setPermissions(permissions) { - return this.client.rest.methods.updateGuildRole(this, { permissions }); + return this.edit({ permissions }); } /** @@ -258,7 +269,7 @@ class Role { * .catch(console.error); */ setMentionable(mentionable) { - return this.client.rest.methods.updateGuildRole(this, { mentionable }); + return this.edit({ mentionable }); } /**