Package net.dv8tion.jda.api.entities
Interface NewsChannel
-
- All Superinterfaces:
BaseGuildMessageChannel
,Channel
,Comparable<GuildChannel>
,Formattable
,GuildChannel
,GuildMessageChannel
,ICategorizableChannel
,ICopyableChannel
,IInviteContainer
,IMemberContainer
,IMentionable
,IPermissionContainer
,IPositionableChannel
,ISnowflake
,IThreadContainer
,MessageChannel
public interface NewsChannel extends BaseGuildMessageChannel
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default ChannelAction<NewsChannel>
createCopy()
Creates a copy of the specifiedGuildChannel
.ChannelAction<NewsChannel>
createCopy(Guild guild)
Creates a copy of the specifiedGuildChannel
in the specifiedGuild
.default RestAction<Message>
crosspostMessageById(long messageId)
Attempts to crosspost the provided message.default RestAction<Message>
crosspostMessageById(String messageId)
Attempts to crosspost the provided message.default RestAction<Webhook.WebhookReference>
follow(long targetChannelId)
Subscribes to the crossposted messages in this channel.RestAction<Webhook.WebhookReference>
follow(String targetChannelId)
Subscribes to the crossposted messages in this channel.default RestAction<Webhook.WebhookReference>
follow(TextChannel targetChannel)
Subscribes to the crossposted messages in this channel.NewsChannelManager
getManager()
Returns theChannelManager
for this GuildChannel.-
Methods inherited from interface net.dv8tion.jda.api.entities.BaseGuildMessageChannel
createWebhook, deleteWebhookById, getTopic, isNSFW, retrieveWebhooks
-
Methods inherited from interface net.dv8tion.jda.api.entities.Channel
formatTo, getAsMention, getJDA, getName, getType
-
Methods inherited from interface java.lang.Comparable
compareTo
-
Methods inherited from interface net.dv8tion.jda.api.entities.GuildChannel
delete, getGuild, getPermissionContainer
-
Methods inherited from interface net.dv8tion.jda.api.entities.GuildMessageChannel
canTalk, canTalk, clearReactionsById, clearReactionsById, clearReactionsById, clearReactionsById, clearReactionsById, clearReactionsById, deleteMessages, deleteMessagesByIds, removeReactionById, removeReactionById, removeReactionById, removeReactionById
-
Methods inherited from interface net.dv8tion.jda.api.entities.ICategorizableChannel
getParentCategory, getParentCategoryId, getParentCategoryIdLong, isSynced
-
Methods inherited from interface net.dv8tion.jda.api.entities.IInviteContainer
createInvite, retrieveInvites
-
Methods inherited from interface net.dv8tion.jda.api.entities.IMemberContainer
getMembers
-
Methods inherited from interface net.dv8tion.jda.api.entities.IPermissionContainer
createPermissionOverride, getMemberPermissionOverrides, getPermissionOverride, getPermissionOverrides, getRolePermissionOverrides, putPermissionOverride, upsertPermissionOverride
-
Methods inherited from interface net.dv8tion.jda.api.entities.IPositionableChannel
getPosition, getPositionRaw
-
Methods inherited from interface net.dv8tion.jda.api.entities.ISnowflake
getId, getIdLong, getTimeCreated
-
Methods inherited from interface net.dv8tion.jda.api.entities.IThreadContainer
createThreadChannel, createThreadChannel, createThreadChannel, createThreadChannel, getThreadChannels, retrieveArchivedPrivateJoinedThreadChannels, retrieveArchivedPrivateThreadChannels, retrieveArchivedPublicThreadChannels
-
Methods 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 Detail
-
follow
@Nonnull @CheckReturnValue RestAction<Webhook.WebhookReference> follow(@Nonnull String targetChannelId)
Subscribes to the crossposted messages in this channel.
This will create aWebhook
of typeFOLLOWER
in the target channel.Possible
ErrorResponses
include:UNKNOWN_CHANNEL
If the target channel doesn't exist or is not visible to the currently logged in accountMISSING_PERMISSIONS
If the currently logged in account does not havePermission.MANAGE_WEBHOOKS
in the target channelMAX_WEBHOOKS
If the target channel already has reached the maximum capacity for webhooks
- Parameters:
targetChannelId
- The target channel id- Returns:
RestAction
- Throws:
IllegalArgumentException
- If null is provided- Since:
- 4.2.1
-
follow
@Nonnull @CheckReturnValue default RestAction<Webhook.WebhookReference> follow(long targetChannelId)
Subscribes to the crossposted messages in this channel.
This will create aWebhook
of typeFOLLOWER
in the target channel.Possible
ErrorResponses
include:UNKNOWN_CHANNEL
If the target channel doesn't exist or not visible to the currently logged in accountMISSING_PERMISSIONS
If the currently logged in account does not havePermission.MANAGE_WEBHOOKS
in the target channelMAX_WEBHOOKS
If the target channel already has reached the maximum capacity for webhooks
- Parameters:
targetChannelId
- The target channel id- Returns:
RestAction
- Since:
- 4.2.1
-
follow
@Nonnull @CheckReturnValue default RestAction<Webhook.WebhookReference> follow(@Nonnull TextChannel targetChannel)
Subscribes to the crossposted messages in this channel.
This will create aWebhook
of typeFOLLOWER
in the target channel.Possible
ErrorResponses
include:UNKNOWN_CHANNEL
If the target channel doesn't exist or not visible to the currently logged in accountMISSING_PERMISSIONS
If the currently logged in account does not havePermission.MANAGE_WEBHOOKS
in the target channelMAX_WEBHOOKS
If the target channel already has reached the maximum capacity for webhooks
- Parameters:
targetChannel
- The target channel- Returns:
RestAction
- Throws:
InsufficientPermissionException
- If the currently logged in account does not havePermission.MANAGE_WEBHOOKS
in the target channel.IllegalArgumentException
- If null is provided- Since:
- 4.2.1
-
crosspostMessageById
@Nonnull @CheckReturnValue default RestAction<Message> crosspostMessageById(@Nonnull String messageId)
Attempts to crosspost the provided message.The following
ErrorResponses
are possible:ALREADY_CROSSPOSTED
The target message has already been crossposted.MISSING_ACCESS
The request was attempted after the account lost access to theGuild
typically due to being kicked or removed, or afterPermission.VIEW_CHANNEL
was revoked in theTextChannel
MISSING_PERMISSIONS
The request was attempted after the account lostPermission.MESSAGE_MANAGE
in the TextChannel.UNKNOWN_MESSAGE
The providedmessageId
is unknown in this MessageChannel, either due to the id being invalid, or the message it referred to has already been deleted.UNKNOWN_CHANNEL
The request was attempted after the channel was deleted.
- Parameters:
messageId
- The messageId to crosspost- Returns:
RestAction
- Type:Message
- Throws:
IllegalArgumentException
- If providedmessageId
isnull
or empty.InsufficientPermissionException
- If the currently logged in account does not havePermission.VIEW_CHANNEL
in this channel.- Since:
- 4.2.1
-
crosspostMessageById
@Nonnull @CheckReturnValue default RestAction<Message> crosspostMessageById(long messageId)
Attempts to crosspost the provided message.The following
ErrorResponses
are possible:ALREADY_CROSSPOSTED
The target message has already been crossposted.MISSING_ACCESS
The request was attempted after the account lost access to theGuild
typically due to being kicked or removed, or afterPermission.VIEW_CHANNEL
was revoked in theTextChannel
MISSING_PERMISSIONS
The request was attempted after the account lostPermission.MESSAGE_MANAGE
in the TextChannel.UNKNOWN_MESSAGE
The providedmessageId
is unknown in this MessageChannel, either due to the id being invalid, or the message it referred to has already been deleted.UNKNOWN_CHANNEL
The request was attempted after the channel was deleted.
- Parameters:
messageId
- The messageId to crosspost- Returns:
RestAction
- Type:Message
- Throws:
InsufficientPermissionException
- If the currently logged in account does not havePermission.VIEW_CHANNEL
in this channel.- Since:
- 4.2.1
-
createCopy
@Nonnull ChannelAction<NewsChannel> createCopy(@Nonnull Guild guild)
Description copied from interface:ICopyableChannel
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
- Specified by:
createCopy
in interfaceBaseGuildMessageChannel
- Specified by:
createCopy
in interfaceICopyableChannel
- 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!
-
createCopy
@Nonnull default ChannelAction<NewsChannel> createCopy()
Description copied from interface:ICopyableChannel
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
- Specified by:
createCopy
in interfaceBaseGuildMessageChannel
- Specified by:
createCopy
in interfaceICopyableChannel
- Returns:
- A specific
ChannelAction
This action allows to set fields for the new GuildChannel before creating it!
-
getManager
@Nonnull NewsChannelManager getManager()
Description copied from interface:GuildChannel
Returns theChannelManager
for 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:
getManager
in interfaceBaseGuildMessageChannel
- Specified by:
getManager
in interfaceGuildChannel
- Specified by:
getManager
in interfaceICategorizableChannel
- Specified by:
getManager
in interfaceIPermissionContainer
- Specified by:
getManager
in interfaceIPositionableChannel
- Returns:
- The ChannelManager of this GuildChannel
-
-