public final class VoiceChannel extends Object implements Categorizable, Invitable
Channel.Type
Constructor and Description |
---|
VoiceChannel(ServiceMediator serviceMediator,
ChannelBean data)
Constructs an
VoiceChannel with an associated ServiceMediator and Discord data. |
Modifier and Type | Method and Description |
---|---|
Mono<Void> |
addMemberOverwrite(Snowflake memberId,
PermissionOverwrite overwrite,
String reason)
Requests to add a permission overwrite for the given member while optionally specifying a reason.
|
Mono<Void> |
addRoleOverwrite(Snowflake roleId,
PermissionOverwrite overwrite,
String reason)
Requests to add a permission overwrite for the given role while optionally specifying a reason.
|
Mono<ExtendedInvite> |
createInvite(Consumer<? super InviteCreateSpec> spec)
Requests to create an invite.
|
Mono<Void> |
delete(String reason)
Requests to delete this channel while optionally specifying a reason.
|
Mono<VoiceChannel> |
edit(Consumer<? super VoiceChannelEditSpec> spec)
Requests to edit a voice channel.
|
boolean |
equals(Object obj) |
int |
getBitrate()
Gets the bitrate (in bits) for this voice channel.
|
Mono<Category> |
getCategory()
Requests to retrieve the category for this channel, if present.
|
Optional<Snowflake> |
getCategoryId()
Gets the ID of the category for this channel, if present.
|
DiscordClient |
getClient()
Gets the DiscordClient associated to this object.
|
Mono<PermissionSet> |
getEffectivePermissions(Snowflake memberId)
Gets the permissions for the given member, taking into account permission overwrites in this channel.
|
Mono<Guild> |
getGuild()
Requests to retrieve the guild this channel is associated to.
|
Snowflake |
getGuildId()
Gets the ID of the guild this channel is associated to.
|
Snowflake |
getId()
Gets the Snowflake that uniquely identifies this entity.
|
Flux<ExtendedInvite> |
getInvites()
Requests to retrieve this channel's invites.
|
String |
getName()
Gets the name of the channel.
|
Optional<ExtendedPermissionOverwrite> |
getOverwriteForMember(Snowflake memberId)
Gets the permission overwrite targeting the given member.
|
Optional<ExtendedPermissionOverwrite> |
getOverwriteForRole(Snowflake roleId)
Gets the permission overwrite targeting the given role.
|
Set<ExtendedPermissionOverwrite> |
getPermissionOverwrites()
Gets the permission overwrites for this channel.
|
Mono<Integer> |
getPosition()
Requests to retrieve the position of the channel relative to other channels in the guild.
|
int |
getRawPosition()
Gets the raw position of the channel as exposed by Discord.
|
Channel.Type |
getType()
Gets the type of channel.
|
int |
getUserLimit()
Gets the user limit of this voice channel.
|
Flux<VoiceState> |
getVoiceStates()
Requests to retrieve the voice states of this voice channel.
|
int |
hashCode() |
Mono<VoiceConnection> |
join(Consumer<? super VoiceChannelJoinSpec> spec)
Requests to the join this voice channel.
|
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
addMemberOverwrite, addRoleOverwrite
delete, delete, getMention, getType
getClient
public VoiceChannel(ServiceMediator serviceMediator, ChannelBean data)
VoiceChannel
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 Optional<Snowflake> getCategoryId()
Categorizable
getCategoryId
in interface Categorizable
public Mono<Category> getCategory()
Categorizable
getCategory
in interface Categorizable
Mono
where, upon successful completion, emits the category
this channel, if
present. If an error is received, it is emitted through the Mono
.public Mono<ExtendedInvite> createInvite(Consumer<? super InviteCreateSpec> spec)
Invitable
createInvite
in interface Invitable
spec
- A Consumer
that provides a "blank" InviteCreateSpec
to be operated on.Mono
where, upon successful completion, emits the created ExtendedInvite
. If an error
is received, it is emitted through the Mono
.public Flux<ExtendedInvite> getInvites()
Invitable
getInvites
in interface Invitable
Flux
that continually emits this channel's invites
. If an error is
received, it is emitted through the Flux
.public int getBitrate()
public int getUserLimit()
public Mono<VoiceChannel> edit(Consumer<? super VoiceChannelEditSpec> spec)
spec
- A Consumer
that provides a "blank" VoiceChannelEditSpec
to be operated on.Mono
where, upon successful completion, emits the edited VoiceChannel
. If an error is
received, it is emitted through the Mono
.public Flux<VoiceState> getVoiceStates()
Flux
that continually emits the voice states
of this voice channel. If an
error is received, it is emitted through the Flux
.store
does not save
VoiceStateBean
instances OR the bot is currently not logged in then the returned Flux
will
always be empty.public Mono<VoiceConnection> join(Consumer<? super VoiceChannelJoinSpec> spec)
spec
- A Consumer
that provides a "blank" VoiceChannelJoinSpec
to be operated on.Mono
where, upon successful completion, emits a VoiceConnection
, indicating a
connection to the channel has been established. If an error is received, it is emitted through the Mono
.public String toString()
public final Snowflake getGuildId()
GuildChannel
getGuildId
in interface GuildChannel
public final Mono<Guild> getGuild()
GuildChannel
getGuild
in interface GuildChannel
Mono
where, upon successful completion, emits the guild
this channel is
associated to. If an error is received, it is emitted through the Mono
.public final Set<ExtendedPermissionOverwrite> getPermissionOverwrites()
GuildChannel
getPermissionOverwrites
in interface GuildChannel
public Optional<ExtendedPermissionOverwrite> getOverwriteForMember(Snowflake memberId)
GuildChannel
getOverwriteForMember
in interface GuildChannel
memberId
- The ID of the member to get the overwrite for.public Optional<ExtendedPermissionOverwrite> getOverwriteForRole(Snowflake roleId)
GuildChannel
getOverwriteForRole
in interface GuildChannel
roleId
- The ID of the role to get the overwrite for.public Mono<PermissionSet> getEffectivePermissions(Snowflake memberId)
GuildChannel
getEffectivePermissions
in interface GuildChannel
memberId
- The ID of the member to get permissions for.public final String getName()
GuildChannel
getName
in interface GuildChannel
public int getRawPosition()
GuildChannel
getRawPosition
in interface GuildChannel
public final Mono<Integer> getPosition()
GuildChannel
getPosition
in interface GuildChannel
Mono
where, upon successful completion, emits the position of the channel. If an error is
received, it is emitted through the Mono
.public Mono<Void> addMemberOverwrite(Snowflake memberId, PermissionOverwrite overwrite, @Nullable String reason)
GuildChannel
addMemberOverwrite
in interface GuildChannel
memberId
- The ID of the member to add the overwrite for.overwrite
- The overwrite to add.reason
- The reason, if present.Mono
where, upon successful completion, emits nothing; indicating the guild has been deleted.
If an error is received, it is emitted through the Mono
.public Mono<Void> addRoleOverwrite(Snowflake roleId, PermissionOverwrite overwrite, @Nullable String reason)
GuildChannel
addRoleOverwrite
in interface GuildChannel
roleId
- The ID of the role to add the overwrite for.overwrite
- The overwrite to add.reason
- The reason, if present.Mono
where, upon successful completion, emits nothing; indicating the guild has been deleted.
If an error is received, it is emitted through the Mono
.public final DiscordClient getClient()
DiscordObject
getClient
in interface DiscordObject
public final Snowflake getId()
Entity
public final Channel.Type getType()
Channel
public final Mono<Void> delete(@Nullable String reason)
Channel