public interface TextChannel extends Channel, MessageChannel, java.lang.Comparable<TextChannel>, IMentionable
Channel and
MessageChannel for more information.
Internal implementation of this class is available at
TextChannelImpl.
Note: Internal implementation should not be used directly.
| Modifier and Type | Method and Description |
|---|---|
boolean |
canTalk()
Whether we can send messages in this channel.
|
boolean |
canTalk(Member member)
Whether the specified
Member
can send messages in this channel. |
default RestAction<java.lang.Void> |
clearReactionsById(long messageId)
Attempts to remove all reactions from a message with the specified
messageId in this TextChannel
This is useful for moderator commands that wish to remove all reactions at once from a specific message. |
RestAction<java.lang.Void> |
clearReactionsById(java.lang.String messageId)
Attempts to remove all reactions from a message with the specified
messageId in this TextChannel
This is useful for moderator commands that wish to remove all reactions at once from a specific message. |
RestAction<java.lang.Void> |
deleteMessages(java.util.Collection<Message> messages)
Bulk deletes a list of messages.
|
RestAction<java.lang.Void> |
deleteMessagesByIds(java.util.Collection<java.lang.String> messageIds)
Bulk deletes a list of messages.
|
AuditableRestAction<java.lang.Void> |
deleteWebhookById(java.lang.String id)
Deletes a
Webhook attached to this channel
by the id specified. |
default void |
formatTo(java.util.Formatter formatter,
int flags,
int width,
int precision) |
java.lang.String |
getTopic()
The topic set for this TextChannel.
|
RestAction<java.util.List<Webhook>> |
getWebhooks()
Retrieves the
Webhooks attached to this TextChannel. |
boolean |
isNSFW()
Whether or not this channel is considered as "NSFW" (Not-Safe-For-Work)
This will check whether the name of this TextChannel begins with nsfw- or is equal to nsfw! |
createInvite, createPermissionOverride, createPermissionOverride, delete, getGuild, getInvites, getJDA, getManager, getManagerUpdatable, getMemberPermissionOverrides, getMembers, getName, getPermissionOverride, getPermissionOverride, getPermissionOverrides, getPosition, getPositionRaw, getRolePermissionOverrides, getTypeaddReactionById, addReactionById, addReactionById, addReactionById, deleteMessageById, deleteMessageById, editMessageById, editMessageById, editMessageById, editMessageById, editMessageById, editMessageFormatById, editMessageFormatById, getHistory, getHistoryAround, getHistoryAround, getHistoryAround, getIterableHistory, getJDA, getLatestMessageId, getLatestMessageIdLong, getMessageById, getMessageById, getName, getPinnedMessages, getType, hasLatestMessage, pinMessageById, pinMessageById, sendFile, sendFile, sendFile, sendFile, sendMessage, sendMessage, sendMessage, sendMessageFormat, sendTyping, unpinMessageById, unpinMessageByIdgetCreationTime, getId, getIdLonggetAsMentionjava.lang.String getTopic()
boolean isNSFW()
nsfw- or is equal to nsfw!@CheckReturnValue RestAction<java.util.List<Webhook>> getWebhooks()
Webhooks attached to this TextChannel.
Possible ErrorResponses include:
UNKNOWN_CHANNEL
MISSING_ACCESS
RestAction - Type: List<Webhook>
@CheckReturnValue RestAction<java.lang.Void> deleteMessages(java.util.Collection<Message> messages)
Message.delete() in a loop.
Must be at least 2 messages and not be more than 100 messages at a time.
If you only have 1 message, use the Message.delete() method instead.
You must have the Permission MESSAGE_MANAGE in this channel to use
this function.
This method is best used when using MessageHistory to delete a large amount
of messages. If you have a large amount of messages but only their message Ids, please use deleteMessagesByIds(Collection)
Possible ErrorResponses include:
UNKNOWN_CHANNEL
UNKNOWN_MESSAGE
MISSING_ACCESS
MISSING_PERMISSIONS
Permission.MESSAGE_MANAGE in the channel.messages - The collection of messages to delete.AuditableRestActionjava.lang.IllegalArgumentException - If the size of the list less than 2 or more than 100 messages.InsufficientPermissionException - If this account does not have Permission.MESSAGE_MANAGEdeleteMessagesByIds(Collection)@CheckReturnValue RestAction<java.lang.Void> deleteMessagesByIds(java.util.Collection<java.lang.String> messageIds)
MessageChannel.deleteMessageById(String) in a loop.
Must be at least 2 messages and not be more than 100 messages at a time.
If you only have 1 message, use the Message.delete() method instead.
You must have Permission.MESSAGE_MANAGE in this channel to use
this function.
This method is best used when you have a large amount of messages but only their message Ids. If you are using
MessageHistory or have Message
objects, it would be easier to use deleteMessages(java.util.Collection).
Possible ErrorResponses include:
UNKNOWN_CHANNEL
UNKNOWN_MESSAGE
MISSING_ACCESS
MISSING_PERMISSIONS
Permission.MESSAGE_MANAGE in the channel.messageIds - The message ids for the messages to delete.AuditableRestActionjava.lang.IllegalArgumentException - If the size of the list less than 2 or more than 100 messages.java.lang.NumberFormatException - If any of the provided ids cannot be parsed by Long.parseLong(String)InsufficientPermissionException - If this account does not have Permission.MESSAGE_MANAGEdeleteMessages(Collection)@CheckReturnValue AuditableRestAction<java.lang.Void> deleteWebhookById(java.lang.String id)
Webhook attached to this channel
by the id specified.
Possible ErrorResponses include:
ErrorResponse.UNKNOWN_WEBHOOK
UNKNOWN_CHANNEL
MISSING_ACCESS
MISSING_PERMISSIONS
Permission.MANAGE_WEBHOOKS in the channel.id - The not-null id for the target Webhook.AuditableRestActionjava.lang.IllegalArgumentException - If the provided id is null or empty.InsufficientPermissionException - If the currently logged in account does not have
Permission.MANAGE_WEBHOOKS in this channel.@CheckReturnValue RestAction<java.lang.Void> clearReactionsById(java.lang.String messageId)
messageId in this TextChannel
The following ErrorResponses are possible:
MISSING_ACCESS
TextChannel
due to Permission.MESSAGE_READ being revoked, or the
account lost access to the Guild or Group
typically due to being kicked or removed.MISSING_PERMISSIONS
Permission.MESSAGE_MANAGE
in the TextChannel when adding the reaction.UNKNOWN_MESSAGE
The clear-reactions request was attempted after the Message had been deleted.messageId - The not-empty valid message idAuditableRestActionInsufficientPermissionException - If the currently logged in account does not have
Permission.MESSAGE_MANAGE in this channel.java.lang.IllegalArgumentException - If the provided id is null or empty.@CheckReturnValue default RestAction<java.lang.Void> clearReactionsById(long messageId)
messageId in this TextChannel
The following ErrorResponses are possible:
MISSING_ACCESS
TextChannel
due to Permission.MESSAGE_READ being revoked, or the
account lost access to the Guild or Group
typically due to being kicked or removed.MISSING_PERMISSIONS
Permission.MESSAGE_MANAGE
in the TextChannel when adding the reaction.UNKNOWN_MESSAGE
The clear-reactions request was attempted after the Message had been deleted.messageId - The message idAuditableRestActionInsufficientPermissionException - If the currently logged in account does not have
Permission.MESSAGE_MANAGE in this channel.boolean canTalk()
canTalk(Member) with the SelfMember.
Permission.MESSAGE_READ and
Permission.MESSAGE_WRITE.boolean canTalk(Member member)
Member
can send messages in this channel.
Permission.MESSAGE_READ and
Permission.MESSAGE_WRITE.member - The Member to checkdefault void formatTo(java.util.Formatter formatter,
int flags,
int width,
int precision)
formatTo in interface java.util.FormattableformatTo in interface IMentionableformatTo in interface MessageChannel