EzMediaCore icon indicating copy to clipboard operation
EzMediaCore copied to clipboard

Update dependency net.dv8tion:JDA to v5.0.0-alpha.18

Open renovate[bot] opened this issue 2 years ago • 0 comments

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
net.dv8tion:JDA 5.0.0-alpha.13 -> 5.0.0-alpha.18 age adoption passing confidence

Release Notes

DV8FromTheWorld/JDA

v5.0.0-alpha.18

Compare Source

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

Changes

Bug Fixes

Full Changelog: https://github.com/DV8FromTheWorld/JDA/compare/v5.0.0-alpha.17...v5.0.0-alpha.18

Installation

Gradle

repositories {
    mavenCentral()
}
dependencies {
    implementation("net.dv8tion:JDA:5.0.0-alpha.18")
}

Maven

<dependency>
    <groupId>net.dv8tion</groupId>
    <artifactId>JDA</artifactId>
    <version>5.0.0-alpha.18</version> 
</dependency>

v5.0.0-alpha.17

Fixes some issues regarding the handling of file attachments on messages.

  • Fix to properly clean up resources in MessageAction, which would otherwise cause unwanted warnings
  • Fix issue with interaction replies that make use of files
  • Fix issue with retainFiles on interaction message edits

Installation

Gradle

repositories {
    mavenCentral()
}
dependencies {
    implementation("net.dv8tion:JDA:5.0.0-alpha.17")
}

Maven

<dependency>
    <groupId>net.dv8tion</groupId>
    <artifactId>JDA</artifactId>
    <version>5.0.0-alpha.17</version> 
</dependency>

v5.0.0-alpha.16

This fixes an issue where IMessageEditCallback#editMessage would not properly send the request to edit the message, and instead defer the edit.

Installation

Gradle

repositories {
    mavenCentral()
}
dependencies {
    implementation("net.dv8tion:JDA:5.0.0-alpha.16")
}

Maven

<dependency>
    <groupId>net.dv8tion</groupId>
    <artifactId>JDA</artifactId>
    <version>5.0.0-alpha.16</version> 
</dependency>

v5.0.0-alpha.15

This fixes the ClassCastException when a voice channel updated.

Installation

Gradle

repositories {
    mavenCentral()
}
dependencies {
    implementation("net.dv8tion:JDA:5.0.0-alpha.15")
}

Maven

<dependency>
    <groupId>net.dv8tion</groupId>
    <artifactId>JDA</artifactId>
    <version>5.0.0-alpha.15</version> 
</dependency>

v5.0.0-alpha.14

Overview

Breaking changes and text messages in voice channels!

Text in Voice (#​2072)

This release introduces the long awaited Text in Voice feature. Now you can use all your message related features in voice channels as well! Automatically works with interactions, messages, reactions, and all other features you could want!

Command Localization (#​2090)

Using command localization, you can provide customized translations for all your commands. Check the example: LocalizationExample

API v10 (#​2165)

Since the v9 API will be discontinued at the end of 2022, we have upgraded to the newer version 10. This comes with a few breaking changes:

  • All edit requests with addFile calls (such as message.editMessage(...).addFile(...)), will now remove all current attachments on the message. To retain existing attachments, you are now required to also use retainFiles(...) with the existing attachments on the message.
  • The introduction of GatewayIntent.MESSAGE_CONTENT. In order to use certain user-generated content in messages, you will now be required to explicitly enable this privileged intent. This includes:
    • getContentRaw, getContentDisplay, getContentStripped, and getMentions().getCustomEmojis()
    • getActionRows, and getButtons
    • getAttachments
    • getEmbeds

You will be presented with a warning, if you try using any of those methods without having the required intent enabled.

Attempting to access message content without GatewayIntent.MESSAGE_CONTENT.
Discord now requires to explicitly enable access to this using the MESSAGE_CONTENT intent.
Useful resources to learn more:
	- https://support-dev.discord.com/hc/en-us/articles/4404772028055-Message-Content-Privileged-Intent-FAQ
	- https://jda.wiki/using-jda/gateway-intents-and-member-cache-policy/
	- https://jda.wiki/using-jda/troubleshooting/#im-getting-closecode4014-disallowed-intents
Or suppress this warning if this is intentional with Message.suppressContentIntentWarning()
Channel Unions (#​2138)

We had a lot of repeated concrete type specializations, such as getTextChannel(), all over library. To address this duplication and to make the interface more consitent, we are introducing the concept of channel unions.

These channel unions, are abstracted types, which provide the same features as their respective name would suggest, while also allowing simple specialization using conversion methods.

An example union would be MessageChannelUnion, which is used by Message.getChannel(). This type provides all the methods a normal MessageChannel would, but also allows you to convert it to a more concrete type:

public void onMessageReceived(MessageReceivedEvent event) {
  MessageChannelUnion channel = event.getChannel();
  // Use normal message channel features
  channel.sendMessage("Hello, I received your message!").queue();
  // Specialized handling on concrete types
  if (channel.getType() == ChannelType.VOICE) {
    VoiceChannel vc = channel.asVoiceChannel(); // easy type conversion, just like casting, but with clear type information
    vc.getGuild().getAudioManager().openAudioConnection(vc);
  }
}

New Features

Changes

Bug Fixes

Full Changelog: https://github.com/DV8FromTheWorld/JDA/compare/v5.0.0-alpha.13...v5.0.0-alpha.14

Installation

Gradle

repositories {
    mavenCentral()
}
dependencies {
    implementation("net.dv8tion:JDA:5.0.0-alpha.14")
}

Maven

<dependency>
    <groupId>net.dv8tion</groupId>
    <artifactId>JDA</artifactId>
    <version>5.0.0-alpha.14</version> 
</dependency>

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

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, click this checkbox.

This PR has been generated by Mend Renovate. View repository job log here.

renovate[bot] avatar Jul 17 '22 15:07 renovate[bot]