Package net.dv8tion.jda.api.entities
Interface GuildVoiceState
- All Superinterfaces:
ISnowflake
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionPromote the member to speaker.Returns the currentAudioChannelUnionthat theMemberis in.getGuild()getJDA()Returns theJDAinstance of this VoiceStateReturns theMembercorresponding to this GuildVoiceState instance (BackReference)The time at which the user requested to speak.The Session-Id for this VoiceStatebooleanUsed to determine if theMemberis currently connected to anAudioChannelin theGuildreturned fromgetGuild().Invite this member to become a speaker.booleanReturns whether theMemberis deafened, either by choiceisSelfDeafened()or deafened by an adminisGuildDeafened()booleanReturns whether theMembergot deafened by an AdminbooleanReturns whether theMembergot muted by an AdminbooleanisMuted()Returns whether theMemberis muted, either by choiceisSelfMuted()or muted by an adminisGuildMuted()booleanReturns whether theMemberdeafened themselves.booleanReturns whether theMembermuted themselves.booleanReturns true if thisMemberhas their camera turned on.booleanisStream()Returns true if thisMemberis currently streaming with Go Live.booleanReturns true if thisMemberis 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 theJDAinstance of this VoiceState- Returns:
- The corresponding JDA instance
-
isSelfMuted
boolean isSelfMuted()Returns whether theMembermuted themselves.- Returns:
- The User's self-mute status
-
isSelfDeafened
boolean isSelfDeafened()Returns whether theMemberdeafened themselves.- Returns:
- The User's self-deaf status
-
isMuted
boolean isMuted()Returns whether theMemberis muted, either by choiceisSelfMuted()or muted by an adminisGuildMuted()- Returns:
- the Member's mute status
-
isDeafened
boolean isDeafened()Returns whether theMemberis deafened, either by choiceisSelfDeafened()or deafened by an adminisGuildDeafened()- Returns:
- the Member's deaf status
-
isGuildMuted
boolean isGuildMuted()Returns whether theMembergot muted by an Admin- Returns:
- the Member's guild-mute status
-
isGuildDeafened
boolean isGuildDeafened()Returns whether theMembergot deafened by an Admin- Returns:
- the Member's guild-deaf status
-
isSuppressed
boolean isSuppressed()Returns true if thisMemberis unable to speak because the channel is actively suppressing audio communication. This occurs inVoiceChannelswhere the Member either doesn't havePermission#VOICE_SPEAKor if the channel is the designated AFK channel.
This is also used byStageChannelsfor listeners without speaker approval.- Returns:
- True, if this
Member'saudio is being suppressed. - See Also:
-
isStream
boolean isStream()Returns true if thisMemberis currently streaming with Go Live.- Returns:
- True, if this member is streaming
-
isSendingVideo
boolean isSendingVideo()Returns true if thisMemberhas their camera turned on.
This does not include streams! SeeisStream()- Returns:
- True, if this member has their camera turned on.
-
getChannel
Returns the currentAudioChannelUnionthat theMemberis in. If theMemberis currently not connected to aAudioChannel, this returns null.Note: This will return
nullif the member is not cached! You can useMemberCachePolicy.VOICEto cache members in voice channels.- Returns:
- The AudioChannelUnion that the Member is connected to, or null.
-
getGuild
- Returns:
- the Member's Guild
-
getMember
Returns theMembercorresponding to this GuildVoiceState instance (BackReference)- Returns:
- the Member that holds this GuildVoiceState
-
inAudioChannel
boolean inAudioChannel()Used to determine if theMemberis currently connected to anAudioChannelin theGuildreturned fromgetGuild().
If this isfalse,getChannel()will returnnull.- Returns:
- True, if the
Memberis currently connected to anAudioChannelin 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 forStageChannelsand can only be approved by members withPermission.VOICE_MUTE_OTHERSon 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_OTHERSin the associatedStageChannel
-
declineSpeaker
Reject this membersrequest to speakor moves aspeakerback 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_OTHERSin 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_OTHERSin the associatedStageChannel
-