Interface GuildMessageChannelMixin<T extends GuildMessageChannelMixin<T>>
- All Superinterfaces:
Channel
,ChannelMixin<T>
,ChannelUnion
,Comparable<GuildChannel>
,Formattable
,GuildChannel
,GuildChannelMixin<T>
,GuildChannelUnion
,GuildMessageChannel
,GuildMessageChannelUnion
,IDetachableEntity
,IDetachableEntityMixin
,IMentionable
,ISnowflake
,MessageChannel
,MessageChannelMixin<T>
,MessageChannelUnion
- All Known Subinterfaces:
NewsChannelMixin<T>
,StageChannelMixin<T>
,StandardGuildMessageChannelMixin<T>
,TextChannelMixin<T>
,ThreadChannelMixin<T>
,VoiceChannelMixin<T>
- All Known Implementing Classes:
AbstractStandardGuildMessageChannelImpl
,DetachedNewsChannelImpl
,DetachedStageChannelImpl
,DetachedTextChannelImpl
,DetachedThreadChannelImpl
,DetachedVoiceChannelImpl
,NewsChannelImpl
,StageChannelImpl
,TextChannelImpl
,ThreadChannelImpl
,VoiceChannelImpl
public interface GuildMessageChannelMixin<T extends GuildMessageChannelMixin<T>>
extends GuildMessageChannel, GuildMessageChannelUnion, GuildChannelMixin<T>, MessageChannelMixin<T>
-
Field Summary
Fields inherited from interface net.dv8tion.jda.api.entities.channel.Channel
MAX_NAME_LENGTH
Fields inherited from interface net.dv8tion.jda.api.entities.channel.middleman.GuildChannel
JUMP_URL
-
Method Summary
Modifier and TypeMethodDescriptiondefault boolean
default void
default void
default void
default void
default void
default void
default void
default RestAction
<Void> clearReactionsById
(String messageId) Attempts to remove all reactions from a message with the specifiedmessageId
in this TextChannel
This is useful for moderator commands that wish to remove all reactions at once from a specific message.default RestAction
<Void> clearReactionsById
(String messageId, Emoji emoji) Removes all reactions for the specified emoji.default RestAction
<Void> deleteMessagesByIds
(Collection<String> messageIds) Bulk deletes a list of messages.default RestAction
<Void> removeReactionById
(String messageId, Emoji emoji, User user) Attempts to remove the reaction from a message represented by the specifiedmessageId
in this MessageChannel.default MessageCreateAction
sendStickers
(Collection<? extends StickerSnowflake> stickers) Send up to 3 stickers in this channel.Methods inherited from interface net.dv8tion.jda.api.entities.channel.Channel
formatTo, getAsMention, getFlags, getJDA, getName, getType
Methods inherited from interface net.dv8tion.jda.internal.entities.channel.mixin.ChannelMixin
delete, setName
Methods inherited from interface net.dv8tion.jda.api.entities.channel.unions.ChannelUnion
asAudioChannel, asCategory, asForumChannel, asGroupChannel, asGuildChannel, asGuildMessageChannel, asMediaChannel, asMessageChannel, asNewsChannel, asPrivateChannel, asStageChannel, asStandardGuildChannel, asStandardGuildMessageChannel, asTextChannel, asThreadChannel, asThreadContainer, asVoiceChannel
Methods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface net.dv8tion.jda.api.entities.channel.middleman.GuildChannel
getGuild, getJumpUrl, getManager, getPermissionContainer
Methods inherited from interface net.dv8tion.jda.internal.entities.channel.mixin.middleman.GuildChannelMixin
checkCanAccess, checkCanManage, checkPermission, checkPermission, delete, hasPermission
Methods inherited from interface net.dv8tion.jda.api.entities.channel.unions.GuildChannelUnion
asAudioChannel, asCategory, asForumChannel, asGuildMessageChannel, asMediaChannel, asNewsChannel, asStageChannel, asStandardGuildChannel, asStandardGuildMessageChannel, asTextChannel, asThreadChannel, asThreadContainer, asVoiceChannel
Methods inherited from interface net.dv8tion.jda.api.entities.channel.middleman.GuildMessageChannel
canTalk, canTalk, clearReactionsById, clearReactionsById, deleteMessages, removeReactionById, sendStickers
Methods inherited from interface net.dv8tion.jda.api.entities.channel.unions.GuildMessageChannelUnion
asAudioChannel, asNewsChannel, asStageChannel, asStandardGuildChannel, asStandardGuildMessageChannel, asTextChannel, asThreadChannel, asThreadContainer, asVoiceChannel
Methods inherited from interface net.dv8tion.jda.api.entities.detached.IDetachableEntity
isDetached
Methods inherited from interface net.dv8tion.jda.internal.entities.detached.mixin.IDetachableEntityMixin
checkAttached, detachedException, detachedRequiresChannelException
Methods inherited from interface net.dv8tion.jda.api.entities.ISnowflake
getId, getIdLong, getTimeCreated
Methods inherited from interface net.dv8tion.jda.api.entities.channel.middleman.MessageChannel
addReactionById, deleteMessageById, editMessageAttachmentsById, editMessageAttachmentsById, editMessageAttachmentsById, editMessageById, editMessageById, editMessageComponentsById, editMessageComponentsById, editMessageComponentsById, editMessageComponentsById, editMessageComponentsById, editMessageEmbedsById, editMessageEmbedsById, editMessageEmbedsById, editMessageFormatById, editMessageFormatById, endPollById, endPollById, getHistoryAfter, getHistoryAfter, getHistoryAround, getHistoryAround, getHistoryBefore, getHistoryBefore, getLatestMessageId, getLatestMessageIdLong, pinMessageById, purgeMessages, purgeMessagesById, purgeMessagesById, removeReactionById, retrieveMessageById, retrievePollVotersById, retrievePollVotersById, retrieveReactionUsersById, retrieveReactionUsersById, retrieveReactionUsersById, sendFiles, sendMessageComponents, sendMessageComponents, sendMessageFormat, unpinMessageById
Methods inherited from interface net.dv8tion.jda.internal.entities.channel.mixin.middleman.MessageChannelMixin
addReactionById, bulkDeleteMessages, deleteMessageById, editMessageAttachmentsById, editMessageById, editMessageById, editMessageComponentsById, editMessageEmbedsById, getHistory, getHistoryAfter, getHistoryAround, getHistoryBefore, getHistoryFromBeginning, getIterableHistory, pinMessageById, purgeMessages, purgeMessagesById, removeReactionById, retrieveMessageById, retrievePinnedMessages, retrieveReactionUsersById, sendFiles, sendMessage, sendMessage, sendMessageComponents, sendMessageEmbeds, sendMessageEmbeds, sendMessagePoll, sendTyping, setLatestMessageIdLong, unpinMessageById
Methods inherited from interface net.dv8tion.jda.api.entities.channel.unions.MessageChannelUnion
asAudioChannel, asGroupChannel, asGuildMessageChannel, asNewsChannel, asPrivateChannel, asStageChannel, asTextChannel, asThreadChannel, asThreadContainer, asVoiceChannel
-
Method Details
-
deleteMessagesByIds
@Nonnull @CheckReturnValue default RestAction<Void> deleteMessagesByIds(@Nonnull Collection<String> messageIds) Description copied from interface:GuildMessageChannel
Bulk deletes a list of messages. This is not the same as callingMessageChannel.deleteMessageById(String)
in a loop.
This is much more efficient, but it has a different ratelimit. You may call this once per second per Guild.Must be at least 2 messages and not be more than 100 messages at a time.
If you only have 1 message, use theMessage.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 haveMessage
objects, it would be easier to useGuildMessageChannel.deleteMessages(java.util.Collection)
.Possible ErrorResponses include:
UNKNOWN_CHANNEL
if this channel was deletedUNKNOWN_MESSAGE
if any of the provided messages does not existMISSING_ACCESS
if we were removed from the guildMISSING_PERMISSIONS
The send request was attempted after the account lostPermission.MESSAGE_MANAGE
in the channel.
- Specified by:
deleteMessagesByIds
in interfaceGuildMessageChannel
- Parameters:
messageIds
- The message ids for the messages to delete.- Returns:
AuditableRestAction
- See Also:
-
removeReactionById
@Nonnull default RestAction<Void> removeReactionById(@Nonnull String messageId, @Nonnull Emoji emoji, @Nonnull User user) Description copied from interface:GuildMessageChannel
Attempts to remove the reaction from a message represented by the specifiedmessageId
in this MessageChannel.The following
ErrorResponses
are possible: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
Also can happen if the account lost thePermission.MESSAGE_HISTORY
MISSING_PERMISSIONS
The request was attempted after the account lostPermission.MESSAGE_ADD_REACTION
in theTextChannel
.ErrorResponse.UNKNOWN_EMOJI
The provided unicode character does not refer to a known emoji unicode character.
Proper unicode characters for emojis can be found here: Emoji TableUNKNOWN_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.
- Specified by:
removeReactionById
in interfaceGuildMessageChannel
- Parameters:
messageId
- The messageId to remove the reaction fromemoji
- The emoji to removeuser
- The target user of which to remove from- Returns:
RestAction
-
clearReactionsById
Description copied from interface:GuildMessageChannel
Attempts to remove all reactions from a message with the specifiedmessageId
in this TextChannel
This is useful for moderator commands that wish to remove all reactions at once from a specific message.The following
ErrorResponses
are possible:MISSING_ACCESS
The clear-reactions request was attempted after the account lost access to theTextChannel
due toPermission.VIEW_CHANNEL
being revoked, or the account lost access to theGuild
typically due to being kicked or removed.MISSING_PERMISSIONS
The clear-reactions request was attempted after the account lostPermission.MESSAGE_MANAGE
in theTextChannel
when adding the reaction.UNKNOWN_MESSAGE
The clear-reactions request was attempted after the Message had been deleted.
- Specified by:
clearReactionsById
in interfaceGuildMessageChannel
- Parameters:
messageId
- The not-empty valid message id- Returns:
AuditableRestAction
-
clearReactionsById
@Nonnull default RestAction<Void> clearReactionsById(@Nonnull String messageId, @Nonnull Emoji emoji) Description copied from interface:GuildMessageChannel
Removes all reactions for the specified emoji.The following
ErrorResponses
are possible:MISSING_ACCESS
The currently logged in account lost access to the channel by either being removed from the guild or losing theVIEW_CHANNEL
permissionUNKNOWN_EMOJI
The providedEmoji
was deleted or doesn't exist.UNKNOWN_MESSAGE
The message was deleted.
- Specified by:
clearReactionsById
in interfaceGuildMessageChannel
- Parameters:
messageId
- The id for the target messageemoji
- TheEmoji
to remove reactions for- Returns:
RestAction
-
sendStickers
@Nonnull default MessageCreateAction sendStickers(@Nonnull Collection<? extends StickerSnowflake> stickers) Description copied from interface:GuildMessageChannel
Send up to 3 stickers in this channel.
Bots can only sendGuildStickers
from the sameGuild
. Bots cannot useStandardStickers
.- Specified by:
sendStickers
in interfaceGuildMessageChannel
- Parameters:
stickers
- Collection of 1-3 stickers to send- Returns:
MessageCreateAction
- See Also:
-
checkCanSendMessage
default void checkCanSendMessage()- Specified by:
checkCanSendMessage
in interfaceMessageChannelMixin<T extends GuildMessageChannelMixin<T>>
-
checkCanSendMessageEmbeds
default void checkCanSendMessageEmbeds()- Specified by:
checkCanSendMessageEmbeds
in interfaceMessageChannelMixin<T extends GuildMessageChannelMixin<T>>
-
checkCanSendFiles
default void checkCanSendFiles()- Specified by:
checkCanSendFiles
in interfaceMessageChannelMixin<T extends GuildMessageChannelMixin<T>>
-
checkCanViewHistory
default void checkCanViewHistory()- Specified by:
checkCanViewHistory
in interfaceMessageChannelMixin<T extends GuildMessageChannelMixin<T>>
-
checkCanAddReactions
default void checkCanAddReactions()- Specified by:
checkCanAddReactions
in interfaceMessageChannelMixin<T extends GuildMessageChannelMixin<T>>
-
checkCanRemoveReactions
default void checkCanRemoveReactions()- Specified by:
checkCanRemoveReactions
in interfaceMessageChannelMixin<T extends GuildMessageChannelMixin<T>>
-
checkCanControlMessagePins
default void checkCanControlMessagePins()- Specified by:
checkCanControlMessagePins
in interfaceMessageChannelMixin<T extends GuildMessageChannelMixin<T>>
-
canDeleteOtherUsersMessages
default boolean canDeleteOtherUsersMessages()- Specified by:
canDeleteOtherUsersMessages
in interfaceMessageChannelMixin<T extends GuildMessageChannelMixin<T>>
-