Package discord4j.core.event.domain
Class VoiceStateUpdateEvent
java.lang.Object
discord4j.core.event.domain.Event
discord4j.core.event.domain.VoiceStateUpdateEvent
- Direct Known Subclasses:
StageRequestToSpeakEvent
Dispatched when a user's voice state changes.
This change can include the change of any property in VoiceState
.
The old voice state may not be present if voice states are not stored.
This event is dispatched by Discord.
- See Also:
-
Constructor Summary
ConstructorDescriptionVoiceStateUpdateEvent
(GatewayDiscordClient gateway, ShardInfo shardInfo, VoiceState current, VoiceState old) -
Method Summary
Modifier and TypeMethodDescriptionGets the current, new,VoiceState
that has been updated in this event.getOld()
Gets the oldVoiceState
that has been updated in this event, if present.boolean
Gets whether this event is a voice channel join event.boolean
Gets whether this event is a voice channel leave event.boolean
Gets whether this event is a voice channel move event.toString()
Methods inherited from class discord4j.core.event.domain.Event
getClient, getShardInfo
-
Constructor Details
-
VoiceStateUpdateEvent
public VoiceStateUpdateEvent(GatewayDiscordClient gateway, ShardInfo shardInfo, VoiceState current, @Nullable VoiceState old)
-
-
Method Details
-
getCurrent
Gets the current, new,VoiceState
that has been updated in this event.- Returns:
- The current
VoiceState
.
-
getOld
Gets the oldVoiceState
that has been updated in this event, if present. This may not be available ifVoiceStates
are not stored.- Returns:
- The old
VoiceState
, if present.
-
isJoinEvent
public boolean isJoinEvent()Gets whether this event is a voice channel join event.- Returns:
true
if this is a voice channel join event,false
otherwise.
-
isLeaveEvent
public boolean isLeaveEvent()Gets whether this event is a voice channel leave event.- Returns:
true
if this is a voice channel leave event,false
otherwise.
-
isMoveEvent
public boolean isMoveEvent()Gets whether this event is a voice channel move event.- Returns:
true
if this is a voice channel move event,false
otherwise.
-
toString
-