Releases: discord-jda/JDA
v5.0.0-beta.17 | Fix webhooks in thread channels
Overview
This release fixes some issues with webhook executions in thread channels.
Changes
Bug Fixes
- Fix webhook send & edit where the thread ID was set by @RedDaedalus in #2572
- Fix else if for threadMetadata being on avatarUrl after #2572 by @Vankka in #2573
Full Changelog: v5.0.0-beta.16...v5.0.0-beta.17
Installation
Gradle
repositories {
mavenCentral()
}
dependencies {
implementation("net.dv8tion:JDA:5.0.0-beta.17")
}
Maven
<dependency>
<groupId>net.dv8tion</groupId>
<artifactId>JDA</artifactId>
<version>5.0.0-beta.17</version>
</dependency>
v5.0.0-beta.16 | Webhook Execution and Super Reactions
Overview
With this release, we have redesigned a major flaw in our entity constraints. Previously, message instances required a known cached channel instance to be usable. This flaw has been remedied by reworking this implementation to be usable with only a known channel id.
This means, that methods such as message.addReaction(...)
or message.pin()
can now work for message instances that have no channel object in cache. You can find out if a channel is available on a message instance, by using hasChannel. Adding support for this behavior was necessary, in order to implement webhook executions!
With this change resolved, we can now fully support sending messages through arbitrary webhooks by using WebhookClient.createClient
. This webhook client makes use of the JDA rate-limit system and request queue, to properly handle rate-limits for you.
Interactions Hidden Threads
This release also fixes the problem of not receiving interactions in hidden threads, for instance if the thread is a private thread and your bot has not been added yet. This problem was actually caused by JDA expecting a channel instance in cache that was not present, which stopped the interaction from going through.
Discord has added more information about the channel objects in interactions, so we can now properly construct the thread channel instance just in time for the interaction event.
Super Reactions
Your bot can now tell what super-reactions are used. You still cannot send them because the API is too unstable.
Beta Period Almost Done!
We plan to end the beta period for JDA 5.0.0 very soon. There are a few more changes we are thinking of merging first, but the current release already seems very complete. We hope to end the beta period before the end of the year, stay tuned.
New Features
- Handle messages from inaccessible threads and add webhook support by @MinnDevelopment in #2390
- Implement super reaction handling by @MinnDevelopment in #2554
Bug Fixes
- Fix createCopy not copying DefaultValues by @Kaktushose in #2556
- Fix ChannelManagerImpl#reset by @Almighty-Satan in #2563
- Fix MissingFormatArgumentException in DataArray#getOffsetDateTime by @Almighty-Satan in #2564
Full Changelog: v5.0.0-beta.15...v5.0.0-beta.16
Installation
Gradle
repositories {
mavenCentral()
}
dependencies {
implementation("net.dv8tion:JDA:5.0.0-beta.16")
}
Maven
<dependency>
<groupId>net.dv8tion</groupId>
<artifactId>JDA</artifactId>
<version>5.0.0-beta.16</version>
</dependency>
v5.0.0-beta.15 | Bug fixes
Overview
This release fixes a bug introduced by 5.0.0-beta.14
.
Bug Fixes
- Add null check in checkPosition by @MinnDevelopment in #2553
Full Changelog: v5.0.0-beta.14...v5.0.0-beta.15
Installation
Gradle
repositories {
mavenCentral()
}
dependencies {
implementation("net.dv8tion:JDA:5.0.0-beta.15")
}
Maven
<dependency>
<groupId>net.dv8tion</groupId>
<artifactId>JDA</artifactId>
<version>5.0.0-beta.15</version>
</dependency>
v5.0.0-beta.14 | Media Channels, Custom Status, LRU Cache
Overview
This brings JDA up to date with newly released API features and fixes a few issues.
Support for Custom Status (#2521)
Many years ago, the "Custom Status" feature has been released on Discord, but has since been limited to client users. With a change recently, bots have finally been granted access to set this custom status as well. This, however, is limited to only setting the text value and no emoji.
You can set a custom status using Activity.customStatus(text)
.
Media Channels (#2516)
Discord is rolling out another new channel type. This time the type is a derivation of forum channels, specifically designed to share media such as images or videos. This release adds support for media channels.
A few places now return the new abstraction IPostContainer
, where previously a ForumChannel
was used. This abstraction is used to deduplicate and expand the API to handle both media and forum channels equally, as both of these types handle posts (threads with start messages).
LRU Member Cache (#2506)
The member cache has become slightly more powerful by introducing the new LRUMemberCachePolicy
. A Least-Recently-Used (LRU) cache keeps members cached based on activity.
Example:
MemberCachePolicy.VOICE // Keep in cache if currently in voice (skip LRU and ONLINE)
.or(MemberCachePolicy.ONLINE) // Otherwise, only add to cache if online
.and(MemberCachePolicy.lru(1000) // keep 1000 recently active members
.unloadUnless(MemberCachePolicy.VOICE)) // only unload if they are not in voice
New Features
- Add DiscordLocale#toLocale by @freya022 in #2485
- Add custom status support for bots by @RedDaedalus in #2521
- Added support for custom statuses using Activity.of by @jqnn in #2524
- Add Activity#withState by @MinnDevelopment in #2523
- Add LRUMemberCachePolicy by @MinnDevelopment in #2506
- Add initial support for media channels by @MinnDevelopment in #2516
- Add default_values support by @MinnDevelopment in #2542
Changes
- Add position check to timeouts by @MinnDevelopment in #2540
- Allow override of headers applied by default by @zaroxh in #2529
Bug Fixes
- fix symmetricity of CustomEmojiImpl/RichCustomEmojiImpl#equals by @danthe1st in #2519
- Allow slowmode & nsfw in Stage Channels by @kazuryyx in #2538
- Improve handling of query parameters in image proxy by @MinnDevelopment in #2551
Full Changelog: v5.0.0-beta.13...v5.0.0-beta.14
Installation
Gradle
repositories {
mavenCentral()
}
dependencies {
implementation("net.dv8tion:JDA:5.0.0-beta.14")
}
Maven
<dependency>
<groupId>net.dv8tion</groupId>
<artifactId>JDA</artifactId>
<version>5.0.0-beta.14</version>
</dependency>
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>
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 in #2483
- Handle clyde in DMs correctly by @MinnDevelopment in #2489
Full Changelog: v5.0.0-beta.11...v5.0.0-beta.12
Installation
Gradle
repositories {
mavenCentral()
}
dependencies {
implementation("net.dv8tion:JDA:5.0.0-beta.12")
}
Maven
<dependency>
<groupId>net.dv8tion</groupId>
<artifactId>JDA</artifactId>
<version>5.0.0-beta.12</version>
</dependency>
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
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 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
- All commits on the master branch will from now on build and upload artifacts using the Artifacts Workflow. 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)
Using the new EmbedBuilder.fromData
factory method, you can now create embed instances from JSON or ETF data.
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 in #2471
Bug Fixes
- Update modulo for default avatars by id by @MinnDevelopment in #2475
- Fix handling of wrong length discriminators by @MinnDevelopment in #2478
- Fix external location value to be editable on started scheduled event by @Mitmocc in #2477
Full Changelog: v5.0.0-beta.10...v5.0.0-beta.11
Installation
Gradle
repositories {
mavenCentral()
}
dependencies {
implementation("net.dv8tion:JDA:5.0.0-beta.11")
}
Maven
<dependency>
<groupId>net.dv8tion</groupId>
<artifactId>JDA</artifactId>
<version>5.0.0-beta.11</version>
</dependency>
v5.0.0-beta.10
Overview
With this release, we are taking the first steps to transition into the new username system for Discord by marking some methods as incubating or deprecated. This release also introduces support for AutoMod, both events and changing the AutoMod rules of a guild.
AutoMod Support (#2429)
You can now modify the AutoMod rules of a guild using AutoModRuleData
and Guild#createAutoModRule
.
Support for member profile AutoMod has not been added yet, due to the API being very unstable still.
Example
guild.createAutoModRule(
AutoModRule.onMessage("No morbius memes", TriggerConfig.keywordFilter("*morb*"))
.putResponses(AutoModResponse.blockMessage("This meme is unfunny."))
).queue();
Username Changes (#2462)
Discord is changing to globally unique usernames and removing discriminators, this is explained in their blog post. We are taking the first steps to transition with this release.
Deprecated Features
- JDA#getUserByTag
- Guild#getMemberByTag
- User#getDiscriminator
- User#getAsTag
- SelfUpdateDiscriminatorEvent
- UserUpdateDiscriminatorEvent
- AccountManager#setName
Incubating Features
These are likely to be deprecated and removed in the future.
- JDA#getUsersByName
- Guild#getMembersByName
Other Changes
- In the future,
User#getDiscriminator
will return"0000"
for users who have a globally unique username from the new system. - A new
User#getEffectiveName
has been introduced to get the "effective display name" of a user, meaning either theUser#getGlobalName
orUser#getName
. This also affectsMember#getEffectiveName
, which will now return based on precedenceguild nickname
>global name
>username
. User#getDefaultAvatarId
now depends on the user id instead of the discriminator (when they have the discriminator 0000)
New Features
- Add automod support by @MinnDevelopment in #2429
- Add ThreadChannel#retrieveStartMessage by @MinnDevelopment in #2438
Changes
- Improve handling of global rate-limit by @MinnDevelopment in #2465
- Start migration to new username API by @MinnDevelopment in #2462
- Improve handling of method discovery in AnnotatedEventManager by @freya022 in #2454
Bug Fixes
- Fix slow shutdown during reconnects by @MinnDevelopment in #2464
- Properly escape quotes with leading spaces by @Almighty-Satan in #2363
Full Changelog: v5.0.0-beta.9...v5.0.0-beta.10
Installation
Gradle
repositories {
mavenCentral()
}
dependencies {
implementation("net.dv8tion:JDA:5.0.0-beta.10")
}
Maven
<dependency>
<groupId>net.dv8tion</groupId>
<artifactId>JDA</artifactId>
<version>5.0.0-beta.10</version>
</dependency>
v5.0.0-beta.9 | Bug fixes and new permissions
Overview
This release fixes a few critical bugs related to rate-limiting. We also added support for voice message receiving and new permissions relating to soundboards.
You can now use EmbedBuilder#setUrl
to create multi-image embeds. To create multi-image embeds, simply create one embed for each image and set the same URL on all of them. The client automatically merges embeds with the same URL.
Features
- Add EmbedBuilder#setUrl by @Xirado in #2449
- Add voice message read support by @RedDaedalus in #2445
Changes
- Update max file size to 25 MiB by @freya022 in #2444
- Update permissions by @MinnDevelopment in #2434
Bug Fixes
- Fix task not being marked as done on errors by @MinnDevelopment in #2451
- Handle retry-after issues better by @MinnDevelopment in #2453
- Fix docs in GuildBanEvent by @moricexy in #2460
- Fixing in EntitySelectMenu by @LoicMaitreDuFeu in #2456
- Remove timeout for rate-limit pool by @MinnDevelopment in #2458
Full Changelog: v5.0.0-beta.8...v5.0.0-beta.9
Installation
Gradle
repositories {
mavenCentral()
}
dependencies {
implementation("net.dv8tion:JDA:5.0.0-beta.9")
}
Maven
<dependency>
<groupId>net.dv8tion</groupId>
<artifactId>JDA</artifactId>
<version>5.0.0-beta.9</version>
</dependency>
v5.0.0-beta.8 | Hotfix NullPointerException
Overview
This is a small hotfix release for an error introduced in beta 7.
Features
- Support custom timeout on tasks by @MinnDevelopment in #2439
Bug Fixes
- Fix NPE in shardmanager by @MinnDevelopment in #2442
Full Changelog: v5.0.0-beta.7...v5.0.0-beta.8
Installation
Gradle
repositories {
mavenCentral()
}
dependencies {
implementation("net.dv8tion:JDA:5.0.0-beta.8")
}
Maven
<dependency>
<groupId>net.dv8tion</groupId>
<artifactId>JDA</artifactId>
<version>5.0.0-beta.8</version>
</dependency>