Bulk deletes a list of messages.
This is not the same as calling
net.dv8tion.jda.core.entities.Message#delete() 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 the
Message#delete() method instead.
You must have the Permission
net.dv8tion.jda.core.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:
-
net.dv8tion.jda.core.requests.ErrorResponse#UNKNOWN_CHANNEL
if this channel was deleted
-
net.dv8tion.jda.core.requests.ErrorResponse#UNKNOWN_MESSAGE
if any of the provided messages does not exist
-
net.dv8tion.jda.core.requests.ErrorResponse#MISSING_ACCESS
if we were removed from the guild
-
net.dv8tion.jda.core.requests.ErrorResponse#MISSING_PERMISSIONS
The send request was attempted after the account lost
net.dv8tion.jda.core.Permission#MESSAGE_MANAGE in the channel.