Interface IPermissionContainer
- All Superinterfaces:
Channel,Comparable<GuildChannel>,Formattable,GuildChannel,IDetachableEntity,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_LENGTHFields inherited from interface net.dv8tion.jda.api.entities.channel.middleman.GuildChannel
JUMP_URL -
Method Summary
Modifier and TypeMethodDescriptionReturns theChannelManagerfor this GuildChannel.default @Unmodifiable List<PermissionOverride>getPermissionOverride(IPermissionHolder permissionHolder) @Unmodifiable List<PermissionOverride>Gets all of thePermissionOverridesthat 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, getTypeMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface net.dv8tion.jda.api.entities.channel.middleman.GuildChannel
delete, getGuild, getJumpUrl, getPermissionContainerMethods inherited from interface net.dv8tion.jda.api.entities.detached.IDetachableEntity
isDetachedMethods inherited from interface net.dv8tion.jda.api.entities.ISnowflake
getId, getIdLong, getTimeCreated
-
Method Details
-
getManager
Description copied from interface:GuildChannelReturns theChannelManagerfor 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:
getManagerin interfaceGuildChannel- Returns:
- The ChannelManager of this GuildChannel
-
getPermissionOverride
ThePermissionOverriderelating to the specifiedMemberorRole. If there is noPermissionOverridefor thisGuildChannelrelating to the provided Member or Role, then this returnsnull.- Parameters:
permissionHolder- TheMemberorRolewhosePermissionOverrideis requested.- Returns:
- Possibly-null
PermissionOverriderelating to the provided Member or Role. - Throws:
IllegalArgumentException- If the provided permission holder is null, or from a different guildDetachedEntityException- If this entity isdetached
-
getPermissionOverrides
Gets all of thePermissionOverridesthat are part of thisGuildChannel.
This combinesMemberandRoleoverrides. If you would like onlyMemberoverrides or onlyRoleoverrides, usegetMemberPermissionOverrides()orgetRolePermissionOverrides()respectively.This requires
CacheFlag.MEMBER_OVERRIDESto 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
PermissionOverridesfor thisGuildChannel. - Throws:
DetachedEntityException- If this entity isdetached
-
getMemberPermissionOverrides
Gets all of theMemberPermissionOverridesthat are part of thisGuildChannel.This requires
CacheFlag.MEMBER_OVERRIDESto be enabled!- Returns:
- Possibly-empty immutable list of all
PermissionOverridesforMemberfor thisGuildChannel. - Throws:
DetachedEntityException- If this entity isdetached
-
getRolePermissionOverrides
- Returns:
- Possibly-empty immutable list of all
PermissionOverridesforRolesfor thisGuildChannel. - Throws:
DetachedEntityException- If this entity isdetached
-
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_PERMISSIONSIllegalArgumentException- If the provided permission holder is null or not from this guildDetachedEntityException- If this entity isdetached- See Also:
-