Class MessageBulkDeleteEvent
- java.lang.Object
-
- net.dv8tion.jda.api.events.Event
-
- net.dv8tion.jda.api.events.message.MessageBulkDeleteEvent
-
- All Implemented Interfaces:
GenericEvent
public class MessageBulkDeleteEvent extends Event
Indicates that a bulk deletion is executed in aTextChannel
.
SetJDABuilder.setBulkDeleteSplittingEnabled(boolean)
to false in order to enable this event.Can be used to detect that a large chunk of Messages is deleted in a TextChannel. Providing a list of Message IDs and the specific TextChannel.
Requirements
This event requires at least one of the following intents (Will not fire at all if neither is enabled):
GUILD_MESSAGES
to work in guild text channelsDIRECT_MESSAGES
to work in private channels
-
-
Constructor Summary
Constructors Constructor Description MessageBulkDeleteEvent(JDA api, long responseNumber, TextChannel channel, java.util.List<java.lang.String> messageIds)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TextChannel
getChannel()
TheTextChannel
where the messages have been deletedGuild
getGuild()
TheGuild
where the messages were deleted.java.util.List<java.lang.String>
getMessageIds()
List of messages that have been deleted.-
Methods inherited from class net.dv8tion.jda.api.events.Event
getJDA, getResponseNumber
-
-
-
-
Constructor Detail
-
MessageBulkDeleteEvent
public MessageBulkDeleteEvent(@Nonnull JDA api, long responseNumber, @Nonnull TextChannel channel, @Nonnull java.util.List<java.lang.String> messageIds)
-
-
Method Detail
-
getChannel
@Nonnull public TextChannel getChannel()
TheTextChannel
where the messages have been deleted- Returns:
- The TextChannel
-
getGuild
@Nonnull public Guild getGuild()
TheGuild
where the messages were deleted.- Returns:
- The Guild
-
getMessageIds
@Nonnull public java.util.List<java.lang.String> getMessageIds()
List of messages that have been deleted.- Returns:
- The list of message ids
-
-