Package net.dv8tion.jda.api.entities
Interface IPermissionContainer
- All Superinterfaces:
Channel,Comparable<GuildChannel>,Formattable,GuildChannel,IMentionable,ISnowflake
- All Known Subinterfaces:
Category,DefaultGuildChannelUnion,ICategorizableChannel,IPermissionContainerUnion,IThreadContainer,IThreadContainerUnion,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:
-
Method Summary
Modifier and TypeMethodDescriptionReturns theChannelManagerfor this GuildChannel.default List<PermissionOverride>getPermissionOverride(IPermissionHolder permissionHolder) Gets all of thePermissionOverridesthat are part of thisGuildChannel.default List<PermissionOverride>upsertPermissionOverride(IPermissionHolder permissionHolder) Creates a new override or updates an existing one.Methods inherited from interface net.dv8tion.jda.api.entities.Channel
formatTo, getAsMention, getJDA, getName, getTypeMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface net.dv8tion.jda.api.entities.GuildChannel
delete, getGuild, getPermissionContainerMethods 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().This is a lazy idempotent getter. The manager is retained after the first call. This getter is not thread-safe and would require guards by the user.
- 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 guild
-
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.
-
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.
-
getRolePermissionOverrides
- Returns:
- Possibly-empty immutable list of all
PermissionOverridesforRolesfor 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_PERMISSIONSIllegalArgumentException- If the provided permission holder is null or not from this guild- See Also:
-