public final class Category extends Object
Channel.Type
Constructor and Description |
---|
Category(ServiceMediator serviceMediator,
ChannelBean data)
Constructs an
Category 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<Void> |
delete(String reason)
Requests to delete this channel while optionally specifying a reason.
|
Mono<Category> |
edit(Consumer<? super CategoryEditSpec> spec)
Requests to edit this category.
|
boolean |
equals(Object obj) |
Flux<GuildChannel> |
getChannels()
Requests to retrieve the channels residing in this category.
|
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.
|
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 |
hashCode() |
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
addMemberOverwrite, addRoleOverwrite
delete, delete, getMention, getType
getClient
public Category(ServiceMediator serviceMediator, ChannelBean data)
Category
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 Flux<GuildChannel> getChannels()
public Mono<Category> edit(Consumer<? super CategoryEditSpec> spec)
spec
- A Consumer
that provides a "blank" CategoryEditSpec
to be operated on.Mono
where, upon successful completion, emits the edited Category
. 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