public final class VoiceState extends Object implements DiscordObject
Constructor and Description |
---|
VoiceState(GatewayDiscordClient gateway,
discord4j.discordjson.json.VoiceStateData data)
Constructs a
VoiceState with an associated ServiceMediator and Discord data. |
Modifier and Type | Method and Description |
---|---|
Mono<VoiceChannel> |
getChannel()
Requests to retrieve the channel this user is connected to, if present.
|
Mono<VoiceChannel> |
getChannel(EntityRetrievalStrategy retrievalStrategy)
Requests to retrieve the channel this user is connected to, if present, using the given retrieval strategy.
|
Optional<Snowflake> |
getChannelId()
Gets the channel ID this user is connected to, if present.
|
GatewayDiscordClient |
getClient()
Returns the
GatewayDiscordClient that created this object. |
Mono<Guild> |
getGuild()
Requests to retrieve the guild this voice state is for.
|
Mono<Guild> |
getGuild(EntityRetrievalStrategy retrievalStrategy)
Requests to retrieve the guild this voice state is for, using the given retrieval strategy.
|
Snowflake |
getGuildId()
Gets the guild ID this voice state is for.
|
Mono<Member> |
getMember()
Requests to retrieve the member this voice state is for.
|
Mono<Member> |
getMember(EntityRetrievalStrategy retrievalStrategy)
Requests to retrieve the member this voice state is for, using the given retrieval strategy.
|
String |
getSessionId()
Gets the session ID for this voice state.
|
Mono<User> |
getUser()
Requests to retrieve the user this voice state is for.
|
Mono<User> |
getUser(EntityRetrievalStrategy retrievalStrategy)
Requests to retrieve the user this voice state is for, using the given retrieval strategy.
|
Snowflake |
getUserId()
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 |
isSelfDeaf()
Gets whether this user is locally deafened.
|
boolean |
isSelfMuted()
Gets whether this user is locally muted.
|
boolean |
isSelfStreaming()
Gets whether this user is streaming using "Go Live".
|
boolean |
isSelfVideoEnabled()
Gets whether this user's camera is enabled.
|
boolean |
isSuppressed()
Gets whether this user is muted by the current user.
|
String |
toString() |
public VoiceState(GatewayDiscordClient gateway, discord4j.discordjson.json.VoiceStateData data)
VoiceState
with an associated ServiceMediator and Discord data.gateway
- The GatewayDiscordClient
associated to this object, must be non-null.data
- The raw data as represented by Discord, must be non-null.public GatewayDiscordClient getClient()
DiscordObject
GatewayDiscordClient
that created this object. Methods in it are exclusively based on the
entity cache or Store
in use. Refer to calling getClient().rest()
to access a
DiscordClient
that is capable of requesting entities directly from the REST API.getClient
in interface DiscordObject
GatewayDiscordClient
associated to this object.public Snowflake getGuildId()
public Mono<Guild> getGuild(EntityRetrievalStrategy retrievalStrategy)
public Optional<Snowflake> getChannelId()
public Mono<VoiceChannel> getChannel()
Mono
where, upon successful completion, emits the VoiceChannel
this user is connected
to, if present. If an error is received, it is emitted through the Mono
.public Mono<VoiceChannel> getChannel(EntityRetrievalStrategy retrievalStrategy)
retrievalStrategy
- the strategy to use to get the channelMono
where, upon successful completion, emits the VoiceChannel
this user is connected
to, if present. If an error is received, it is emitted through the Mono
.public Snowflake getUserId()
public Mono<User> getUser(EntityRetrievalStrategy retrievalStrategy)
public Mono<Member> getMember(EntityRetrievalStrategy retrievalStrategy)
public String getSessionId()
public boolean isDeaf()
true
if the user is deafened by the server, false
otherwise.public boolean isMuted()
true
if the user is deafened by the server, false
otherwise.public boolean isSelfDeaf()
true
if this user is locally deafened, false
otherwise.public boolean isSelfMuted()
true
if this user is locally muted, false
otherwise.public boolean isSelfStreaming()
true
if this user is streaming using "Go Live", false
otherwise.public boolean isSelfVideoEnabled()
true
if this user's camera is enabled, false
otherwise.public boolean isSuppressed()
true
if this user is muted by the current user, false
otherwise.