DV8FromTheWorld/JDA (net.dv8tion:JDA)
### [`v5.0.0-beta.13`](https://togithub.com/discord-jda/JDA/releases/tag/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](https://togithub.com/DV8FromTheWorld/JDA/issues/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:
```java
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](https://togithub.com/DV8FromTheWorld/JDA/issues/2499))
The `MessageReactionAddEvent` now provides the [author id](https://docs.jda.wiki/net/dv8tion/jda/api/events/message/react/MessageReactionAddEvent.html#getMessageAuthorIdLong\(\)) 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](https://togithub.com/MinnDevelopment) in [https://github.com/discord-jda/JDA/pull/2499](https://togithub.com/discord-jda/JDA/pull/2499)
- Add supplier based FileUpload by [@MinnDevelopment](https://togithub.com/MinnDevelopment) in [https://github.com/discord-jda/JDA/pull/2508](https://togithub.com/discord-jda/JDA/pull/2508)
#### Changes
- Deprecate and replace onUserSpeaking by [@MinnDevelopment](https://togithub.com/MinnDevelopment) in [https://github.com/discord-jda/JDA/pull/2496](https://togithub.com/discord-jda/JDA/pull/2496)
#### Bug Fixes
- Fix handling of thread update for unknown parent by [@MinnDevelopment](https://togithub.com/MinnDevelopment) in [https://github.com/discord-jda/JDA/pull/2494](https://togithub.com/discord-jda/JDA/pull/2494)
- Change return type of method in JDA class. by [@kiLeo13](https://togithub.com/kiLeo13) in [https://github.com/discord-jda/JDA/pull/2504](https://togithub.com/discord-jda/JDA/pull/2504)
- Fix choices having an "options" prefix when automatically localizing by [@freya022](https://togithub.com/freya022) in [https://github.com/discord-jda/JDA/pull/2490](https://togithub.com/discord-jda/JDA/pull/2490)
- Fix MessageCreateRequest#applyData not suppressing embeds by [@Almighty-Satan](https://togithub.com/Almighty-Satan) in [https://github.com/discord-jda/JDA/pull/2513](https://togithub.com/discord-jda/JDA/pull/2513)
- Fix IllegalStateException in Message#getCategory by [@Almighty-Satan](https://togithub.com/Almighty-Satan) in [https://github.com/discord-jda/JDA/pull/2514](https://togithub.com/discord-jda/JDA/pull/2514)
**Full Changelog**: https://github.com/discord-jda/JDA/compare/v5.0.0-beta.12...v5.0.0-beta.13
### Installation
#### Gradle
```gradle
repositories {
mavenCentral()
}
dependencies {
implementation("net.dv8tion:JDA:5.0.0-beta.13")
}
```
#### Maven
```xml
net.dv8tionJDA5.0.0-beta.13
```
### [`v5.0.0-beta.12`](https://togithub.com/discord-jda/JDA/releases/tag/v5.0.0-beta.12): | Bug fixes
### Overview
This release fixes a few annoying bugs that were introduced by the username changes.
#### Bug Fixes
- Fix automod execution errors from rules without an associated channel by [@CheesyGamer77](https://togithub.com/CheesyGamer77) in [https://github.com/discord-jda/JDA/pull/2483](https://togithub.com/discord-jda/JDA/pull/2483)
- Handle clyde in DMs correctly by [@MinnDevelopment](https://togithub.com/MinnDevelopment) in [https://github.com/discord-jda/JDA/pull/2489](https://togithub.com/discord-jda/JDA/pull/2489)
**Full Changelog**: https://github.com/discord-jda/JDA/compare/v5.0.0-beta.11...v5.0.0-beta.12
### Installation
#### Gradle
```gradle
repositories {
mavenCentral()
}
dependencies {
implementation("net.dv8tion:JDA:5.0.0-beta.12")
}
```
#### Maven
```xml
net.dv8tionJDA5.0.0-beta.12
```
### [`v5.0.0-beta.11`](https://togithub.com/discord-jda/JDA/releases/tag/v5.0.0-beta.11): | Bug fixes and embed from json
### Overview
This release fixes a few issues introduced by the username changes. It also introduces [`EmbedBuilder.fromData`](https://docs.jda.wiki/net/dv8tion/jda/api/EmbedBuilder.html#fromData\(net.dv8tion.jda.api.utils.data.DataObject\)) as a way to deserialize embeds from JSON.
There are also some changes to our online presence.
- The JDA repository has moved to the [discord-jda](https://togithub.com/discord-jda) GitHub organization
- The javadocs moved away from the Jenkins CI host to GitHub pages and can be found at our wiki domain [docs.jda.wiki](https://docs.jda.wiki)
- All commits on the master branch will from now on build and upload artifacts using the [Artifacts Workflow](https://togithub.com/discord-jda/JDA/actions/workflows/artifacts.yml). Those artifacts stay up for a total of 90 days and can be downloaded as a zip file. All releases will continue to provide artifacts for that specific version indefinitely.
##### Create Embeds From JSON ([#2471](https://togithub.com/DV8FromTheWorld/JDA/issues/2471))
Using the new [`EmbedBuilder.fromData`](https://docs.jda.wiki/net/dv8tion/jda/api/EmbedBuilder.html#fromData\(net.dv8tion.jda.api.utils.data.DataObject\)) factory method, you can now create embed instances from JSON or ETF data.
```java
MessageEmbed embed = new EmbedBuilder().setDescription("Hello, friend").build();
byte[] data = embed.toData().toJson(); // serialize to json data
Files.write(path, json); // store the embed somewhere on disk
DataObject json = DataObject.fromJson(Files.newInputStream(path)); // load the json data
MessageEmbed reconstructed = EmbedBuilder.fromData(json).build(); // reconstruct the same embed using the builder
```
#### New Features
- Support embed deserialization from JSON data by [@MinnDevelopment](https://togithub.com/MinnDevelopment) in [https://github.com/discord-jda/JDA/pull/2471](https://togithub.com/discord-jda/JDA/pull/2471)
#### Bug Fixes
- Update modulo for default avatars by id by [@MinnDevelopment](https://togithub.com/MinnDevelopment) in [https://github.com/discord-jda/JDA/pull/2475](https://togithub.com/discord-jda/JDA/pull/2475)
- Fix handling of wrong length discriminators by [@MinnDevelopment](https://togithub.com/MinnDevelopment) in [https://github.com/discord-jda/JDA/pull/2478](https://togithub.com/discord-jda/JDA/pull/2478)
- Fix external location value to be editable on started scheduled event by [@Mitmocc](https://togithub.com/Mitmocc) in [https://github.com/discord-jda/JDA/pull/2477](https://togithub.com/discord-jda/JDA/pull/2477)
**Full Changelog**: https://github.com/discord-jda/JDA/compare/v5.0.0-beta.10...v5.0.0-beta.11
### Installation
#### Gradle
```gradle
repositories {
mavenCentral()
}
dependencies {
implementation("net.dv8tion:JDA:5.0.0-beta.11")
}
```
#### Maven
```xml
net.dv8tionJDA5.0.0-beta.11
```
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
[ ] If you want to rebase/retry this PR, check this box
This PR has been generated by Mend Renovate. View repository job log here.
This PR contains the following updates:
5.0.0-beta.10
->5.0.0-beta.13
Release Notes
DV8FromTheWorld/JDA (net.dv8tion:JDA)
### [`v5.0.0-beta.13`](https://togithub.com/discord-jda/JDA/releases/tag/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](https://togithub.com/DV8FromTheWorld/JDA/issues/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: ```java 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](https://togithub.com/DV8FromTheWorld/JDA/issues/2499)) The `MessageReactionAddEvent` now provides the [author id](https://docs.jda.wiki/net/dv8tion/jda/api/events/message/react/MessageReactionAddEvent.html#getMessageAuthorIdLong\(\)) 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](https://togithub.com/MinnDevelopment) in [https://github.com/discord-jda/JDA/pull/2499](https://togithub.com/discord-jda/JDA/pull/2499) - Add supplier based FileUpload by [@MinnDevelopment](https://togithub.com/MinnDevelopment) in [https://github.com/discord-jda/JDA/pull/2508](https://togithub.com/discord-jda/JDA/pull/2508) #### Changes - Deprecate and replace onUserSpeaking by [@MinnDevelopment](https://togithub.com/MinnDevelopment) in [https://github.com/discord-jda/JDA/pull/2496](https://togithub.com/discord-jda/JDA/pull/2496) #### Bug Fixes - Fix handling of thread update for unknown parent by [@MinnDevelopment](https://togithub.com/MinnDevelopment) in [https://github.com/discord-jda/JDA/pull/2494](https://togithub.com/discord-jda/JDA/pull/2494) - Change return type of method in JDA class. by [@kiLeo13](https://togithub.com/kiLeo13) in [https://github.com/discord-jda/JDA/pull/2504](https://togithub.com/discord-jda/JDA/pull/2504) - Fix choices having an "options" prefix when automatically localizing by [@freya022](https://togithub.com/freya022) in [https://github.com/discord-jda/JDA/pull/2490](https://togithub.com/discord-jda/JDA/pull/2490) - Fix MessageCreateRequest#applyData not suppressing embeds by [@Almighty-Satan](https://togithub.com/Almighty-Satan) in [https://github.com/discord-jda/JDA/pull/2513](https://togithub.com/discord-jda/JDA/pull/2513) - Fix IllegalStateException in Message#getCategory by [@Almighty-Satan](https://togithub.com/Almighty-Satan) in [https://github.com/discord-jda/JDA/pull/2514](https://togithub.com/discord-jda/JDA/pull/2514) **Full Changelog**: https://github.com/discord-jda/JDA/compare/v5.0.0-beta.12...v5.0.0-beta.13 ### Installation #### Gradle ```gradle repositories { mavenCentral() } dependencies { implementation("net.dv8tion:JDA:5.0.0-beta.13") } ``` #### Maven ```xmlConfiguration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate. View repository job log here.