Package net.dv8tion.jda.api.entities
Interface BaseGuildMessageChannel
- All Superinterfaces:
Channel,Comparable<GuildChannel>,Formattable,GuildChannel,GuildMessageChannel,ICategorizableChannel,ICopyableChannel,IInviteContainer,IMemberContainer,IMentionable,IPermissionContainer,IPositionableChannel,ISnowflake,IThreadContainer,MessageChannel
- All Known Subinterfaces:
NewsChannel,TextChannel
public interface BaseGuildMessageChannel
extends GuildMessageChannel, IThreadContainer, GuildChannel, ICategorizableChannel, ICopyableChannel, IPermissionContainer, IMemberContainer, IInviteContainer, IPositionableChannel
Represents a standard
These are the "normal" message channels that are present in the channel sidebar. These are not
Guild MessageChannel.
These are the "normal" message channels that are present in the channel sidebar. These are not
ThreadChannels.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionChannelAction<? extends BaseGuildMessageChannel>Creates a copy of the specifiedGuildChannel.ChannelAction<? extends BaseGuildMessageChannel>createCopy(Guild guild) Creates a copy of the specifiedGuildChannelin the specifiedGuild.createWebhook(String name) Creates a newWebhook.Deletes aWebhookattached to this channel by theidspecified.Returns theChannelManagerfor this GuildChannel.getTopic()The topic set for this TextChannel.booleanisNSFW()Whether or not this channel is considered as "NSFW" (Not-Safe-For-Work)Retrieves theWebhooksattached to this TextChannel.Methods 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
-
Method Details
-
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 interfaceGuildChannel- Specified by:
getManagerin interfaceICategorizableChannel- Specified by:
getManagerin interfaceIPermissionContainer- Specified by:
getManagerin interfaceIPositionableChannel- Returns:
- The ChannelManager of this GuildChannel
-
getTopic
The topic set for this TextChannel.
If no topic has been set, this returns null.- Returns:
- Possibly-null String containing the topic of this TextChannel.
-
isNSFW
boolean isNSFW()Whether or not this channel is considered as "NSFW" (Not-Safe-For-Work)- Returns:
- True, If this TextChannel is considered NSFW by the official Discord Client
-
retrieveWebhooks
Retrieves theWebhooksattached to this TextChannel.Possible ErrorResponses include:
UNKNOWN_CHANNEL
if this channel was deletedMISSING_ACCESS
if we were removed from the guild
- Returns:
RestAction- Type: List<Webhook>
Retrieved an immutable list of Webhooks attached to this channel
-
createWebhook
Creates a newWebhook.Possible
ErrorResponsescaused by the returnedRestActioninclude the following:MISSING_PERMISSIONS
The webhook could not be created due to a permission discrepancyMISSING_ACCESS
TheVIEW_CHANNELpermission was removedMAX_WEBHOOKS
If the channel already has reached the maximum capacity for webhooks
- Parameters:
name- The default name for the new Webhook.- Returns:
- A specific
WebhookAction
This action allows to set fields for the new webhook before creating it - Throws:
PermissionException- If you do not hold the permissionManage WebhooksIllegalArgumentException- If the provided name isnull, blank or not between 2-100 characters in length
-
deleteWebhookById
Deletes aWebhookattached to this channel by theidspecified.Possible ErrorResponses include:
ErrorResponse.UNKNOWN_WEBHOOK
The provided id does not refer to a WebHook present in this TextChannel, either due to it not existing or having already been deleted.UNKNOWN_CHANNEL
if this channel was deletedMISSING_ACCESS
if we were removed from the guildMISSING_PERMISSIONS
The send request was attempted after the account lostPermission.MANAGE_WEBHOOKSin the channel.
- Parameters:
id- The not-null id for the target Webhook.- Returns:
AuditableRestAction- Throws:
IllegalArgumentException- If the providedidisnullor empty.InsufficientPermissionException- If the currently logged in account does not havePermission.MANAGE_WEBHOOKSin this channel.
-
createCopy
@Nonnull @CheckReturnValue ChannelAction<? extends BaseGuildMessageChannel> createCopy(@Nonnull Guild guild) 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 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 interfaceICopyableChannel- Returns:
- A specific
ChannelAction
This action allows to set fields for the new GuildChannel before creating it!
-