public final class VoiceState extends Object implements DiscordObject
Constructor and Description |
---|
VoiceState(ServiceMediator serviceMediator,
VoiceStateBean 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.
|
Optional<Snowflake> |
getChannelId()
Gets the channel ID this user is connected to, if present.
|
DiscordClient |
getClient()
Gets the DiscordClient associated to this object.
|
Mono<Guild> |
getGuild()
Requests to retrieve the guild this voice state is for.
|
Snowflake |
getGuildId()
Gets the guild ID this voice state is for.
|
String |
getSessionId()
Gets the session ID for this voice state.
|
Mono<User> |
getUser()
Requests to retrieve the user this voice state is for.
|
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 |
isSuppressed()
Gets whether this user is muted by the current user.
|
String |
toString() |
public VoiceState(ServiceMediator serviceMediator, VoiceStateBean data)
VoiceState
with an associated ServiceMediator and Discord data.serviceMediator
- The ServiceMediator associated to this object, must be non-null.data
- The raw data as represented by Discord, must be non-null.public DiscordClient getClient()
DiscordObject
getClient
in interface DiscordObject
public Snowflake getGuildId()
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 Snowflake getUserId()
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 isSuppressed()
true
if this user is muted by the current user, false
otherwise.