Package net.dv8tion.jda.api.entities
Interface GuildVoiceState
-
- All Superinterfaces:
ISnowflake
public interface GuildVoiceState extends ISnowflake
- See Also:
Member.getVoiceState()
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description RestAction<java.lang.Void>approveSpeaker()Promote the member to speaker.RestAction<java.lang.Void>declineSpeaker()Reject this membersrequest to speak.VoiceChannelgetChannel()Returns the currentVoiceChannelthat theMemberis in.GuildgetGuild()JDAgetJDA()Returns theJDAinstance of this VoiceStateMembergetMember()Returns theMembercorresponding to this GuildVoiceState instance (Backreference)java.time.OffsetDateTimegetRequestToSpeakTimestamp()The time at which the user requested to speak.java.lang.StringgetSessionId()The Session-Id for this VoiceStateRestAction<java.lang.Void>inviteSpeaker()Invite this member to become a speaker.booleaninVoiceChannel()Used to determine if theMemberis currently in aVoiceChannelin theGuildreturned fromgetGuild().
If this isfalse,getChannel()will returnnull.booleanisDeafened()Returns whether theMemberis deafened, either by choiceisSelfDeafened()or deafened by an adminisGuildDeafened()booleanisGuildDeafened()Returns whether theMembergot deafened by an AdminbooleanisGuildMuted()Returns whether theMembergot muted by an AdminbooleanisMuted()Returns whether theMemberis muted, either by choiceisSelfMuted()or muted by an adminisGuildMuted()booleanisSelfDeafened()Returns whether theMemberdeafened themselves.booleanisSelfMuted()Returns whether theMembermuted themselves.booleanisSendingVideo()Returns true if thisMemberhas their camera turned on.booleanisStream()Returns true if thisMemberis currently streaming with Go Live.booleanisSuppressed()Returns 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 Detail
-
getJDA
@Nonnull JDA 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:
getRequestToSpeakTimestamp()
-
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
@Nullable VoiceChannel getChannel()
Returns the currentVoiceChannelthat theMemberis in. If theMemberis currently not in aVoiceChannel, this returns null.- Returns:
- The VoiceChannel that the Member is in, or null.
-
getGuild
@Nonnull Guild getGuild()
Returns the currentGuildof theMember'sVoiceChannel. If theMemberis currently not in aVoiceChannel, this returns null- Returns:
- the Member's Guild
-
getMember
@Nonnull Member getMember()
Returns theMembercorresponding to this GuildVoiceState instance (Backreference)- Returns:
- the Member that holds this GuildVoiceState
-
inVoiceChannel
boolean inVoiceChannel()
Used to determine if theMemberis currently in aVoiceChannelin theGuildreturned fromgetGuild().
If this isfalse,getChannel()will returnnull.- Returns:
- True, if the
Memberis currently in aVoiceChannelin thisGuild.
-
getSessionId
@Nullable java.lang.String getSessionId()
The Session-Id for this VoiceState- Returns:
- The Session-Id
-
getRequestToSpeakTimestamp
@Nullable java.time.OffsetDateTime 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
@Nonnull @CheckReturnValue RestAction<java.lang.Void> 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
@Nonnull @CheckReturnValue RestAction<java.lang.Void> declineSpeaker()
Reject this membersrequest to speak.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
@Nonnull @CheckReturnValue RestAction<java.lang.Void> 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
-
-