Package discord4j.core.event.domain
Class VoiceStateUpdateEvent
- java.lang.Object
-
- discord4j.core.event.domain.Event
-
- discord4j.core.event.domain.VoiceStateUpdateEvent
-
public class VoiceStateUpdateEvent extends Event
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:
- Voice State Update
-
-
Constructor Summary
Constructors Constructor Description VoiceStateUpdateEvent(GatewayDiscordClient gateway, ShardInfo shardInfo, VoiceState current, VoiceState old)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description VoiceStategetCurrent()Gets the current, new,VoiceStatethat has been updated in this event.Optional<VoiceState>getOld()Gets the oldVoiceStatethat has been updated in this event, if present.booleanisJoinEvent()Gets whether this event is a voice channel join event.booleanisLeaveEvent()Gets whether this event is a voice channel leave event.booleanisMoveEvent()Gets whether this event is a voice channel move event.StringtoString()-
Methods inherited from class discord4j.core.event.domain.Event
getClient, getShardInfo
-
-
-
-
Constructor Detail
-
VoiceStateUpdateEvent
public VoiceStateUpdateEvent(GatewayDiscordClient gateway, ShardInfo shardInfo, VoiceState current, @Nullable VoiceState old)
-
-
Method Detail
-
getCurrent
public VoiceState getCurrent()
Gets the current, new,VoiceStatethat has been updated in this event.- Returns:
- The current
VoiceState.
-
getOld
public Optional<VoiceState> getOld()
Gets the oldVoiceStatethat has been updated in this event, if present. This may not be available ifVoiceStatesare not stored.- Returns:
- The old
VoiceState, if present.
-
isJoinEvent
public boolean isJoinEvent()
Gets whether this event is a voice channel join event.- Returns:
trueif this is a voice channel join event,falseotherwise.
-
isLeaveEvent
public boolean isLeaveEvent()
Gets whether this event is a voice channel leave event.- Returns:
trueif this is a voice channel leave event,falseotherwise.
-
isMoveEvent
public boolean isMoveEvent()
Gets whether this event is a voice channel move event.- Returns:
trueif this is a voice channel move event,falseotherwise.
-
-