With this release, we are getting very close to the beta release. The big and long awaited message rework introduces a high consistency between all message create and edit endpoints, which means you no longer have to decide between setActionRow and addActionRow depending on the specific flavor of endpoint you are using!
The message rework introduces a consistent interface for message requests. We are splitting message edit requests and message create requests into 2 interfaces with different functionality. The new type hierarchy can be seen in this figure:
You will likely only have to adjust code if you used MessageBuilder. In this rework, we split this into MessageCreateBuilder and MessageEditBuilder, which produce either MessageCreateData or MessageEditData. And you will have to provide these data instances instead of Message instances from now on.
The old approach of having a MessageBuilder which returns a Message instance was flawed, in that it would offer a lot of methods which are unusable. Instead, we now separate this by making data classes for each request. Now the types are consistently representing a specific feature set:
Type
Meaning
Message
Existing messages on discord with an ID
MessageCreateData
The data used for a message creation request (HTTP POST)
MessageEditData
The data used for a message edit request (HTTP PATCH)
This allows for a higher level of consistency and clarity. The edit builder by default will only update the fields which are explicitly set. For example, doing new MessageEditBuilder().setContent("hello").build() will only update the content and leave any embeds or files untouched.
More details are provided in #2187. You can also ask questions in the release discussion.
In an upcoming change to the gateway logic (which is used to receive events), Discord is introducing a new gateway resume url. This new resume URL will be used to move your bot connection to a new zone, allowing for less reconnects and potentially lower ping.
Bots on older version of JDA may run into more reconnects due to the missing handling of this new resume url. Anyone using some kind of proxy gateway, should make sure to also handle this accordingly.
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Bumps JDA from 5.0.0-alpha.17 to 5.0.0-alpha.18.
Release notes
Sourced from JDA's releases.
... (truncated)
Commits
3889412
Bump to alpha 1867566a8
Typo correction (#2206)4642660
Add support for setting voice region on channel creation/copy (#2209)e111d55
Message Rework (#2187)9a159e0
unify method checks wording in docs (#2102)a5a0aaf
Implement gateway resume url handling (#2203)ed816ac
ImplementGuildChannel#getJumpUrl
(#2204)6d849dd
Fix CommandAutoCompleteInteraction#getChannel (#2211)c2e8c5e
Add ApplicationInfo#getFlags (#2202)b579a8d
Improve usage of cache in Guild#retrieveMemberById (#2200)Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)