Package net.dv8tion.jda.api.entities
Interface GuildVoiceState
- All Superinterfaces:
ISnowflake
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionPromote the member to speaker.Returns the currentAudioChannelUnion
that theMember
is in.getGuild()
getJDA()
Returns theJDA
instance of this VoiceStateReturns theMember
corresponding to this GuildVoiceState instance (BackReference)The time at which the user requested to speak.The Session-Id for this VoiceStateboolean
Used to determine if theMember
is currently connected to anAudioChannel
in theGuild
returned fromgetGuild()
.Invite this member to become a speaker.boolean
Returns whether theMember
is deafened, either by choiceisSelfDeafened()
or deafened by an adminisGuildDeafened()
boolean
Returns whether theMember
got deafened by an Adminboolean
Returns whether theMember
got muted by an Adminboolean
isMuted()
Returns whether theMember
is muted, either by choiceisSelfMuted()
or muted by an adminisGuildMuted()
boolean
Returns whether theMember
deafened themselves.boolean
Returns whether theMember
muted themselves.boolean
Returns true if thisMember
has their camera turned on.boolean
isStream()
Returns true if thisMember
is currently streaming with Go Live.boolean
Returns true if thisMember
is unable to speak because the channel is actively suppressing audio communication.Methods inherited from interface net.dv8tion.jda.api.entities.ISnowflake
getId, getIdLong, getTimeCreated
-
Method Details
-
getJDA
Returns theJDA
instance of this VoiceState- Returns:
- The corresponding JDA instance
-
isSelfMuted
boolean isSelfMuted()Returns whether theMember
muted themselves.- Returns:
- The User's self-mute status
-
isSelfDeafened
boolean isSelfDeafened()Returns whether theMember
deafened themselves.- Returns:
- The User's self-deaf status
-
isMuted
boolean isMuted()Returns whether theMember
is muted, either by choiceisSelfMuted()
or muted by an adminisGuildMuted()
- Returns:
- the Member's mute status
-
isDeafened
boolean isDeafened()Returns whether theMember
is deafened, either by choiceisSelfDeafened()
or deafened by an adminisGuildDeafened()
- Returns:
- the Member's deaf status
-
isGuildMuted
boolean isGuildMuted()Returns whether theMember
got muted by an Admin- Returns:
- the Member's guild-mute status
-
isGuildDeafened
boolean isGuildDeafened()Returns whether theMember
got deafened by an Admin- Returns:
- the Member's guild-deaf status
-
isSuppressed
boolean isSuppressed()Returns true if thisMember
is unable to speak because the channel is actively suppressing audio communication. This occurs inVoiceChannels
where the Member either doesn't havePermission#VOICE_SPEAK
or if the channel is the designated AFK channel.
This is also used byStageChannels
for listeners without speaker approval.- Returns:
- True, if this
Member's
audio is being suppressed. - See Also:
-
isStream
boolean isStream()Returns true if thisMember
is currently streaming with Go Live.- Returns:
- True, if this member is streaming
-
isSendingVideo
boolean isSendingVideo()Returns true if thisMember
has their camera turned on.
This does not include streams! SeeisStream()
- Returns:
- True, if this member has their camera turned on.
-
getChannel
Returns the currentAudioChannelUnion
that theMember
is in. If theMember
is currently not connected to aAudioChannel
, this returns null.Note: This will return
null
if the member is not cached! You can useMemberCachePolicy.VOICE
to cache members in voice channels.- Returns:
- The AudioChannelUnion that the Member is connected to, or null.
-
getGuild
- Returns:
- the Member's Guild
-
getMember
Returns theMember
corresponding to this GuildVoiceState instance (BackReference)- Returns:
- the Member that holds this GuildVoiceState
-
inAudioChannel
boolean inAudioChannel()Used to determine if theMember
is currently connected to anAudioChannel
in theGuild
returned fromgetGuild()
.
If this isfalse
,getChannel()
will returnnull
.- Returns:
- True, if the
Member
is currently connected to anAudioChannel
in thisGuild
-
getSessionId
The Session-Id for this VoiceState- Returns:
- The Session-Id
-
getRequestToSpeakTimestamp
The time at which the user requested to speak.
This is used forStageChannels
and can only be approved by members withPermission.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 useinviteSpeaker()
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 havePermission.VOICE_MUTE_OTHERS
in the associatedStageChannel
-
declineSpeaker
Reject this membersrequest to speak
or moves aspeaker
back to theaudience
.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 havePermission.VOICE_MUTE_OTHERS
in the associatedStageChannel
-
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 havePermission.VOICE_MUTE_OTHERS
in the associatedStageChannel
-