ErdbeerbaerLP / DiscordIntegration-Core

Common module for the Discord Integration mod
https://modrinth.com/plugin/dcintegration
4 stars 21 forks source link

Bump JDA from 5.0.0-alpha.17 to 5.0.0-alpha.18 #98

Closed dependabot[bot] closed 2 years ago

dependabot[bot] commented 2 years ago

Bumps JDA from 5.0.0-alpha.17 to 5.0.0-alpha.18.

Release notes

Sourced from JDA's releases.

v5.0.0-alpha.18 | Message Rework

Overview

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!

Message Rework (#2187)

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:

image

This results in a few breaking changes.

Renames

  • setActionRows/addActionRows -> setComponents/addComponents
  • MessageAction -> MessageCreateAction
  • MessageAction#tts -> MessageCreateAction#setTTS
  • allowedMentions(...) -> setAllowedMentions(...)
  • addFile -> setFiles/addFiles/setAttachments
  • sendFile/replyFile -> sendFiles/replyFiles
  • override(true) -> setReplace(true)

Code Migration

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.

Gateway Resume URL Handling (#2203)

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.

New Features

... (truncated)

Commits


Dependabot compatibility score

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)
dependabot[bot] commented 2 years ago

Superseded by #100.