Package discord4j.core.event.domain.role
Class RoleUpdateEvent
- java.lang.Object
-
- discord4j.core.event.domain.Event
-
- discord4j.core.event.domain.role.RoleEvent
-
- discord4j.core.event.domain.role.RoleUpdateEvent
-
public class RoleUpdateEvent extends RoleEvent
Dispatched when a role is updated in a guild.The old role may not be present if roles are not stored.
This event is dispatched by Discord.
- See Also:
- Guild Role Update
-
-
Constructor Summary
Constructors Constructor Description RoleUpdateEvent(GatewayDiscordClient gateway, ShardInfo shardInfo, Role current, Role old)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Role
getCurrent()
Gets the current, new version of theRole
that was updated in the event.Optional<Role>
getOld()
Gets the old version of theRole
that was updated in this event.String
toString()
-
Methods inherited from class discord4j.core.event.domain.Event
getClient, getShardInfo
-
-
-
-
Constructor Detail
-
RoleUpdateEvent
public RoleUpdateEvent(GatewayDiscordClient gateway, ShardInfo shardInfo, Role current, @Nullable Role old)
-
-
Method Detail
-
getCurrent
public Role getCurrent()
Gets the current, new version of theRole
that was updated in the event.- Returns:
- The current version of the updated
Role
.
-
getOld
public Optional<Role> getOld()
Gets the old version of theRole
that was updated in this event. if present. This may not be available ifRole
are not stored.- Returns:
- The old version of the updated
Role
, if present.
-
-