Skip to content

v5.0.0-beta.13

Compare
Choose a tag to compare
@MinnDevelopment MinnDevelopment released this 06 Aug 14:16
· 150 commits to master since this release
c0582c5

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

Changes

Bug Fixes

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>