mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 12:03:31 +01:00
Update documentation (add missing typedefs) (#861)
This commit is contained in:
committed by
Schuyler Cebulskie
parent
c334bf4535
commit
c42e7a15aa
@@ -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.
|
* Updates the Guild with new information - e.g. a new name.
|
||||||
* @param {GuildEditData} data The data to update the guild with
|
* @param {GuildEditData} data The data to update the guild with
|
||||||
@@ -377,7 +390,7 @@ class Guild {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Edit the region of the 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<Guild>}
|
* @returns {Promise<Guild>}
|
||||||
* @example
|
* @example
|
||||||
* // edit the guild region
|
* // edit the guild region
|
||||||
@@ -391,7 +404,7 @@ class Guild {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Edit the verification level of the 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<Guild>}
|
* @returns {Promise<Guild>}
|
||||||
* @example
|
* @example
|
||||||
* // edit the guild verification level
|
* // edit the guild verification level
|
||||||
|
|||||||
@@ -163,6 +163,17 @@ class Role {
|
|||||||
return this.constructor.comparePositions(this, 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
|
* Edits the role
|
||||||
* @param {RoleData} data The new data for the role
|
* @param {RoleData} data The new data for the role
|
||||||
@@ -188,7 +199,7 @@ class Role {
|
|||||||
* .catch(console.error);
|
* .catch(console.error);
|
||||||
*/
|
*/
|
||||||
setName(name) {
|
setName(name) {
|
||||||
return this.client.rest.methods.updateGuildRole(this, { name });
|
return this.edit({ name });
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -202,7 +213,7 @@ class Role {
|
|||||||
* .catch(console.error);
|
* .catch(console.error);
|
||||||
*/
|
*/
|
||||||
setColor(color) {
|
setColor(color) {
|
||||||
return this.client.rest.methods.updateGuildRole(this, { color });
|
return this.edit({ color });
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -216,7 +227,7 @@ class Role {
|
|||||||
* .catch(console.error);
|
* .catch(console.error);
|
||||||
*/
|
*/
|
||||||
setHoist(hoist) {
|
setHoist(hoist) {
|
||||||
return this.client.rest.methods.updateGuildRole(this, { hoist });
|
return this.edit({ hoist });
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -244,7 +255,7 @@ class Role {
|
|||||||
* .catch(console.error);
|
* .catch(console.error);
|
||||||
*/
|
*/
|
||||||
setPermissions(permissions) {
|
setPermissions(permissions) {
|
||||||
return this.client.rest.methods.updateGuildRole(this, { permissions });
|
return this.edit({ permissions });
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -258,7 +269,7 @@ class Role {
|
|||||||
* .catch(console.error);
|
* .catch(console.error);
|
||||||
*/
|
*/
|
||||||
setMentionable(mentionable) {
|
setMentionable(mentionable) {
|
||||||
return this.client.rest.methods.updateGuildRole(this, { mentionable });
|
return this.edit({ mentionable });
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user