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 VoiceState
getCurrent()
Gets the current, new,VoiceState
that has been updated in this event.Optional<VoiceState>
getOld()
Gets the oldVoiceState
that has been updated in this event, if present.boolean
isJoinEvent()
Gets whether this event is a voice channel join event.boolean
isLeaveEvent()
Gets whether this event is a voice channel leave event.boolean
isMoveEvent()
Gets whether this event is a voice channel move event.String
toString()
-
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,VoiceState
that has been updated in this event.- Returns:
- The current
VoiceState
.
-
getOld
public Optional<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.
-
-