Package discord4j.core.object
Class VoiceState
java.lang.Object
discord4j.core.object.VoiceState
- All Implemented Interfaces:
DiscordObject
A Discord voice state.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionVoiceState
(GatewayDiscordClient gateway, discord4j.discordjson.json.VoiceStateData data) Constructs aVoiceState
with an associatedGatewayDiscordClient
and Discord data. -
Method Summary
Modifier and TypeMethodDescriptionRequests to retrieve the audio channel this user is connected to, if present.getChannel
(EntityRetrievalStrategy retrievalStrategy) Requests to retrieve the audio channel this user is connected to, if present, using the given retrieval strategy.Gets the channel ID this user is connected to, if present.Returns theGatewayDiscordClient
that created this object.discord4j.discordjson.json.VoiceStateData
getData()
Gets the data of the voice state.getGuild()
Requests to retrieve the guild this voice state is for.getGuild
(EntityRetrievalStrategy retrievalStrategy) Requests to retrieve the guild this voice state is for, using the given retrieval strategy.Gets the guild ID this voice state is for.Requests to retrieve the member this voice state is for.getMember
(EntityRetrievalStrategy retrievalStrategy) Requests to retrieve the member this voice state is for, using the given retrieval strategy.Gets the time at which the user requested to speak, if present.Gets the session ID for this voice state.getUser()
Requests to retrieve the user this voice state is for.getUser
(EntityRetrievalStrategy retrievalStrategy) Requests to retrieve the user this voice state is for, using the given retrieval strategy.Gets the user ID this voice state is for.boolean
isDeaf()
Gets whether this user is deafened by the server.boolean
isMuted()
Gets whether this user is muted by the server.boolean
Gets whether this user is locally deafened.boolean
Gets whether this user is locally muted.boolean
Gets whether this user is streaming using "Go Live".boolean
Gets whether this user's camera is enabled.boolean
Gets whether this user is muted by the current user.toString()
-
Constructor Details
-
VoiceState
Constructs aVoiceState
with an associatedGatewayDiscordClient
and Discord data.- Parameters:
gateway
- TheGatewayDiscordClient
associated to this object, must be non-null.data
- The raw data as represented by Discord, must be non-null.
-
-
Method Details
-
getClient
Description copied from interface:DiscordObject
Returns theGatewayDiscordClient
that created this object. Methods in it are exclusively based on the entity cache orStore
in use. Refer to callinggetClient().rest()
to access aDiscordClient
that is capable of requesting entities directly from the REST API.- Specified by:
getClient
in interfaceDiscordObject
- Returns:
- The
GatewayDiscordClient
associated to this object.
-
getData
public discord4j.discordjson.json.VoiceStateData getData()Gets the data of the voice state.- Returns:
- The data of the voice state.
-
getGuildId
Gets the guild ID this voice state is for.- Returns:
- The guild ID this voice state is for.
-
getGuild
Requests to retrieve the guild this voice state is for. -
getGuild
Requests to retrieve the guild this voice state is for, using the given retrieval strategy. -
getChannelId
Gets the channel ID this user is connected to, if present.- Returns:
- The channel ID this user is connected to, if present.
-
getChannel
Requests to retrieve the audio channel this user is connected to, if present.- Returns:
- A
Mono
where, upon successful completion, emits theAudioChannel
this user is connected to, if present. If an error is received, it is emitted through theMono
.
-
getChannel
Requests to retrieve the audio channel this user is connected to, if present, using the given retrieval strategy.- Parameters:
retrievalStrategy
- the strategy to use to get the channel- Returns:
- A
Mono
where, upon successful completion, emits theAudioChannel
this user is connected to, if present. If an error is received, it is emitted through theMono
.
-
getUserId
Gets the user ID this voice state is for.- Returns:
- The user ID this voice state is for.
-
getUser
Requests to retrieve the user this voice state is for. -
getUser
Requests to retrieve the user this voice state is for, using the given retrieval strategy. -
getMember
Requests to retrieve the member this voice state is for. -
getMember
Requests to retrieve the member this voice state is for, using the given retrieval strategy. -
getSessionId
Gets the session ID for this voice state.- Returns:
- The session ID for this voice state.
-
isDeaf
public boolean isDeaf()Gets whether this user is deafened by the server.- Returns:
true
if the user is deafened by the server,false
otherwise.
-
isMuted
public boolean isMuted()Gets whether this user is muted by the server.- Returns:
true
if the user is deafened by the server,false
otherwise.
-
isSelfDeaf
public boolean isSelfDeaf()Gets whether this user is locally deafened.- Returns:
true
if this user is locally deafened,false
otherwise.
-
isSelfMuted
public boolean isSelfMuted()Gets whether this user is locally muted.- Returns:
true
if this user is locally muted,false
otherwise.
-
isSelfStreaming
public boolean isSelfStreaming()Gets whether this user is streaming using "Go Live".- Returns:
true
if this user is streaming using "Go Live",false
otherwise.
-
isSelfVideoEnabled
public boolean isSelfVideoEnabled()Gets whether this user's camera is enabled.- Returns:
true
if this user's camera is enabled,false
otherwise.
-
isSuppressed
public boolean isSuppressed()Gets whether this user is muted by the current user.- Returns:
true
if this user is muted by the current user,false
otherwise.
-
getRequestedToSpeakAt
Gets the time at which the user requested to speak, if present.- Returns:
- The time at which the user requested to speak, if present.
-
toString
-