Interface IPermissionContainer
- All Superinterfaces:
Channel
,Comparable<GuildChannel>
,Formattable
,GuildChannel
,IMentionable
,ISnowflake
- All Known Subinterfaces:
AudioChannel
,AudioChannelUnion
,Category
,DefaultGuildChannelUnion
,ForumChannel
,ICategorizableChannel
,IPermissionContainerUnion
,IPostContainer
,IThreadContainer
,IThreadContainerUnion
,MediaChannel
,NewsChannel
,StageChannel
,StandardGuildChannel
,StandardGuildMessageChannel
,TextChannel
,VoiceChannel
Represents a
GuildChannel
that uses Permission Overrides
.
Channels that implement this interface can override permissions for specific users or roles.
- See Also:
-
Field Summary
Fields inherited from interface net.dv8tion.jda.api.entities.channel.Channel
MAX_NAME_LENGTH
Fields inherited from interface net.dv8tion.jda.api.entities.channel.middleman.GuildChannel
JUMP_URL
-
Method Summary
Modifier and TypeMethodDescriptionReturns theChannelManager
for this GuildChannel.default @Unmodifiable List<PermissionOverride>
getPermissionOverride
(IPermissionHolder permissionHolder) @Unmodifiable List<PermissionOverride>
Gets all of thePermissionOverrides
that are part of thisGuildChannel
.default @Unmodifiable List<PermissionOverride>
upsertPermissionOverride
(IPermissionHolder permissionHolder) Creates a new override or updates an existing one.Methods inherited from interface net.dv8tion.jda.api.entities.channel.Channel
formatTo, getAsMention, getFlags, getJDA, getName, getType
Methods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface net.dv8tion.jda.api.entities.channel.middleman.GuildChannel
delete, getGuild, getJumpUrl, getPermissionContainer
Methods inherited from interface net.dv8tion.jda.api.entities.ISnowflake
getId, getIdLong, getTimeCreated
-
Method Details
-
getManager
Description copied from interface:GuildChannel
Returns theChannelManager
for this GuildChannel.
In the ChannelManager, you can modify the name, topic and position of this GuildChannel. You modify multiple fields in one request by chaining setters before callingRestAction.queue()
.- Specified by:
getManager
in interfaceGuildChannel
- Returns:
- The ChannelManager of this GuildChannel
-
getPermissionOverride
ThePermissionOverride
relating to the specifiedMember
orRole
. If there is noPermissionOverride
for thisGuildChannel
relating to the provided Member or Role, then this returnsnull
.- Parameters:
permissionHolder
- TheMember
orRole
whosePermissionOverride
is requested.- Returns:
- Possibly-null
PermissionOverride
relating to the provided Member or Role. - Throws:
IllegalArgumentException
- If the provided permission holder is null, or from a different guild
-
getPermissionOverrides
Gets all of thePermissionOverrides
that are part of thisGuildChannel
.
This combinesMember
andRole
overrides. If you would like onlyMember
overrides or onlyRole
overrides, usegetMemberPermissionOverrides()
orgetRolePermissionOverrides()
respectively.This requires
CacheFlag.MEMBER_OVERRIDES
to be enabled! Without that CacheFlag, this list will only contain overrides for the currently logged in account and roles.- Returns:
- Possibly-empty immutable list of all
PermissionOverrides
for thisGuildChannel
.
-
getMemberPermissionOverrides
Gets all of theMember
PermissionOverrides
that are part of thisGuildChannel
.This requires
CacheFlag.MEMBER_OVERRIDES
to be enabled!- Returns:
- Possibly-empty immutable list of all
PermissionOverrides
forMember
for thisGuildChannel
.
-
getRolePermissionOverrides
- Returns:
- Possibly-empty immutable list of all
PermissionOverrides
forRoles
for thisGuildChannel
.
-
upsertPermissionOverride
@Nonnull @CheckReturnValue PermissionOverrideAction upsertPermissionOverride(@Nonnull IPermissionHolder permissionHolder) Creates a new override or updates an existing one.
This is similar to callingPermissionOverride.getManager()
if an override exists.- Parameters:
permissionHolder
- The Member/Role for the override- Returns:
PermissionOverrideAction
With the current settings of an existing override or a fresh override with no permissions set- Throws:
InsufficientPermissionException
- If we don't have the permission toMANAGE_PERMISSIONS
IllegalArgumentException
- If the provided permission holder is null or not from this guild- See Also:
-