Interface ICopyableChannel
- All Superinterfaces:
Channel
,Comparable<GuildChannel>
,Formattable
,GuildChannel
,IMentionable
,ISnowflake
- All Known Subinterfaces:
AudioChannel
,AudioChannelUnion
,Category
,DefaultGuildChannelUnion
,ForumChannel
,MediaChannel
,NewsChannel
,StageChannel
,StandardGuildChannel
,StandardGuildMessageChannel
,TextChannel
,VoiceChannel
Represents a GuildChannel that is capable of being copied.
Please see createCopy()
for information on what is copied.
-
Field Summary
Fields inherited from interface net.dv8tion.jda.api.entities.channel.Channel
MAX_NAME_LENGTH
Fields inherited from interface net.dv8tion.jda.api.entities.channel.middleman.GuildChannel
JUMP_URL
-
Method Summary
Modifier and TypeMethodDescriptionChannelAction<? extends ICopyableChannel>
Creates a copy of the specifiedGuildChannel
.ChannelAction<? extends ICopyableChannel>
createCopy
(Guild guild) Creates a copy of the specifiedGuildChannel
in the specifiedGuild
.Methods inherited from interface net.dv8tion.jda.api.entities.channel.Channel
formatTo, getAsMention, getFlags, getJDA, getName, getType
Methods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface net.dv8tion.jda.api.entities.channel.middleman.GuildChannel
delete, getGuild, getJumpUrl, getManager, getPermissionContainer
Methods inherited from interface net.dv8tion.jda.api.entities.ISnowflake
getId, getIdLong, getTimeCreated
-
Method Details
-
createCopy
@Nonnull @CheckReturnValue ChannelAction<? extends ICopyableChannel> createCopy(@Nonnull Guild guild) Creates a copy of the specifiedGuildChannel
in the specifiedGuild
.
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
ErrorResponses
caused by the returnedRestAction
include the following:MISSING_PERMISSIONS
The channel could not be created due to a permission discrepancyMISSING_ACCESS
TheVIEW_CHANNEL
permission was removed
- Parameters:
guild
- TheGuild
to create the channel in- Returns:
- A specific
ChannelAction
This action allows to set fields for the new GuildChannel before creating it! - Throws:
IllegalArgumentException
- If the provided guild isnull
PermissionException
- If the currently logged in account does not have theMANAGE_CHANNEL
Permission
-
createCopy
Creates a copy of the specifiedGuildChannel
.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
ErrorResponses
caused by the returnedRestAction
include the following:MISSING_PERMISSIONS
The channel could not be created due to a permission discrepancyMISSING_ACCESS
TheVIEW_CHANNEL
permission was removed
- Returns:
- A specific
ChannelAction
This action allows to set fields for the new GuildChannel before creating it! - Throws:
PermissionException
- If the currently logged in account does not have theMANAGE_CHANNEL
Permission
-