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
.VoiceChannel
getChannel()
Returns the currentVoiceChannel
that theMember
is in.Guild
getGuild()
JDA
getJDA()
Returns theJDA
instance of this VoiceStateMember
getMember()
Returns theMember
corresponding to this GuildVoiceState instance (Backreference)java.time.OffsetDateTime
getRequestToSpeakTimestamp()
The time at which the user requested to speak.java.lang.String
getSessionId()
The Session-Id for this VoiceStateRestAction<java.lang.Void>
inviteSpeaker()
Invite this member to become a speaker.boolean
inVoiceChannel()
Used to determine if theMember
is currently in aVoiceChannel
in theGuild
returned fromgetGuild()
.
If this isfalse
,getChannel()
will returnnull
.boolean
isDeafened()
Returns whether theMember
is deafened, either by choiceisSelfDeafened()
or deafened by an adminisGuildDeafened()
boolean
isGuildDeafened()
Returns whether theMember
got deafened by an Adminboolean
isGuildMuted()
Returns whether theMember
got muted by an Adminboolean
isMuted()
Returns whether theMember
is muted, either by choiceisSelfMuted()
or muted by an adminisGuildMuted()
boolean
isSelfDeafened()
Returns whether theMember
deafened themselves.boolean
isSelfMuted()
Returns whether theMember
muted themselves.boolean
isSendingVideo()
Returns true if thisMember
has their camera turned on.boolean
isStream()
Returns true if thisMember
is currently streaming with Go Live.boolean
isSuppressed()
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 Detail
-
getJDA
@Nonnull JDA 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:
getRequestToSpeakTimestamp()
-
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
@Nullable VoiceChannel getChannel()
Returns the currentVoiceChannel
that theMember
is in. If theMember
is currently not in aVoiceChannel
, this returns null.- Returns:
- The VoiceChannel that the Member is in, or null.
-
getGuild
@Nonnull Guild getGuild()
Returns the currentGuild
of theMember's
VoiceChannel
. If theMember
is currently not in aVoiceChannel
, this returns null- Returns:
- the Member's Guild
-
getMember
@Nonnull Member getMember()
Returns theMember
corresponding to this GuildVoiceState instance (Backreference)- Returns:
- the Member that holds this GuildVoiceState
-
inVoiceChannel
boolean inVoiceChannel()
Used to determine if theMember
is currently in aVoiceChannel
in theGuild
returned fromgetGuild()
.
If this isfalse
,getChannel()
will returnnull
.- Returns:
- True, if the
Member
is currently in aVoiceChannel
in 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 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
@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_OTHERS
in 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_OTHERS
in 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_OTHERS
in the associatedStageChannel
-
-