Interface GuildVoiceState

All Superinterfaces:
ISnowflake

public interface GuildVoiceState extends ISnowflake
Represents the voice state of a Member in a Guild.

Voice states are only cached while the member is connected to a channel.

See Also:
  • Method Details

    • getJDA

      @Nonnull JDA getJDA()
      Returns the JDA instance of this VoiceState
      Returns:
      The corresponding JDA instance
    • isSelfMuted

      boolean isSelfMuted()
      Returns whether the Member muted themselves.
      Returns:
      The User's self-mute status, or false if the member is not connected to an audio channel
    • isSelfDeafened

      boolean isSelfDeafened()
      Returns whether the Member deafened themselves.
      Returns:
      The User's self-deaf status, or false if the member is not connected to an audio channel
    • isMuted

      boolean isMuted()
      Returns whether the Member is muted, either by choice isSelfMuted() or muted by an admin isGuildMuted()
      Returns:
      the Member's mute status, or false if the member is not connected to an audio channel
    • isDeafened

      boolean isDeafened()
      Returns whether the Member is deafened, either by choice isSelfDeafened() or deafened by an admin isGuildDeafened()
      Returns:
      the Member's deaf status, or false if the member is not connected to an audio channel
    • isGuildMuted

      boolean isGuildMuted()
      Returns whether the Member got muted by an Admin
      Returns:
      the Member's guild-mute status, or false if the member is not connected to an audio channel
    • isGuildDeafened

      boolean isGuildDeafened()
      Returns whether the Member got deafened by an Admin
      Returns:
      the Member's guild-deaf status, or false if the member is not connected to an audio channel
    • isSuppressed

      boolean isSuppressed()
      Returns true if this Member is unable to speak because the channel is actively suppressing audio communication. This occurs in VoiceChannels where the Member either doesn't have Permission#VOICE_SPEAK or if the channel is the designated AFK channel.
      This is also used by StageChannels for listeners without speaker approval.
      Returns:
      True, if this Member's audio is being suppressed.
      See Also:
    • isStream

      boolean isStream()
      Returns true if this Member is currently streaming with Go Live.
      Returns:
      True, if this member is streaming
    • isSendingVideo

      boolean isSendingVideo()
      Returns true if this Member has their camera turned on.
      This does not include streams! See isStream()
      Returns:
      True, if this member has their camera turned on.
    • getChannel

      Returns the current AudioChannelUnion that the Member is in. If the Member is currently not connected to a AudioChannel, this returns null.

      Note: This will return null if the member is not cached! You can use MemberCachePolicy.VOICE to cache members in voice channels.

      Returns:
      The AudioChannelUnion that the Member is connected to, or null if the member is not connected to an audio channel.
    • getGuild

      @Nonnull Guild getGuild()
      Returns the Guild for the Member that this GuildVoiceState belongs to.
      Returns:
      the Member's Guild
    • getMember

      @Nonnull Member getMember()
      Returns the Member corresponding to this GuildVoiceState instance
      Returns:
      The member related to this voice state, might not be cached and thus have outdated information.
    • inAudioChannel

      boolean inAudioChannel()
      Used to determine if the Member is currently connected to an AudioChannel in the Guild returned from getGuild().
      If this is false, getChannel() will return null.
      Returns:
      True, if the Member is currently connected to an AudioChannel in this Guild
    • getSessionId

      @Nullable String getSessionId()
      The Session-Id for this VoiceState
      Returns:
      The Session-Id, or null if the member is not connected to an audio channel.
    • getRequestToSpeakTimestamp

      @Nullable OffsetDateTime getRequestToSpeakTimestamp()
      The time at which the user requested to speak.
      This is used for StageChannels and can only be approved by members with Permission.VOICE_MUTE_OTHERS on the channel.
      Returns:
      The request to speak timestamp, or null if this user didn't request to speak
    • approveSpeaker

      Promote the member to speaker.

      This requires a non-null getRequestToSpeakTimestamp(). You can use inviteSpeaker() to invite the member to become a speaker if they haven't requested to speak.

      This does nothing if the member is not connected to a StageChannel.

      Returns:
      RestAction
      Throws:
      InsufficientPermissionException - If the currently logged in account does not have Permission.VOICE_MUTE_OTHERS in the associated StageChannel
    • declineSpeaker

      Reject this members request to speak or moves a speaker back to the audience.

      This requires a non-null getRequestToSpeakTimestamp(). The member will have to request to speak again.

      This does nothing if the member is not connected to a StageChannel.

      Returns:
      RestAction
      Throws:
      InsufficientPermissionException - If the currently logged in account does not have Permission.VOICE_MUTE_OTHERS in the associated StageChannel
    • inviteSpeaker

      Invite this member to become a speaker.

      This does nothing if the member is not connected to a StageChannel.

      Returns:
      RestAction
      Throws:
      InsufficientPermissionException - If the currently logged in account does not have Permission.VOICE_MUTE_OTHERS in the associated StageChannel