Skip to content

v6.5.0 | Message Search API

Latest

Choose a tag to compare

@MinnDevelopment MinnDevelopment released this 05 Jul 16:59
d89f24a

Overview

This release adds support for the Message Search API, which allows bots to search messages in a guild. See Guild#searchMessages and MessageSearchAction for detailed documentation.

Example:

guild.searchMessages()
     .attachmentFilenames("cat.png")
     .includeAuthorTypes(MessageSearchAction.AuthorType.USER)
     .queue(response -> {
         if (response.isNotReady()) {
             int retryAfter = response.asNotReady().getRetryAfter();
             event.reply("The server is still indexing messages, try again later").queue();
             return;
         }

         List<Message> messages = response.asResults().getMessages();
         event.reply("Found %s messages of cats!".formatted(messages.size())).queue();
     });

Additionally, we made a minor change in the handling for received messages. For messages received in guilds JDA now handles events with missing member objects, which is necessary to handle messages that arrive shortly after a user is banned from the guild. These messages will contain members which are not added to cache and have no roles.

New Features

Changes

Full Changelog: v6.4.2...v6.5.0

Installation

Gradle

repositories {
    mavenCentral()
}
dependencies {
    implementation("net.dv8tion:JDA:6.5.0")
}

Maven

<dependency>
    <groupId>net.dv8tion</groupId>
    <artifactId>JDA</artifactId>
    <version>6.5.0</version> 
</dependency>