Interface GuildChannel
-
- All Superinterfaces:
Channel
,DiscordObject
,Entity
- All Known Subinterfaces:
CategorizableChannel
,GuildMessageChannel
,TopLevelGuildChannel
,TopLevelGuildMessageChannel
- All Known Implementing Classes:
Category
,NewsChannel
,StoreChannel
,TextChannel
,VoiceChannel
public interface GuildChannel extends Channel
A Discord channel associated to aGuild
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface discord4j.core.object.entity.channel.Channel
Channel.Type
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description default Mono<Void>
addMemberOverwrite(Snowflake memberId, PermissionOverwrite overwrite)
Deprecated.Threads don't have permission overwrites, so when they are released, this will be moved toTopLevelGuildChannel.addMemberOverwrite(Snowflake, PermissionOverwrite)
.Mono<Void>
addMemberOverwrite(Snowflake memberId, PermissionOverwrite overwrite, String reason)
Deprecated.Threads don't have permission overwrites, so when they are released, this will be moved toTopLevelGuildChannel.addMemberOverwrite(Snowflake, PermissionOverwrite, String)
.default Mono<Void>
addRoleOverwrite(Snowflake roleId, PermissionOverwrite overwrite)
Deprecated.Threads don't have permission overwrites, so when they are released, this will be moved toTopLevelGuildChannel.addRoleOverwrite(Snowflake, PermissionOverwrite)
.Mono<Void>
addRoleOverwrite(Snowflake roleId, PermissionOverwrite overwrite, String reason)
Deprecated.Threads don't have permission overwrites, so when they are released, this will be moved toTopLevelGuildChannel.addRoleOverwrite(Snowflake, PermissionOverwrite, String)
.Mono<PermissionSet>
getEffectivePermissions(Snowflake memberId)
Gets the permissions for the given member, taking into account permission overwrites in this channel.Mono<PermissionSet>
getEffectivePermissions(Member member)
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.Mono<Guild>
getGuild(EntityRetrievalStrategy retrievalStrategy)
Requests to retrieve the guild this channel is associated to, using the given retrieval strategy.Snowflake
getGuildId()
Gets the ID of the guild this channel is associated to.String
getName()
Gets the name of the channel.Optional<ExtendedPermissionOverwrite>
getOverwriteForMember(Snowflake memberId)
Deprecated.Threads don't have permission overwrites, so when they are released, this will be moved toTopLevelGuildChannel.getOverwriteForMember(Snowflake)
.Optional<ExtendedPermissionOverwrite>
getOverwriteForRole(Snowflake roleId)
Deprecated.Threads don't have permission overwrites, so when they are released, this will be moved toTopLevelGuildChannel.getOverwriteForRole(Snowflake)
.Set<ExtendedPermissionOverwrite>
getPermissionOverwrites()
Deprecated.Threads don't have permission overwrites, so when they are released, this will be moved toTopLevelGuildChannel.getPermissionOverwrites()
.Mono<Integer>
getPosition()
Deprecated.Threads don't have positions, so when they are released, this will be moved toTopLevelGuildChannel.getPosition()
.int
getRawPosition()
Deprecated.Threads don't have positions, so when they are released, this will be moved toTopLevelGuildChannel.getRawPosition()
.-
Methods inherited from interface discord4j.core.object.entity.channel.Channel
delete, delete, getMention, getRestChannel, getType
-
Methods inherited from interface discord4j.core.object.DiscordObject
getClient
-
-
-
-
Method Detail
-
getGuildId
Snowflake getGuildId()
Gets the ID of the guild this channel is associated to.- Returns:
- The ID of the guild this channel is associated to.
-
getGuild
Mono<Guild> getGuild(EntityRetrievalStrategy retrievalStrategy)
Requests to retrieve the guild this channel is associated to, using the given retrieval strategy.
-
getPermissionOverwrites
@Deprecated Set<ExtendedPermissionOverwrite> getPermissionOverwrites()
Deprecated.Threads don't have permission overwrites, so when they are released, this will be moved toTopLevelGuildChannel.getPermissionOverwrites()
.Gets the permission overwrites for this channel.- Returns:
- The permission overwrites for this channel.
-
getOverwriteForMember
@Deprecated Optional<ExtendedPermissionOverwrite> getOverwriteForMember(Snowflake memberId)
Deprecated.Threads don't have permission overwrites, so when they are released, this will be moved toTopLevelGuildChannel.getOverwriteForMember(Snowflake)
.Gets the permission overwrite targeting the given member.- Parameters:
memberId
- The ID of the member to get the overwrite for.- Returns:
- The permission overwrite targeting the given member.
-
getOverwriteForRole
@Deprecated Optional<ExtendedPermissionOverwrite> getOverwriteForRole(Snowflake roleId)
Deprecated.Threads don't have permission overwrites, so when they are released, this will be moved toTopLevelGuildChannel.getOverwriteForRole(Snowflake)
.Gets the permission overwrite targeting the given role.- Parameters:
roleId
- The ID of the role to get the overwrite for.- Returns:
- The permission overwrite targeting the given role.
-
getEffectivePermissions
Mono<PermissionSet> getEffectivePermissions(Snowflake memberId)
Gets the permissions for the given member, taking into account permission overwrites in this channel.- Parameters:
memberId
- The ID of the member to get permissions for.- Returns:
- The permissions for the given member.
-
getEffectivePermissions
Mono<PermissionSet> getEffectivePermissions(Member member)
Gets the permissions for the given member, taking into account permission overwrites in this channel.- Parameters:
member
- The member to get permissions for.- Returns:
- The permissions for the given member.
-
getName
String getName()
Gets the name of the channel.- Returns:
- The name of the channel.
-
getRawPosition
@Deprecated int getRawPosition()
Deprecated.Threads don't have positions, so when they are released, this will be moved toTopLevelGuildChannel.getRawPosition()
.Gets the raw position of the channel as exposed by Discord. This may or may not be accurate with relativity to other channels in the guild.- Returns:
- The raw position of the channel.
-
getPosition
@Deprecated Mono<Integer> getPosition()
Deprecated.Threads don't have positions, so when they are released, this will be moved toTopLevelGuildChannel.getPosition()
.Requests to retrieve the position of the channel relative to other channels in the guild.This is determined by the index of this channel in the
sorted
list of channels of the guild.Warning: Because this method must sort the guild channels, it is inefficient to make repeated invocations for the same set of channels (meaning that channels haven't been added or removed). For example, instead of writing:
guild.getChannels() .flatMap(c -> c.getPosition().map(pos -> c.getName() + " : " + pos))
guild.getChannels() .transform(OrderUtil::orderGuildChannels) .index((pos, c) -> c.getName() + " : " + pos)
- Returns:
- A
Mono
where, upon successful completion, emits the position of the channel. If an error is received, it is emitted through theMono
.
-
addMemberOverwrite
@Deprecated default Mono<Void> addMemberOverwrite(Snowflake memberId, PermissionOverwrite overwrite)
Deprecated.Threads don't have permission overwrites, so when they are released, this will be moved toTopLevelGuildChannel.addMemberOverwrite(Snowflake, PermissionOverwrite)
.Requests to add a permission overwrite for the given member.- Parameters:
memberId
- The ID of the member to add the overwrite for.overwrite
- The overwrite to add.- Returns:
- A
Mono
where, upon successful completion, emits nothing; If an error is received, it is emitted through theMono
.
-
addMemberOverwrite
@Deprecated Mono<Void> addMemberOverwrite(Snowflake memberId, PermissionOverwrite overwrite, @Nullable String reason)
Deprecated.Threads don't have permission overwrites, so when they are released, this will be moved toTopLevelGuildChannel.addMemberOverwrite(Snowflake, PermissionOverwrite, String)
.Requests to add a permission overwrite for the given member while optionally specifying a reason.- Parameters:
memberId
- The ID of the member to add the overwrite for.overwrite
- The overwrite to add.reason
- The reason, if present.- Returns:
- A
Mono
where, upon successful completion, emits nothing; If an error is received, it is emitted through theMono
.
-
addRoleOverwrite
@Deprecated default Mono<Void> addRoleOverwrite(Snowflake roleId, PermissionOverwrite overwrite)
Deprecated.Threads don't have permission overwrites, so when they are released, this will be moved toTopLevelGuildChannel.addRoleOverwrite(Snowflake, PermissionOverwrite)
.Requests to add a permission overwrite for the given role.- Parameters:
roleId
- The ID of the role to add the overwrite for.overwrite
- The overwrite to add.- Returns:
- A
Mono
where, upon successful completion, emits nothing; If an error is received, it is emitted through theMono
.
-
addRoleOverwrite
@Deprecated Mono<Void> addRoleOverwrite(Snowflake roleId, PermissionOverwrite overwrite, @Nullable String reason)
Deprecated.Threads don't have permission overwrites, so when they are released, this will be moved toTopLevelGuildChannel.addRoleOverwrite(Snowflake, PermissionOverwrite, String)
.Requests to add a permission overwrite for the given role while optionally specifying a reason.- Parameters:
roleId
- The ID of the role to add the overwrite for.overwrite
- The overwrite to add.reason
- The reason, if present.- Returns:
- A
Mono
where, upon successful completion, emits nothing; If an error is received, it is emitted through theMono
.
-
-