Class VoiceStateUpdateEvent

java.lang.Object
discord4j.core.event.domain.Event
discord4j.core.event.domain.VoiceStateUpdateEvent
Direct Known Subclasses:
StageRequestToSpeakEvent

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:
  • Constructor Details

  • Method Details

    • 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 old VoiceState that has been updated in this event, if present. This may not be available if VoiceStates 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

      public String toString()
      Overrides:
      toString in class Object