Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependency com.github.DV8FromTheWorld:JDA to v4.4.0 - autoclosed #5

Closed
wants to merge 1 commit into from

Conversation

renovate[bot]
Copy link

@renovate renovate bot commented Jan 8, 2022

WhiteSource Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
com.github.DV8FromTheWorld:JDA v5.0.0-alpha.3 -> 4.4.0 age adoption passing confidence

Release Notes

DV8FromTheWorld/JDA

v4.4.0

This release is long overdue, but with it comes the decision to place v4 into LTS status.

Support for v4 will consist only of bug fixes from this point forward as development focus turns to v5. No additional features, documentation changes, or enhancements will be accepted for v4. Additionally, No changes to support the new GuildIntents.MESSAGE_CONTENT will be backported into v4. This shouldn't be a problem, as v4 handles things well, but it bares mentioning.

The LTS support timer will start once v5 reaches a level of maturity that we feel confident enough in, such that we would recommend transition to it for all developers. It will likely start once v5 hits beta and 6 months after that we will drop support for v4.

Going forward, we will be working on getting the v5.0.0 alpha builds out.

Also, Please take a moment to look at the deprecated features as they will all be removed in v5
New Features
Deprecation

All deprecated features in v4 will be removed in v5!
Detailed javadoc can be found in the deprecated tab of the docs

Installation

The release version is: 4.4.0_350
The latest version is: latest version

Gradle
repositories {
    mavenCentral()
    maven {
        name 'm2-dv8tion'
        url 'https://m2.dv8tion.net/releases'
    }
}
dependencies {
    implementation("net.dv8tion:JDA:4.4.0_350")
}
Maven
<dependency>
    <groupId>net.dv8tion</groupId>
    <artifactId>JDA</artifactId>
    <version>4.4.0_350</version>
</dependency>
<repository>
    <id>dv8tion</id>
    <name>m2-dv8tion</name>
    <url>https://m2.dv8tion.net/releases</url>
</repository>
Changelog
New Contributors

Full Changelog: discord-jda/JDA@v4.3.0...v4.4.0

v4.3.0

In this release, we are adding support for the new interactions API for bots. You can now use slash-commands and buttons with your bot to enhance the integration into the Discord interface.

Some useful resources:

Keep in mind that Slash-Commands are a lot more limited and always require a response. You should make sure you understand the restrictions implied by slash-commands before converting your existing implementations. I wrote some guidelines you should be aware of in this gist: Slash Command Limitations

Support for stage channels will be added in the next release. In the meantime, just imagine a place where it's implemented!

New Features

You can check the full list of pull requests for more details:
4.3.0 Milestone

Thank you all for your contributions!

Deprecation

Detailed javadoc can be found in the deprecated tab of the docs

Installation

The release version is: 4.3.0_277
The latest version is: latest version

Gradle
repositories {
    mavenCentral()
    maven {
        name 'm2-dv8tion'
        url 'https://m2.dv8tion.net/releases'
    }
}
dependencies {
    implementation("net.dv8tion:JDA:4.3.0_277")
}
Maven
<dependency>
    <groupId>net.dv8tion</groupId>
    <artifactId>JDA</artifactId>
    <version>4.3.0_277</version>
</dependency>
<repository>
    <id>dv8tion</id>
    <name>m2-dv8tion</name>
    <url>https://m2.dv8tion.net/releases</url>
</repository>

v4.2.1

With this release, we are addressing the sunset of the jcenter repository. (Read More)
We switched our release to a custom solution which is now hosted on https://m2.dv8tion.net/releases
See below in the Installation section for further details on the new repository.

Slash Commands, Stage Channels, and API v8 are going to be addressed in 4.3.0.

New Features

You can check the full list of pull requests for more details:
4.2.1 Milestone

Thank you all for your contributions!

Deprecation

Detailed javadoc can be found in the deprecated tab of the docs

Installation

The release version is: 4.2.1_253
The latest version is: latest version

Gradle
repositories {
    mavenCentral()
    maven {
        name 'm2-dv8tion'
        url 'https://m2.dv8tion.net/releases'
    }
}
dependencies {
    implementation("net.dv8tion:JDA:4.2.1_253")
}
Maven
<dependency>
    <groupId>net.dv8tion</groupId>
    <artifactId>JDA</artifactId>
    <version>4.2.1_253</version>
</dependency>
<repository>
    <id>dv8tion</id>
    <name>m2-dv8tion</name>
    <url>https://m2.dv8tion.net/releases</url>
</repository>

v4.2.0

All support for AccountType.CLIENT has been removed. We can no longer support this API as it has diverged too much from the bot API.

In this release, we have to take a look at the new Discord API changes. As of late discord has been putting a lot of work into the privacy protection of their users. Unfortunately, that also includes limiting the data available to bots.
Bots are now required to explicitly state which features they intend to use by providing a set of GatewayIntents.

Additionally, bots should no longer directly depend on the cache of users/members with methods like getUserById() and getMembers(). You should now use lazy loading and load members through methods like retrieveMemberById or retrieveMembersByPrefix.

The old default behavior was to perform chunking on startup (explained in wiki article below). However, chunking is now a privileged feature which bots should not depend on. For this reason, we deprecated the old JDABuilder (and DefaultShardManagerBuilder) constructors in favor of new factory methods:

I've added a new wiki page that explains this in more detail: Gateway Intents and Member Cache Policy.

We have switched to the new domain discord.com. This will be required as of November 7, 2020.

New Features
  • GatewayIntents
  • MemberCachePolicy
  • Invite events
  • Mention Whitelist
  • RestAction timeout/deadline

You can check the full list of pull requests for more details:
4.2.0 Milestone

Thank you all for your contributions!

Deprecation

Detailed javadoc can be found in the deprecated tab of the docs

Installation

The release version is: 4.2.0_168
The latest version is: version

Gradle
repositories {
    jcenter()
}
dependencies {
    compile("net.dv8tion:JDA:4.2.0_168")
}
Maven

The jcenter repository now only works with https! Please change your URL from http to https

<dependency>
    <groupId>net.dv8tion</groupId>
    <artifactId>JDA</artifactId>
    <version>4.2.0_168</version>
</dependency>
<repository>
    <id>jcenter</id>
    <name>jcenter-bintray</name>
    <url>https://jcenter.bintray.com</url>
</repository>

v4.1.1

A lot of people use nested callbacks for things like sending private messages or adding reactions:

@&#8203;Override
public void onMessageReceived(MessageReceivedEvent event) {
  if (event.getMessage().getContentRaw().equals("!hello")) {
    user.openPrivateChannel().queue(
      channel -> channel.sendMessage("Hello Friend").queue(null,
        error -> event.getChannel().sendMessage("Failed to send message!").queue()));
  }
}

This gets very hard to read and maintain. Instead you can use something like submit() which returns a CompletableFuture to allow using continuations such as thenCompose and similar. This is great and all but that API is rather bad as it will swallow any errors by default and the error handling methods are not very nice.
We added a few new operators for common actions on RestAction:

  • map
    Convert the result of the RestAction to a different value
  • flatMap
    Chain another RestAction on the result
  • delay
    Delay the element of the previous step

Let's look at the same example using the new flatMap operator:

@&#8203;Override
public void onMessageReceived(MessageReceivedEvent event) {
  if (event.getMessage().getContentRaw().equals("!hello")) {
    user.openPrivateChannel()
           .flatMap(channel -> channel.sendMessage("Hello Friend"))
           .queue(null, error -> event.getChannel().sendMessage("Failed to send message!").queue()));
  }
}

This can be expanded to even more complicated chains:

@&#8203;Override
public void onMessageReceived(MessageReceivedEvent event) {
  if (event.getMessage().getContentRaw().equals("!hello")) {
    event.getChannel().sendMessage("I'll contact you in 10 seconds") // MessageAction
      .delay(Duration.ofSeconds(10)) // delay next flatMap by 10 seconds
      .flatMap(m -> user.openPrivateChannel()) // RestAction<PrivateChannel>
      .flatMap(channel -> channel.sendMessage("Hello Friend, this will self destruct in 30 seconds")) // RestAction<Message>
      .delay(Duration.ofSeconds(30)) // delay next flatMap by 30 seconds
      .flatMap(Message::delete) // RestAction<Void>
      .queue(null, error -> event.getChannel().sendMessage("Failed to send message!").queue()));
  }
}

You can imagine how this would look with just queue/queueAfter:

@&#8203;Override
public void onMessageReceived(MessageReceivedEvent event) {
  if (event.getMessage().getContentRaw().equals("!hello")) {
    event.getChannel().sendMessage("I'll contact you in 10 seconds").queue(m ->
      user.openPrivateChannel().queueAfter(10, TimeUnit.SECONDS, channel -> 
        channel.sendMessage("Hello Friend, this will self descruct in 30 seconds").queueAfter(30, TimeUnit.SECONDS,
          message -> message.delete().queue(),
          error -> event.getChannel().sendMessage("Failed to send message!").queue()
        )
      )
    );
  }
}

We also changed the implementation for the Rate Limiter in JDA which will now properly keep track of the "new" X-RateLimit-Bucket header to track which endpoints share the same rate-limit. This also means that JDA will now allow multiple requests to the same path while they follow different HTTP methods. For the user this just means, JDA now has a better understanding of how discord will limit your requests.

The new rate-limiter also has improved logging. You can now see which routes have what rate-limit by setting the logging level of net.dv8tion.jda.internal.requests.RateLimiter to trace. This will log messages such as this:

Updated bucket 80c17d2f203122d936070c88c8d10f33:guild_id:125227483518861312:webhook_id to (4/5, 4408)

The numbers at the end have this meaning (remaining requests/allowed requests in the reset time, milliseconds until reset).
The long bucket id is composed of the hash and the major parameters of the request. You can figure out which hash is for which bucket fairly quickly by looking for the corresponding cache log:

Caching bucket hash POST/channels/{channel_id}/messages -> 80c17d2f203122d936070c88c8d10f33
New Features
  • RestAction operators (flatMap, map, delay)
  • JDABuilder#setMaxBufferSize (same for shard manager)
  • Message#suppressEmbeds and Message#getFlags
Deprecation

Detailed javadoc can be found in the deprecated tab of the docs

Installation

The release version is: 4.1.1_101
The latest version is: version

Gradle
repositories {
    jcenter()
}
dependencies {
    compile "net.dv8tion:JDA:4.1.1_101"
}
Maven

The jcenter repository now only works with https! Please change your URL from http to https

<dependency>
    <groupId>net.dv8tion</groupId>
    <artifactId>JDA</artifactId>
    <version>4.1.1_101</version>
</dependency>
<repository>
    <id>jcenter</id>
    <name>jcenter-bintray</name>
    <url>https://jcenter.bintray.com</url>
</repository>
Pull Requests

You can view the 4.1.1 Milestone for a list of accepted pull requests for this release. Thank you to everyone who contributed!

v4.1.0

We added support for lazy loading and now allow to disable guild subscriptions!

To enable lazy loading you have to configure a ChunkingFilter on your builder of choice [1]. Lazy loading means that JDA will not attempt to request the entire member list of a guild before starting to send events. Instead, members will be loaded on their first activity and members who are never active will never be loaded into cache.

new JDABuilder(TOKEN)
    .setChunkingFilter(ChunkingFilter.NONE) // don't chunk any guilds
    .build();

1) Example how to enable lazy loading

The more extreme choice is to disable guild subscriptions [2]. This feature completely disables member and user cache for the shard/jda session. Note that if you need methods like Guild#getMembers or similar things that require knowledge of the entire member list this is not something you should be using. JDA cannot determine the size of a guild or member join/leave with this disabled. The benefit of this is a greatly reduced memory footprint with the disadvantage of losing member state tracking.

new JDABuilder(TOKEN)
    .setGuildSubscriptionsEnabled(false)
    .build();

2) Example how to disable guild subscriptions

A footnote is that CacheFlag.VOICE_STATE can still be tracked and users in voice channels will still be loaded into cache when this cache flag is enabled. This is useful for music bots that want to leave a voice channel if they are alone.

You can now ignore specific ErrorResponse failures more easily. With ErroResponseException.ignore(...) you can create a failure consumer that drops any ErrorResponseException for the specified set of responses. [3]

import static net.dv8tion.jda.api.exceptions.ErrorResponseException.ignore;
import static net.dv8tion.jda.api.requests.ErrorResponse.*;

message.delete().queue(null, ignore(UNKNOWN_MESSAGE)); // ignore if message doesn't exist anymore
message.delete().queue(null, ignore(Logger::error, UNKNOWN_MESSAGE)); // ignore otherwise log

3) Example how to ignore UNKNOWN_MESSAGE errors

New Features
  • Lazy Loading and disable guild subscriptions
  • Readonly support for custom status
  • Member#getActiveClients
  • ErrorResponseException.ignore(...)
Deprecation

Detailed javadoc can be found in the deprecated tab of the docs

  • GuildUnavailableException, Guild#isAvailable this is no longer used, unavailable guilds are no longer in the guild cache. You can check if a guild is unavailable with JDA#getUnavailableGuilds
  • Guild#retrieveVanityUrl replace with Guild#getVanityUrl
  • Invite#getCreationTime replace with Invite#getTimeCreated
  • JDA#getVoiceChannelByName replace with JDA#getVoiceChannelsByName
  • ShardManager#setGame replace with ShardManager#setActivity
  • SessionController#getGatewayBot replace with SessionController#getShardedGateway
Incubating
  • AccountType#CLIENT this is most likely going to break soon with impending changes to the gateway
  • JDABuilder(AccountType) this will be removed when AccountType#CLIENT breaks in the future
  • Activity#watching, ActivityType#WATCHING this is not officially supported by the API but currently usable
  • ActivityType#CUSTOM_STATUS this is currently not usable for bots and can only be seen on other users
  • AudioManager#getSpeakingMode, AudioManager#setSpeakingMode this is not a confident implementation and should be used with care
Installation

The release version is: 4.1.0_81
The latest version is: version

Gradle
repositories {
    jcenter()
}
dependencies {
    compile "net.dv8tion:JDA:4.1.0_81"
}
Maven
<dependency>
    <groupId>net.dv8tion</groupId>
    <artifactId>JDA</artifactId>
    <version>4.1.0_81</version>
</dependency>
<repository>
    <id>jcenter</id>
    <name>jcenter-bintray</name>
    <url>https://jcenter.bintray.com</url>
</repository>
Pull Requests

You can view the 4.1.0 Milestone for a list of accepted pull requests for this release. Thank you to everyone who contributed!

v4.0.0

This release bumps the major version because we have done a number of breaking changes. The most notable ones are:

  • Package rename core -> api
  • Removed GuildController
  • Renamed getX(): RestAction to retrieveX(): RestAction
  • Added @Nonnull and @Nullable annotations

More can be found in the migration guide.

The plan for version 3.X is to keep updating it with bug fixes until 01/01/2020. We recommend migrating your codebase before then.

New Features
  • MarkdownUtil A utility to easily apply markdown to text
  • MarkdownSanitizer A state-machine to sanitize discord markdown
  • GatewayPingEvent An event for updates to the gateway ping
  • ApplicationInfo#getTeam Team support in applications
  • Message#getMentionedXBag(): Bag<X> Bag accessors for mentions to check for duplicates
  • Guild#getVanityCode and Guild#getVanityUrl
  • Guild#getBoostTier, Guild#getBoostCount, and Guild#getBoosters
  • Guild#getBannerId and Guild#getBannerUrl
  • Guild#getMaxBitrate and Guild#getMaxEmotes
  • Guild#getMaxMembers and Guild#getMaxPresences
  • Guild#getDescription
  • Member#getTimeBoosted
  • AudioReceiveHandler#handleEncodedAudio and AudioReceiveHandler#canReceiveEncoded
  • AudioReceiveHandler#includeUserInCombinedAudio
  • Member#ban, Member#kick, Member#mute, Member#deafen, and Member#modifyNickname
  • Guild#getGuildChannelById and JDA#getGuildChannelById
  • Guild#kickVoiceMember
  • MessageChannel#getHistoryFromBeginning
  • Member#getOnlineStatus(ClientType)
  • ReactionEmote#isEmoji, ReactionEmote#getAsCodepoints, and ReactionEmote#getEmoji
  • AudioManager#setSpeakingDelay
  • JDA#getUserByTag, ShardManager#getUserByTag, and Guild#getMemberByTag
  • GuildChannel#upsertPermissionOverride
  • JDABuilder#setVoiceDispatchInterceptor and DefaultShardManagerBuilder#setVoiceDispatchInterceptor
  • CacheView#forEachUnordered, CacheView#applyStream, CacheView#acceptStream, and CacheView#lockedIterator
  • JDA#getRestPing
  • PaginationAction#skipTo
  • Support for StoreChannel
  • New message types
  • Lots of new events and setters on managers
Deprecation
  • Emote#hasRoles -> Emote#canProvideRoles
  • Guild#retrieveVanityUrl -> Guild#getVanityCode
  • Invite#getCreationTime -> Invite#getTimeCreated
  • JDA#getVoiceChannelByName -> JDA#getVoiceChannelsByName
  • DefaultShardManagerBuilder#setEventManager -> DefaultShardManagerBuilder#setEventManagerProvider
  • ShardManager#setGame -> ShardManager#setActivity
  • SessionController#getGatewayBot -> SessionController#getShardedGateway
Incubating
  • JDABuilder(AccountType)
  • Activity.watching
  • AudioManager#setSpeakingMode and AudioManager#getSpeakingMode
Installation

The release version is: 4.0.0_39
The latest version is: version

Gradle
repositories {
    jcenter()
}
dependencies {
    compile "net.dv8tion:JDA:4.0.0_39"
}
Maven
<dependency>
    <groupId>net.dv8tion</groupId>
    <artifactId>JDA</artifactId>
    <version>4.0.0_39</version>
</dependency>
<repository>
    <id>jcenter</id>
    <name>jcenter-bintray</name>
    <url>https://jcenter.bintray.com</url>
</repository>

v3.8.3

In this version we only updated the OkHTTP dependency to the stable 3.13.0 release.

Gradle
repositories {
    jcenter()
}
dependencies {
    implementation("net.dv8tion:JDA:3.8.3_464")
}
Maven
<dependency>
    <groupId>net.dv8tion</groupId>
    <artifactId>JDA</artifactId>
    <version>3.8.3_464</version>
</dependency>
<repository>
    <id>jcenter</id>
    <name>jcenter-bintray</name>
    <url>http://jcenter.bintray.com</url>
</repository>

v3.8.2

Important Notice

Recently we have started work on the new major version of JDA
This release signals the end of JDA v3's lifecycle in which we will only be fixing critical issues for the supported timeframe. Once v4 becomes the new stable release we will continue fixing issues with v3 for 6 months to give people with a huge codebase enough time for the conversion. The current expected time for the JDA version 4 release is mid May.

Currently JDA version 4 is in its alpha stadium. This means it receives breaking changes which are not yet supported by 3rd party extensions like lavalink. Once version 4 reaches its beta stadium we will make efforts to help extension developers to adapt to the new ABI provided as soon as possible. We attempt to make a clear separation between what we consider API and internal. We expect extensions to only target the API side of JDA in the future to reduce the possibility of causing incompatibilities.

New features and enhancements will only be coming to JDA 4. This includes new features of Discord as well as overhead reduction such as the changes done to CacheView. One of the major changes coming here is the removal of client-only features such as group channels/messages. We will however continue to support using JDA with AccountType.CLIENT but it will be reduced to features available to bot accounts.

To track what is happening with JDA 4 you can take a look at the milestone: v4


Pull Requests
PR Description
#​793 Read-only MessageActivity support
#​795 Add Guild#getChannels for convenience
#​811 Added setPresence to ShardManager and improved documentation consistency
#​814 Added appendCodeLine(CharSequence text)
#​819 Add ChannelAction#setPosition(Integer)
#​820 Close socket on malformed zip data
#​825 Added copying of the slowmode when cloning a channel
#​826 Hacktoberfest Changes
#​827 Don't check admin on permission overrides
#​843 Update OkHTTP to 3.12.0
#​849 Create User#getAsTag
#​887 Add MESSAGE_ADD_REACTION to text only permissions
#​896 Ignore alpha when comparing colors in MessageEmbed

Thank you all for your contributions!

Versions

Latest version: Download

The latest release build: 3.8.2_459

Changelog

Additions

  • Guild#getChannels to get the display order of the channels in a guild
  • MessageBuilder#appendCodeLine for more intuitive monospace usage
  • ShardManager#setPresence to update both game an online-status in one request
  • ChannelAction#setPosition for applying a channel position before its creation
  • User#getAsTag for easy retrieval of Minn#​6688 format
  • MessageActivity support for spotify and game invites

Changes

  • The WebSocket will now reconnect when malformed data is received for better recovering
  • MessageEmbed#equals now only checks RGB value of the raw color instead of RGBA

Fixes

  • VoiceJoin events now fire with updated muted/deafened status
  • Slowmode property is now copied with Channel#createCopy
  • ContextException are now fired properly again
  • The ADMINISTRATOR permission is no longer checked when set on permission overrides

Gradle
repositories {
    jcenter()
    // Required for OkHTTP 3.13.0-SNAPSHOT
    maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
}

dependencies {
    compile 'net.dv8tion:JDA:3.8.2_459'
}
Maven
<dependency>
    <groupId>net.dv8tion</groupId>
    <artifactId>JDA</artifactId>
    <version>3.8.2_459</version>
</dependency>

<repository>
    <id>jcenter</id>
    <name>jcenter-bintray</name>
    <url>http://jcenter.bintray.com</url>
</repository>
<repository> <!-- Required for OkHTTP 3.13.0-SNAPSHOT -->
    <id>sonatype</id>
    <name>sonatype-snapshots</name>
    <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</repository>

v3.8.0

Due to reports of several issues with shards starting I took the time to completely rewrite all of the startup logic in this release. (#​706)
These changes have close to no affect to your codebase apart from one little improvement. I have added GuildReadyEvent which is fired for every single guild on startup before ReadyEvent and ReconnectedEvent are received. This allows guilds to already function without having to wait for everything else to be completed. This means no single guild can keep an entire shard dead. (Users have asked for this).

Because of several caching issues caused by users storing JDA entities such as roles or channels we now changed the cache to use WeakReferences for things such as Role.getGuild().
We highly recommend to just store IDs of entities and a JDA instance (if needed) to then do:

Role role = jda.getRoleById(modRoleId);
...

More on this issue is talked about in the new troubleshooting page.

Deleting messages was really annoying in the past with JDA, until now!
Simply use MessagePaginationAction#takeAsync(...) and MessageChannel#purgeMessages(...).
Example:

MessageChannel channel = event.getChannel();
if (event.getMessage().getContentRaw().equals("--purge")) {
    channel.getIterableHistory().takeAsync(500)
           .thenAccept(channel::purgeMessages);
}

Oh and one more thing... we added a CacheFlag enum to disable some parts of the JDA cache to be more lightweight.

EnumSet<CacheFlag> disabled = EnumSet.of(CacheFlag.GAME, CacheFlag.EMOTE);
JDABuilder builder = new JDABuilder(BOT_TOKEN);
builder.setDisabledCacheFlags(disabled);

I highly recommend only using setDisabledCacheFlags for backwards compatibility.

Pull Requests
PR Description
#​674 Improve gradle builds and debugging
#​700 Add jump-to URL for Messages
#​705 Add more configurations to JDABuilder
#​706 Rewrite for guild setup system
#​709 Better group Invite support
#​721 Improve use of MDC
#​722 Add South African server region
#​726 Make use of WeakReference for upstream references
#​731 Add Permission.PRIORITY_SPEAKER
#​732 Add support for new sending modes
#​734 Support getting ban by Id
#​735 Add support for getting webhooks by id
#​738 Change minimum channel name length to 1
#​740 Add support to retrieve emotes via RestAction access
#​741 Added retrieveUserById to ShardManager
#​745 Add new annotations for common documentation concerns
#​747 Fix IllegalArgumentException on TextChannel#canTalk()
#​748 Patch upstream reference
#​749 Add request exceptions to cause of ErrorResponseException
#​750 Add purgeMessages methods for convenient message deletions
#​751 Allow [embed] titles without TLD
#​752 Fix NullPointerException in EmoteImpl#getGuild()
#​754 Add ThreadLocalReason
#​756 Prevent creation of audio manager for uncached guilds
#​757 Replace Emote#hasRoles to avoid ambiguity
#​758 Update documentation of JDABuilder and add new constructor overloads
#​761 Fix ShardManager#getGuildById
#​764 Cleanup RTP handling
#​766 Make AudioWebSocket a subordinate class
#​769 Fix granting / denying permissions [in PermOverrideManager]
#​770 Only update lastFrameSent when actually sending something

Thank you all for your contributions!

Versions

Latest version: Download

The latest release build: 3.8.0_423

Changelog

Additions

  • ThreadLocalReason to set thread specific audit log reasons
  • Group invite support
  • JDABuilder#setCacheFlags, and CacheFlag enum
  • MessageChannel#purgeMessages
  • PaginationAction#takeAsync and PaginationAction#takeAsyncRemaining
  • ShardManager#retrieveUserById
  • Guild#retrieveEmote, Guild#retrieveEmoteById, and Guild#retrieveEmotes
  • JDA#getWebhookById
  • JDA#awaitStatus and JDA#awaitReady
  • JDABuilder#setCallbackPool, JDABuilder#setRateLimitPool, and JDABuilder#setHttpClient
  • Permission.PRIORITY_SPEAKER and AudioManager#setSpeakingMode
  • Region.SOUTH_AFRICA and Region.VIP_SOUTH_AFRICA
  • Message#getJumpUrl

Changes

  • JDABuilder will now only have a single build method `build()` and can be made blocking by calling JDA#awaitReady() on the built JDA instance
  • JDA cache can now partially be disabled to reduce memory impact
  • JDA now uses WeakReference internally to avoid memory leaks and issues coming from user code

Fixes

  • Several fixes for audio receiving and sending
  • Several fixes for shard startup (rewrite)
  • Usage of SLF4J MDC has been improved

Deprecation

  • Removed previously deprecated methods in WebhookMessage and WebhookMessageBuilder
  • Deprecated legacy build methods buildAsync() and buildBlocking() for new build() and awaitReady() methods
  • Deprecated Emote#hasRoles to avoid ambiguity. Use Emote#canProvideRoles

Incubating

  • JDABuilder(AccountType) might be removed in a future version
  • Game.watching and GameType.WATCHING are not officially released
  • RichPresence.Party.getMax() and ..getSize() will be changed to return `long`
  • AudioManager.setSpeakingMode and ..getSpeakingMode are not officially released

Note the new Incubating category which marks things that might change without deprecation phase.


Gradle
repositories {
    jcenter()
}

dependencies {
    compile 'net.dv8tion:JDA:3.8.0_423'
}
Maven
<dependency>
    <groupId>net.dv8tion</groupId>
    <artifactId>JDA</artifactId>
    <version>3.8.0_423</version>
</dependency>

<repository>
    <id>jcenter</id>
    <name>jcenter-bintray</name>
    <url>http://jcenter.bintray.com</url>
</repository>

v3.7.1

This fixes a bug introduced by 3.7.0 which causes the DefaultSendSystem to fail delivering packages.

Pull Requests
PR Description
#​714 Add getGuildsByName to ShardManager

Thank you all for your contributions!

Versions

Latest version: Download

The latest release build: 3.7.1_385

Changelog

Additions

+ Add getGuildsByName to ShardManager

Fixes

- Fixed issue with DefaultAudioSendSystem

Gradle
repositories {
    jcenter()
}

dependencies {
    compile 'net.dv8tion:JDA:3.7.1_385'
}
Maven
<dependency>
    <groupId>net.dv8tion</groupId>
    <artifactId>JDA</artifactId>
    <version>3.7.1_385</version>
</dependency>

<repository>
    <id>jcenter</id>
    <name>jcenter-bintray</name>
    <url>http://jcenter.bintray.com</url>
</repository>

v3.5.1

It really is difficult to debug when the stacktraces of RestAction failures don't point to your code...
We got the thing for you! In 3.5.1 we added ContextException which can be used to track caller context for rest actions. What does this mean?

Simply add a failure consumer (see #queue(Consumer, Consumer)) to your restaction queue call and it will create a context exception right there. That exception is then added as a cause to the resulting failure.

RestAction<?> action = channel.sendMessage("Hello, World");
action.queue(null, ContextException.herePrintingTrace());

This will result in a proper exception with traces of the calling code.

If you need to do severe debugging you might want this on every rest action to test.
For this you can simply do the following:

RestAction.setPassContext(true); // enable context by default
RestAction.DEFAULT_FAILURE = Throwable::printStackTrace;

Doing this will result in major performance loss so it is recommended to only go to this extreme when you need to debug errors

Pull Requests
PR Description
#​550 Added ContextException and checks for RestAction improvements
#​597 Fix unban string
#​600 Improved RequestFuture interface
#​604 Removed caching of delete events
#​605 "Fixed" permissions
#​606 Replaces Semaphore with (superior) ReentrantLock
#​614 Fixed Message#getMentionedX() methods returning non-mentioned entities
#​618 Lazy evaluation of HTTP responses

Thank you all for your contributions!

Versions

Latest verison: Download

The latest release build: 3.5.1_339

Changelog

Downloads for this version are available from the build server:
http://home.dv8tion.net:8080/job/JDA/ or below.

Gradle
repositories {
    jcenter()
}

dependencies {
    compile 'net.dv8tion:JDA:3.5.1_339'
}
Maven
<dependency>
    <groupId>net.dv8tion</groupId>
    <art

</details>

---

### Configuration

📅 **Schedule**: 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.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/ryzech/smpcore).

@renovate renovate bot force-pushed the renovate/com.github.dv8fromtheworld-jda-4.x branch 3 times, most recently from d4cf779 to c7da7ae Compare January 9, 2022 05:58
@renovate renovate bot changed the title Update dependency com.github.DV8FromTheWorld:JDA to v4.4.0 Update dependency com.github.DV8FromTheWorld:JDA to v4.4.0 - autoclosed Jan 9, 2022
@renovate renovate bot closed this Jan 9, 2022
@renovate renovate bot deleted the renovate/com.github.dv8fromtheworld-jda-4.x branch January 9, 2022 11:53
@renovate renovate bot changed the title Update dependency com.github.DV8FromTheWorld:JDA to v4.4.0 - autoclosed Update dependency com.github.DV8FromTheWorld:JDA to v4.4.0 Jan 9, 2022
@renovate renovate bot restored the renovate/com.github.dv8fromtheworld-jda-4.x branch January 9, 2022 14:07
@renovate renovate bot reopened this Jan 9, 2022
@renovate renovate bot force-pushed the renovate/com.github.dv8fromtheworld-jda-4.x branch 3 times, most recently from 66474d2 to b718d3c Compare January 9, 2022 21:14
@renovate renovate bot force-pushed the renovate/com.github.dv8fromtheworld-jda-4.x branch from b718d3c to 885c6d0 Compare January 9, 2022 21:29
@renovate renovate bot changed the title Update dependency com.github.DV8FromTheWorld:JDA to v4.4.0 Update dependency com.github.DV8FromTheWorld:JDA to v4.4.0 - autoclosed Jan 9, 2022
@renovate renovate bot closed this Jan 9, 2022
@renovate renovate bot deleted the renovate/com.github.dv8fromtheworld-jda-4.x branch January 9, 2022 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant