public class RestRole extends Object
| Modifier and Type | Method and Description |
|---|---|
Flux<discord4j.discordjson.json.RoleData> |
changePosition(int position)
Requests to change this role's position.
|
static RestRole |
create(RestClient restClient,
Snowflake guildId,
Snowflake id)
Create a
RestRole for the given parameters. |
Mono<Void> |
delete(String reason)
Requests to delete this role while optionally specifying the reason.
|
Mono<discord4j.discordjson.json.RoleData> |
edit(discord4j.discordjson.json.RoleModifyRequest request,
String reason)
Requests to edit this role.
|
Mono<discord4j.discordjson.json.RoleData> |
getData()
Retrieve this role's data upon subscription.
|
RestGuild |
guild()
Return the guild tied to this role as a REST operations handle.
|
public static RestRole create(RestClient restClient, Snowflake guildId, Snowflake id)
RestRole for the given parameters. This method does not perform any API request.restClient - the client to make API requestsid - the ID of this entityRestRole represented by the given parameters.public RestGuild guild()
public Mono<discord4j.discordjson.json.RoleData> edit(discord4j.discordjson.json.RoleModifyRequest request, @Nullable String reason)
request - A RoleModifyRequest to parameterize this request.reason - The reason, if present.Mono where, upon successful completion, emits the edited RoleData. If an error
is received, it is emitted through the Mono.public Mono<Void> delete(@Nullable String reason)
reason - The reason, if present.Mono where, upon successful completion, emits nothing; indicating the role has been deleted. If
an error is received, it is emitted through the Mono.public Flux<discord4j.discordjson.json.RoleData> changePosition(int position)
position - The position to change for this role.Flux that continually emits all the roles associated to this role's
guild. If an error is received, it is emitted through the Flux.