Example: + *
{@code + * Role role = guild.getPublicRole(); + * EnumSet+ * * @param target * The not-null {@link net.dv8tion.jda.core.entities.Role Role} or {@link net.dv8tion.jda.core.entities.Member Member} for the override * @param allow @@ -182,10 +190,11 @@ public ChannelAction setNSFW(boolean nsfw) * The denied {@link net.dv8tion.jda.core.Permission Permissions} for the override or null * * @throws java.lang.IllegalArgumentException - * If the specified {@link net.dv8tion.jda.core.entities.Role Role} is null - * or not within the same guild. + * If the specified target is null or not within the same guild. * * @return The current ChannelAction, for chaining convenience + * + * @see java.util.EnumSet */ @CheckReturnValue public ChannelAction addPermissionOverride(IPermissionHolder target, Collectionallow = EnumSet.of(Permission.MESSAGE_READ); + * EnumSet deny = EnumSet.of(Permission.MESSAGE_WRITE); + * channelAction.addPermissionOverride(role, allow, deny); + * }
Example: + *
{@code + * Role role = guild.getPublicRole(); + * long allow = Permission.MESSAGE_READ.getRawValue(); + * long deny = Permission.MESSAGE_WRITE.getRawValue() | Permission.MESSAGE_ADD_REACTION.getRawValue(); + * channelAction.addPermissionOverride(role, allow, deny); + * }+ * * @param target - * The not-null {@link net.dv8tion.jda.core.entities.Role Role} for the override + * The not-null {@link net.dv8tion.jda.core.entities.Role Role} or {@link net.dv8tion.jda.core.entities.Member Member} for the override * @param allow * The granted {@link net.dv8tion.jda.core.Permission Permissions} for the override * Use {@link net.dv8tion.jda.core.Permission#getRawValue()} to retrieve these Permissions. @@ -213,7 +230,7 @@ public ChannelAction addPermissionOverride(IPermissionHolder target, Collection< * * @throws java.lang.IllegalArgumentException *