v5.0.0-beta.13
Overview
This release includes a few bug fixes and a new FileUpload
variant to optimize memory usage when uploading larger files.
Supplier FileUpload (#2508)
With the new FileUpload.fromStreamSupplier
, an upload will no longer retain the entire file content in memory. This comes at the cost of having to re-read the source each time.
Example:
FileUpload.fromStreamSupplier("image.png", () -> {
return new FileInputStream("myimage.png");
});
Each time the request is attempted, which can be more than once due to rate-limit retries, the supplier is used to create a new readable input stream of the file. Once the request successfully writes the entire body, the stream is closed again.
Note that the supplier must always return a new instance or reset the stream accordingly.
Getting Message Author from Reactions (#2499)
The MessageReactionAddEvent
now provides the author id of the original message. This can be useful in situations where retrieving the message is too expensive.
New Features
- Add the message author id to message reaction events by @MinnDevelopment in #2499
- Add supplier based FileUpload by @MinnDevelopment in #2508
Changes
- Deprecate and replace onUserSpeaking by @MinnDevelopment in #2496
Bug Fixes
- Fix handling of thread update for unknown parent by @MinnDevelopment in #2494
- Change return type of method in JDA class. by @kiLeo13 in #2504
- Fix choices having an "options" prefix when automatically localizing by @freya022 in #2490
- Fix MessageCreateRequest#applyData not suppressing embeds by @Almighty-Satan in #2513
- Fix IllegalStateException in Message#getCategory by @Almighty-Satan in #2514
Full Changelog: v5.0.0-beta.12...v5.0.0-beta.13
Installation
Gradle
repositories {
mavenCentral()
}
dependencies {
implementation("net.dv8tion:JDA:5.0.0-beta.13")
}
Maven
<dependency>
<groupId>net.dv8tion</groupId>
<artifactId>JDA</artifactId>
<version>5.0.0-beta.13</version>
</dependency>