/** * Syncs all {@link net.dv8tion.jda.core.entities.PermissionOverride PermissionOverrides} of this Channel with * its parent ({@link net.dv8tion.jda.core.entities.Category Category}). * * <p>After this operation, all {@link net.dv8tion.jda.core.entities.PermissionOverride PermissionOverrides} * will be exactly the same as the ones from the parent. * <br><b>That means that all current PermissionOverrides are lost!</b> * * <p>This behaves as if calling {@link #sync(Channel)} with this Channel's {@link net.dv8tion.jda.core.entities.Channel#getParent() Parent}. * * @throws java.lang.IllegalStateException * If this Channel has no parent * @throws net.dv8tion.jda.core.exceptions.InsufficientPermissionException * If the currently logged in account does not have {@link net.dv8tion.jda.core.Permission#MANAGE_PERMISSIONS Permission.MANAGE_PERMISSIONS} * in this channel * * @return ChannelManager for chaining convenience * * @see <a href="https://discordapp.com/developers/docs/topics/permissions#permission-syncing" target="_blank">Discord Documentation - Permission Syncing</a> */ @CheckReturnValue public ChannelManager sync() { if(getChannel().getParent() == null) throw new IllegalStateException("sync() requires a parent category"); return sync(getChannel().getParent()); }