net.dv8tion.jda.api.entities.channel.attribute.ICopyableChannel Maven / Gradle / Ivy
Show all versions of JDA Show documentation
/*
* Copyright 2015 Austin Keener, Michael Ritter, Florian Spieß, and the JDA contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package net.dv8tion.jda.api.entities.channel.attribute;
import net.dv8tion.jda.api.entities.Guild;
import net.dv8tion.jda.api.entities.channel.middleman.GuildChannel;
import net.dv8tion.jda.api.requests.restaction.ChannelAction;
import javax.annotation.CheckReturnValue;
import javax.annotation.Nonnull;
/**
* Represents a GuildChannel that is capable of being copied.
*
* Please see {@link ICopyableChannel#createCopy()} for information on what is copied.
*/
public interface ICopyableChannel extends GuildChannel
{
/**
* Creates a copy of the specified {@link GuildChannel GuildChannel}
* in the specified {@link net.dv8tion.jda.api.entities.Guild Guild}.
*
If the provided target guild is not the same Guild this channel is in then
* the parent category and permissions will not be copied due to technical difficulty and ambiguity.
*
*
This copies the following elements:
*
* - Name
* - Parent Category (if present)
* - Voice Elements (Bitrate, Userlimit)
* - Text Elements (Topic, NSFW, Slowmode)
* - All permission overrides for Members/Roles
*
*
* Possible {@link net.dv8tion.jda.api.requests.ErrorResponse ErrorResponses} caused by
* the returned {@link net.dv8tion.jda.api.requests.RestAction RestAction} include the following:
*
* - {@link net.dv8tion.jda.api.requests.ErrorResponse#MISSING_PERMISSIONS MISSING_PERMISSIONS}
*
The channel could not be created due to a permission discrepancy
*
* - {@link net.dv8tion.jda.api.requests.ErrorResponse#MISSING_ACCESS MISSING_ACCESS}
*
The {@link net.dv8tion.jda.api.Permission#VIEW_CHANNEL VIEW_CHANNEL} permission was removed
*
*
* @param guild
* The {@link net.dv8tion.jda.api.entities.Guild Guild} to create the channel in
*
* @throws java.lang.IllegalArgumentException
* If the provided guild is {@code null}
* @throws net.dv8tion.jda.api.exceptions.PermissionException
* If the currently logged in account does not have the {@link net.dv8tion.jda.api.Permission#MANAGE_CHANNEL MANAGE_CHANNEL} Permission
*
* @return A specific {@link ChannelAction ChannelAction}
*
This action allows to set fields for the new GuildChannel before creating it!
*/
@Nonnull
@CheckReturnValue
ChannelAction extends ICopyableChannel> createCopy(@Nonnull Guild guild);
/**
* Creates a copy of the specified {@link GuildChannel GuildChannel}.
*
* This copies the following elements:
*
* - Name
* - Parent Category (if present)
* - Voice Elements (Bitrate, Userlimit)
* - Text Elements (Topic, NSFW, Slowmode)
* - All permission overrides for Members/Roles
*
*
* Possible {@link net.dv8tion.jda.api.requests.ErrorResponse ErrorResponses} caused by
* the returned {@link net.dv8tion.jda.api.requests.RestAction RestAction} include the following:
*
* - {@link net.dv8tion.jda.api.requests.ErrorResponse#MISSING_PERMISSIONS MISSING_PERMISSIONS}
*
The channel could not be created due to a permission discrepancy
*
* - {@link net.dv8tion.jda.api.requests.ErrorResponse#MISSING_ACCESS MISSING_ACCESS}
*
The {@link net.dv8tion.jda.api.Permission#VIEW_CHANNEL VIEW_CHANNEL} permission was removed
*
*
* @throws net.dv8tion.jda.api.exceptions.PermissionException
* If the currently logged in account does not have the {@link net.dv8tion.jda.api.Permission#MANAGE_CHANNEL MANAGE_CHANNEL} Permission
*
* @return A specific {@link ChannelAction ChannelAction}
*
This action allows to set fields for the new GuildChannel before creating it!
*/
@Nonnull
@CheckReturnValue
ChannelAction extends ICopyableChannel> createCopy();
}