RoleShorter
Signature
export declare class RoleShorter extends BaseShorterProperties
0No properties.
Methods
10Methods
create(guildId: string, body: RESTPostAPIGuildRoleJSONBody, reason?: string): Promise<GuildRoleStructure>;Creates a new role in the guild.
guildId- The ID of the guild.
body- The data for creating the role.
reason- The reason for creating the role.
A Promise that resolves when the role is created.
fetch(guildId: string, roleId: string, force?: boolean): Promise<GuildRoleStructure>;raw(guildId: string, roleId: string, force?: boolean): Promise<APIRole>;list(guildId: string, force?: boolean): Promise<GuildRoleStructure[]>;Retrieves a list of roles in the guild.
guildId- The ID of the guild.
force- Whether to force fetching roles from the API even if they exist in the cache.
A Promise that resolves to an array of roles.
listRaw(guildId: string, force?: boolean): Promise<APIRole[]>;edit(guildId: string, roleId: string, body: RESTPatchAPIGuildRoleJSONBody, reason?: string): Promise<GuildRoleStructure>;Edits a role in the guild.
guildId- The ID of the guild.
roleId- The ID of the role to edit.
body- The data to update the role with.
reason- The reason for editing the role.
A Promise that resolves when the role is edited.
delete(guildId: string, roleId: string, reason?: string): Promise<void>;Deletes a role from the guild.
guildId- The ID of the guild.
roleId- The ID of the role to delete.
reason- The reason for deleting the role.
A Promise that resolves when the role is deleted.
memberCounts(guildId: string): Promise<RESTGetAPIGuildRoleMemberCountsResult>;Returns a map of role IDs to the number of members with the role. Does not include the
guildId- The ID of the guild.
A Promise that resolves to an object mapping role IDs to member counts.
fetchPermissions(guildId: string, roleId: string): Promise<PermissionsBitField>;Fetches a role's guild permissions as computed by Discord, combined with `@everyone`. Other roles and member-specific restrictions are not taken into account.
guildId- The ID of the guild.
roleId- The ID of the role.
A Promise that resolves to the role's guild permissions.
editPositions(guildId: string, body: RESTPatchAPIGuildRolePositionsJSONBody, reason?: string): Promise<GuildRoleStructure[]>;Edits the positions of roles in the guild.
guildId- The ID of the guild.
body- The data to update the positions of roles with.
reason- The reason for reordering the roles, shown in the audit log.
A Promise that resolves to an array of edited roles.