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. |
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.
|
RestAction<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. |
createInvite, createPermissionOverride, createPermissionOverride, delete, getGuild, getInvites, getJDA, getManager, getManagerUpdatable, getMemberPermissionOverrides, getMembers, getName, getPermissionOverride, getPermissionOverride, getPermissionOverrides, getPosition, getPositionRaw, getRolePermissionOverrides
addReactionById, addReactionById, addReactionById, addReactionById, deleteMessageById, deleteMessageById, editMessageById, editMessageById, editMessageById, editMessageById, editMessageById, editMessageById, editMessageById, getHistory, getHistoryAround, getHistoryAround, getHistoryAround, getJDA, getLatestMessageId, getLatestMessageIdLong, getMessageById, getMessageById, getName, getPinnedMessages, getType, hasLatestMessage, pinMessageById, pinMessageById, sendFile, sendFile, sendFile, sendFile, sendMessage, sendMessage, sendMessage, sendMessage, sendTyping, unpinMessageById, unpinMessageById
getCreationTime, getId, getIdLong
getAsMention
java.lang.String getTopic()
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.RestAction
- Type: Voidjava.lang.IllegalArgumentException
- If the size of the list less than 2 or more than 100 messages.PermissionException
- If this account does not have MANAGE_MESSAGESdeleteMessagesByIds(Collection)
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.RestAction
- Type: Voidjava.lang.IllegalArgumentException
- If the size of the list less than 2 or more than 100 messages.PermissionException
- If this account does not have MANAGE_MESSAGESdeleteMessages(Collection)
RestAction<java.util.List<Webhook>> getWebhooks()
Webhooks
attached to this TextChannel.
Possible ErrorResponses include:
UNKNOWN_CHANNEL
MISSING_ACCESS
RestAction
- Type: List<Webhook
>
RestAction<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.RestAction
- Type: Voidjava.lang.IllegalArgumentException
- If the provided id
is null
or empty.PermissionException
- If the currently logged in account does not have
Permission.MANAGE_WEBHOOKS
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.Formattable
formatTo
in interface IMentionable
formatTo
in interface MessageChannel