Update dependency com.github.DV8FromTheWorld:JDA to v4.4.0 - autoclosed #5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
v5.0.0-alpha.3
->4.4.0
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 tov5
. No additional features, documentation changes, or enhancements will be accepted forv4
. Additionally, No changes to support the new GuildIntents.MESSAGE_CONTENT will be backported intov4
. This shouldn't be a problem, asv4
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 forv4
.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
MessageAction
OptionType.NUMBER
supportOptionType.CHANNEL
channel type restrictionsDeprecation
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:
Gradle
Maven
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:
Gradle
Maven
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:
Gradle
Maven
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()
andgetMembers()
. You should now use lazy loading and load members through methods likeretrieveMemberById
orretrieveMembersByPrefix
.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:
createDefault
createLight
create
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
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:
Gradle
Maven
The jcenter repository now only works with https! Please change your URL from http to https
v4.1.1
A lot of people use nested callbacks for things like sending private messages or adding reactions:
This gets very hard to read and maintain. Instead you can use something like
submit()
which returns aCompletableFuture
to allow using continuations such asthenCompose
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 valueflatMap
Chain another
RestAction
on the resultdelay
Delay the element of the previous step
Let's look at the same example using the new
flatMap
operator:This can be expanded to even more complicated chains:
You can imagine how this would look with just queue/queueAfter:
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: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 themajor parameters
of the request. You can figure out which hash is for which bucket fairly quickly by looking for the corresponding cache log:New Features
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:
Gradle
Maven
The jcenter repository now only works with https! Please change your URL from http to https
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.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.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. WithErroResponseException.ignore(...)
you can create a failure consumer that drops anyErrorResponseException
for the specified set of responses. [3]3) Example how to ignore UNKNOWN_MESSAGE errors
New Features
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 withJDA#getUnavailableGuilds
Guild#retrieveVanityUrl
replace withGuild#getVanityUrl
Invite#getCreationTime
replace withInvite#getTimeCreated
JDA#getVoiceChannelByName
replace withJDA#getVoiceChannelsByName
ShardManager#setGame
replace withShardManager#setActivity
SessionController#getGatewayBot
replace withSessionController#getShardedGateway
Incubating
AccountType#CLIENT
this is most likely going to break soon with impending changes to the gatewayJDABuilder(AccountType)
this will be removed whenAccountType#CLIENT
breaks in the futureActivity#watching
,ActivityType#WATCHING
this is not officially supported by the API but currently usableActivityType#CUSTOM_STATUS
this is currently not usable for bots and can only be seen on other usersAudioManager#getSpeakingMode
,AudioManager#setSpeakingMode
this is not a confident implementation and should be used with careInstallation
The release version is:
4.1.0_81
The latest version is:
Gradle
Maven
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:
core
->api
GuildController
getX(): RestAction
toretrieveX(): RestAction
@Nonnull
and@Nullable
annotationsMore 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 textMarkdownSanitizer
A state-machine to sanitize discord markdownGatewayPingEvent
An event for updates to the gateway pingApplicationInfo#getTeam
Team support in applicationsMessage#getMentionedXBag(): Bag<X>
Bag accessors for mentions to check for duplicatesGuild#getVanityCode
andGuild#getVanityUrl
Guild#getBoostTier
,Guild#getBoostCount
, andGuild#getBoosters
Guild#getBannerId
andGuild#getBannerUrl
Guild#getMaxBitrate
andGuild#getMaxEmotes
Guild#getMaxMembers
andGuild#getMaxPresences
Guild#getDescription
Member#getTimeBoosted
AudioReceiveHandler#handleEncodedAudio
andAudioReceiveHandler#canReceiveEncoded
AudioReceiveHandler#includeUserInCombinedAudio
Member#ban
,Member#kick
,Member#mute
,Member#deafen
, andMember#modifyNickname
Guild#getGuildChannelById
andJDA#getGuildChannelById
Guild#kickVoiceMember
MessageChannel#getHistoryFromBeginning
Member#getOnlineStatus(ClientType)
ReactionEmote#isEmoji
,ReactionEmote#getAsCodepoints
, andReactionEmote#getEmoji
AudioManager#setSpeakingDelay
JDA#getUserByTag
,ShardManager#getUserByTag
, andGuild#getMemberByTag
GuildChannel#upsertPermissionOverride
JDABuilder#setVoiceDispatchInterceptor
andDefaultShardManagerBuilder#setVoiceDispatchInterceptor
CacheView#forEachUnordered
,CacheView#applyStream
,CacheView#acceptStream
, andCacheView#lockedIterator
JDA#getRestPing
PaginationAction#skipTo
StoreChannel
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
andAudioManager#getSpeakingMode
Installation
The release version is:
4.0.0_39
The latest version is:
Gradle
Maven
v3.8.3
In this version we only updated the OkHTTP dependency to the stable 3.13.0 release.
Gradle
Maven
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
Thank you all for your contributions!
Versions
Latest version:
The latest release build:
3.8.2_459
Changelog
Additions
Minn#6688
formatChanges
Fixes
Gradle
Maven
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 beforeReadyEvent
andReconnectedEvent
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 asRole.getGuild()
.We highly recommend to just store IDs of entities and a
JDA
instance (if needed) to then do: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(...)
andMessageChannel#purgeMessages(...)
.Example:
Oh and one more thing... we added a
CacheFlag
enum to disable some parts of the JDA cache to be more lightweight.Pull Requests
Thank you all for your contributions!
Versions
Latest version:
The latest release build:
3.8.0_423
Changelog
Additions
Changes
JDA#awaitReady()
on the built JDA instanceWeakReference
internally to avoid memory leaks and issues coming from user codeFixes
Deprecation
buildAsync()
andbuildBlocking()
for newbuild()
andawaitReady()
methodsIncubating
JDABuilder(AccountType)
might be removed in a future versionGame.watching
andGameType.WATCHING
are not officially releasedRichPresence.Party.getMax()
and..getSize()
will be changed to return `long`AudioManager.setSpeakingMode
and..getSpeakingMode
are not officially releasedGradle
Maven
v3.7.1
This fixes a bug introduced by 3.7.0 which causes the DefaultSendSystem to fail delivering packages.
Pull Requests
Thank you all for your contributions!
Versions
Latest version:
The latest release build: 3.7.1_385
Changelog
Additions
+ AddgetGuildsByName
toShardManager
Fixes
- Fixed issue with DefaultAudioSendSystemGradle
Maven
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.
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:
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
Thank you all for your contributions!
Versions
Latest verison:
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
Maven