Class GuildVoiceStateImpl
java.lang.Object
net.dv8tion.jda.internal.entities.GuildVoiceStateImpl
- All Implemented Interfaces:
GuildVoiceState
,ISnowflake
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionPromote the member to speaker.boolean
Returns the currentAudioChannelUnion
that theMember
is in.getGuild()
long
The Snowflake id of this entity.getJDA()
Returns theJDA
instance of this VoiceStateReturns theMember
corresponding to this GuildVoiceState instancelong
The time at which the user requested to speak.The Session-Id for this VoiceStateint
hashCode()
boolean
Used to determine if theMember
is currently connected to anAudioChannel
in theGuild
returned fromGuildVoiceState.getGuild()
.Invite this member to become a speaker.boolean
Returns whether theMember
is deafened, either by choiceGuildVoiceState.isSelfDeafened()
or deafened by an adminGuildVoiceState.isGuildDeafened()
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 choiceGuildVoiceState.isSelfMuted()
or muted by an adminGuildVoiceState.isGuildMuted()
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.setGuildDeafened
(boolean guildDeafened) setGuildMuted
(boolean guildMuted) void
setRequestToSpeak
(OffsetDateTime timestamp) setSelfDeafened
(boolean selfDeafened) setSelfMuted
(boolean selfMuted) setSessionId
(String sessionId) setStream
(boolean stream) setSuppressed
(boolean suppressed) setVideo
(boolean video) toString()
updateConnectedChannel
(AudioChannel connectedChannel) Methods inherited from interface net.dv8tion.jda.api.entities.ISnowflake
getId, getTimeCreated
-
Constructor Details
-
GuildVoiceStateImpl
-
-
Method Details
-
isSelfMuted
public boolean isSelfMuted()Description copied from interface:GuildVoiceState
Returns whether theMember
muted themselves.- Specified by:
isSelfMuted
in interfaceGuildVoiceState
- Returns:
- The User's self-mute status, or false if the member is not connected to an audio channel
-
isSelfDeafened
public boolean isSelfDeafened()Description copied from interface:GuildVoiceState
Returns whether theMember
deafened themselves.- Specified by:
isSelfDeafened
in interfaceGuildVoiceState
- Returns:
- The User's self-deaf status, or false if the member is not connected to an audio channel
-
getJDA
Description copied from interface:GuildVoiceState
Returns theJDA
instance of this VoiceState- Specified by:
getJDA
in interfaceGuildVoiceState
- Returns:
- The corresponding JDA instance
-
getSessionId
Description copied from interface:GuildVoiceState
The Session-Id for this VoiceState- Specified by:
getSessionId
in interfaceGuildVoiceState
- Returns:
- The Session-Id, or null if the member is not connected to an audio channel.
-
getRequestToSpeak
public long getRequestToSpeak() -
getRequestToSpeakTimestamp
Description copied from interface:GuildVoiceState
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.- Specified by:
getRequestToSpeakTimestamp
in interfaceGuildVoiceState
- Returns:
- The request to speak timestamp, or null if this user didn't request to speak
-
approveSpeaker
Description copied from interface:GuildVoiceState
Promote the member to speaker.This requires a non-null
GuildVoiceState.getRequestToSpeakTimestamp()
. You can useGuildVoiceState.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
.- Specified by:
approveSpeaker
in interfaceGuildVoiceState
- Returns:
RestAction
-
declineSpeaker
Description copied from interface:GuildVoiceState
Reject this membersrequest to speak
or moves aspeaker
back to theaudience
.This requires a non-null
GuildVoiceState.getRequestToSpeakTimestamp()
. The member will have to request to speak again.This does nothing if the member is not connected to a
StageChannel
.- Specified by:
declineSpeaker
in interfaceGuildVoiceState
- Returns:
RestAction
-
inviteSpeaker
Description copied from interface:GuildVoiceState
Invite this member to become a speaker.This does nothing if the member is not connected to a
StageChannel
.- Specified by:
inviteSpeaker
in interfaceGuildVoiceState
- Returns:
RestAction
-
isMuted
public boolean isMuted()Description copied from interface:GuildVoiceState
Returns whether theMember
is muted, either by choiceGuildVoiceState.isSelfMuted()
or muted by an adminGuildVoiceState.isGuildMuted()
- Specified by:
isMuted
in interfaceGuildVoiceState
- Returns:
- the Member's mute status, or false if the member is not connected to an audio channel
-
isDeafened
public boolean isDeafened()Description copied from interface:GuildVoiceState
Returns whether theMember
is deafened, either by choiceGuildVoiceState.isSelfDeafened()
or deafened by an adminGuildVoiceState.isGuildDeafened()
- Specified by:
isDeafened
in interfaceGuildVoiceState
- Returns:
- the Member's deaf status, or false if the member is not connected to an audio channel
-
isGuildMuted
public boolean isGuildMuted()Description copied from interface:GuildVoiceState
Returns whether theMember
got muted by an Admin- Specified by:
isGuildMuted
in interfaceGuildVoiceState
- Returns:
- the Member's guild-mute status, or false if the member is not connected to an audio channel
-
isGuildDeafened
public boolean isGuildDeafened()Description copied from interface:GuildVoiceState
Returns whether theMember
got deafened by an Admin- Specified by:
isGuildDeafened
in interfaceGuildVoiceState
- Returns:
- the Member's guild-deaf status, or false if the member is not connected to an audio channel
-
isSuppressed
public boolean isSuppressed()Description copied from interface:GuildVoiceState
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.- Specified by:
isSuppressed
in interfaceGuildVoiceState
- Returns:
- True, if this
Member's
audio is being suppressed. - See Also:
-
isStream
public boolean isStream()Description copied from interface:GuildVoiceState
Returns true if thisMember
is currently streaming with Go Live.- Specified by:
isStream
in interfaceGuildVoiceState
- Returns:
- True, if this member is streaming
-
isSendingVideo
public boolean isSendingVideo()Description copied from interface:GuildVoiceState
Returns true if thisMember
has their camera turned on.
This does not include streams! SeeGuildVoiceState.isStream()
- Specified by:
isSendingVideo
in interfaceGuildVoiceState
- Returns:
- True, if this member has their camera turned on.
-
getChannel
Description copied from interface:GuildVoiceState
Returns the currentAudioChannelUnion
that theMember
is in. If theMember
is currently not connected to aAudioChannel
, this returns null.- Specified by:
getChannel
in interfaceGuildVoiceState
- Returns:
- The AudioChannelUnion that the Member is connected to, or null if the member is not connected to an audio channel.
-
getGuild
Description copied from interface:GuildVoiceState
- Specified by:
getGuild
in interfaceGuildVoiceState
- Returns:
- the Member's Guild
-
getMember
Description copied from interface:GuildVoiceState
Returns theMember
corresponding to this GuildVoiceState instance- Specified by:
getMember
in interfaceGuildVoiceState
- Returns:
- The member related to this voice state, might not be cached and thus have outdated information.
-
inAudioChannel
public boolean inAudioChannel()Description copied from interface:GuildVoiceState
Used to determine if theMember
is currently connected to anAudioChannel
in theGuild
returned fromGuildVoiceState.getGuild()
.
If this isfalse
,GuildVoiceState.getChannel()
will returnnull
.- Specified by:
inAudioChannel
in interfaceGuildVoiceState
- Returns:
- True, if the
Member
is currently connected to anAudioChannel
in thisGuild
-
getIdLong
public long getIdLong()Description copied from interface:ISnowflake
The Snowflake id of this entity. This is unique to every entity and will never change.- Specified by:
getIdLong
in interfaceISnowflake
- Returns:
- Long containing the Id.
-
hashCode
public int hashCode() -
equals
-
toString
-
setMember
-
updateConnectedChannel
-
setSessionId
-
setSelfMuted
-
setSelfDeafened
-
setGuildMuted
-
setGuildDeafened
-
setSuppressed
-
setStream
-
setVideo
-
setRequestToSpeak
-