Package net.dv8tion.jda.api.entities
Interface TextChannel
- All Superinterfaces:
BaseGuildMessageChannel,Channel,Comparable<GuildChannel>,Formattable,GuildChannel,GuildMessageChannel,ICategorizableChannel,ICopyableChannel,IInviteContainer,IMemberContainer,IMentionable,IPermissionContainer,IPositionableChannel,ISnowflake,IThreadContainer,MessageChannel
Represents a standard Discord Text GuildChannel.
Adds additional functionality and information for text channels in Discord, on top of the common functionality present in other guild message channels.
Adds additional functionality and information for text channels in Discord, on top of the common functionality present in other guild message channels.
This is a GuildChannel capable of sending messages.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe maximum duration of slowmode in seconds -
Method Summary
Modifier and TypeMethodDescriptiondefault ChannelAction<TextChannel>Creates a copy of the specifiedGuildChannel.createCopy(Guild guild) Creates a copy of the specifiedGuildChannelin the specifiedGuild.Returns theChannelManagerfor this GuildChannel.intThe slowmode set for this TextChannel.Methods inherited from interface net.dv8tion.jda.api.entities.BaseGuildMessageChannel
createWebhook, deleteWebhookById, getTopic, isNSFW, retrieveWebhooksMethods 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.GuildMessageChannel
canTalk, canTalk, clearReactionsById, clearReactionsById, clearReactionsById, clearReactionsById, clearReactionsById, clearReactionsById, deleteMessages, deleteMessagesByIds, removeReactionById, removeReactionById, removeReactionById, removeReactionByIdMethods inherited from interface net.dv8tion.jda.api.entities.ICategorizableChannel
getParentCategory, getParentCategoryId, getParentCategoryIdLong, isSyncedMethods inherited from interface net.dv8tion.jda.api.entities.IInviteContainer
createInvite, retrieveInvitesMethods inherited from interface net.dv8tion.jda.api.entities.IMemberContainer
getMembersMethods inherited from interface net.dv8tion.jda.api.entities.IPermissionContainer
createPermissionOverride, getMemberPermissionOverrides, getPermissionOverride, getPermissionOverrides, getRolePermissionOverrides, putPermissionOverride, upsertPermissionOverrideMethods inherited from interface net.dv8tion.jda.api.entities.IPositionableChannel
getPosition, getPositionRawMethods inherited from interface net.dv8tion.jda.api.entities.ISnowflake
getId, getIdLong, getTimeCreatedMethods inherited from interface net.dv8tion.jda.api.entities.IThreadContainer
createThreadChannel, createThreadChannel, createThreadChannel, createThreadChannel, getThreadChannels, retrieveArchivedPrivateJoinedThreadChannels, retrieveArchivedPrivateThreadChannels, retrieveArchivedPublicThreadChannelsMethods inherited from interface net.dv8tion.jda.api.entities.MessageChannel
addReactionById, addReactionById, addReactionById, addReactionById, deleteMessageById, deleteMessageById, editMessageById, editMessageById, editMessageById, editMessageById, editMessageComponentsById, editMessageComponentsById, editMessageComponentsById, editMessageComponentsById, editMessageEmbedsById, editMessageEmbedsById, editMessageEmbedsById, editMessageEmbedsById, editMessageFormatById, editMessageFormatById, getHistory, getHistoryAfter, getHistoryAfter, getHistoryAfter, getHistoryAround, getHistoryAround, getHistoryAround, getHistoryBefore, getHistoryBefore, getHistoryBefore, getHistoryFromBeginning, getIterableHistory, getLatestMessageId, getLatestMessageIdLong, hasLatestMessage, pinMessageById, pinMessageById, purgeMessages, purgeMessages, purgeMessagesById, purgeMessagesById, purgeMessagesById, removeReactionById, removeReactionById, removeReactionById, removeReactionById, retrieveMessageById, retrieveMessageById, retrievePinnedMessages, retrieveReactionUsersById, retrieveReactionUsersById, retrieveReactionUsersById, retrieveReactionUsersById, sendFile, sendFile, sendFile, sendFile, sendMessage, sendMessage, sendMessageEmbeds, sendMessageEmbeds, sendMessageFormat, sendTyping, unpinMessageById, unpinMessageById
-
Field Details
-
MAX_SLOWMODE
static final int MAX_SLOWMODEThe maximum duration of slowmode in seconds- See Also:
-
-
Method Details
-
getSlowmode
int getSlowmode()The slowmode set for this TextChannel.
If slowmode is set this returns anintbetween 1 andTextChannel.MAX_SLOWMODE.
If not set this returns0.Note bots are unaffected by this.
HavingMESSAGE_MANAGEorMANAGE_CHANNELpermission also grants immunity to slowmode.- Returns:
- The slowmode for this TextChannel, between 1 and
TextChannel.MAX_SLOWMODE, or0if no slowmode is set.
-
createCopy
Description copied from interface:ICopyableChannelCreates a copy of the specifiedGuildChannelin 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
ErrorResponsescaused by the returnedRestActioninclude the following:MISSING_PERMISSIONS
The channel could not be created due to a permission discrepancyMISSING_ACCESS
TheVIEW_CHANNELpermission was removed
- Specified by:
createCopyin interfaceBaseGuildMessageChannel- Specified by:
createCopyin interfaceICopyableChannel- Parameters:
guild- TheGuildto create the channel in- Returns:
- A specific
ChannelAction
This action allows to set fields for the new GuildChannel before creating it!
-
createCopy
Description copied from interface:ICopyableChannelCreates 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
ErrorResponsescaused by the returnedRestActioninclude the following:MISSING_PERMISSIONS
The channel could not be created due to a permission discrepancyMISSING_ACCESS
TheVIEW_CHANNELpermission was removed
- Specified by:
createCopyin interfaceBaseGuildMessageChannel- Specified by:
createCopyin interfaceICopyableChannel- Returns:
- A specific
ChannelAction
This action allows to set fields for the new GuildChannel before creating it!
-
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 interfaceBaseGuildMessageChannel- Specified by:
getManagerin interfaceGuildChannel- Specified by:
getManagerin interfaceICategorizableChannel- Specified by:
getManagerin interfaceIPermissionContainer- Specified by:
getManagerin interfaceIPositionableChannel- Returns:
- The ChannelManager of this GuildChannel
-