Package discord4j.rest.entity
Class RestRole
java.lang.Object
discord4j.rest.entity.RestRole
Roles represent a set of permissions, unique per guild, attached to a group of users.
-
Method Summary
Modifier and TypeMethodDescriptionFlux<discord4j.discordjson.json.RoleData>changePosition(int position) Requests to change this role's position.Flux<discord4j.discordjson.json.RoleData>changePosition(int position, String reason) Requests to change this role's position.static RestRolecreate(RestClient restClient, Snowflake guildId, Snowflake id) Create aRestRolefor the given parameters.Requests to delete this role while optionally specifying the reason.Mono<discord4j.discordjson.json.RoleData>Requests to edit this role.booleanMono<discord4j.discordjson.json.RoleData>getData()Retrieve this role's data upon subscription.Returns the ID of the guild this role belongs to.getId()Returns the ID of this role.guild()Return the guild tied to this role as a REST operations handle.inthashCode()
-
Method Details
-
create
Create aRestRolefor the given parameters. This method does not perform any API request.- Parameters:
restClient- the client to make API requestsid- the ID of this entity- Returns:
- a
RestRolerepresented by the given parameters.
-
getGuildId
Returns the ID of the guild this role belongs to.- Returns:
- The ID of the the guild this role belongs to.
-
getId
Returns the ID of this role.- Returns:
- The ID of this role
-
guild
Return the guild tied to this role as a REST operations handle.- Returns:
- the parent guild for this role
-
edit
public Mono<discord4j.discordjson.json.RoleData> edit(discord4j.discordjson.json.RoleModifyRequest request, @Nullable String reason) Requests to edit this role.- Parameters:
request- ARoleModifyRequestto parameterize this request.reason- The reason, if present.- Returns:
- A
Monowhere, upon successful completion, emits the editedRoleData. If an error is received, it is emitted through theMono.
-
delete
Requests to delete this role while optionally specifying the reason.- Parameters:
reason- The reason, if present.- Returns:
- A
Monowhere, upon successful completion, emits nothing; indicating the role has been deleted. If an error is received, it is emitted through theMono.
-
changePosition
public Flux<discord4j.discordjson.json.RoleData> changePosition(int position, @Nullable String reason) Requests to change this role's position.- Parameters:
position- The position to change for this role.reason- The reason, if present.- Returns:
- A
Fluxthat continually emits all therolesassociated to this role's guild. If an error is received, it is emitted through theFlux.
-
changePosition
Requests to change this role's position.- Parameters:
position- The position to change for this role.- Returns:
- A
Fluxthat continually emits all therolesassociated to this role's guild. If an error is received, it is emitted through theFlux.
-
getData
Retrieve this role's data upon subscription.- Returns:
- a
Monowhere, upon successful completion, emits theRoleDatabelonging to this role. If an error is received, it is emitted through theMono.
-
equals
-
hashCode
public int hashCode()
-