Releases: discord-jda/JDA
v5.0.0-alpha.9
Changelog
This release is a follow up hotfix release for 5.0.0-alpha.6 that fixes issues caused by a bug in Discord (discord/discord-api-docs#4557). We felt it was faster to put out a baindaid than to wait for the fix from Discord's side.
Check out the patch notes on 5.0.0-alpha.6 for the cool new stuff.
New Features
N/A
Changes
- Fix issues with event cache by @MinnDevelopment in #2045
- Drop message create for ephemeral messages by @MinnDevelopment in #2043
Removed
- Technically receiving ephemeral messages via
MESSAGE_CREATE
(ThusMessageReceivedEvent
) is now no longer supported.- To be clear, this would be receiving a
MessageReceivedEvent
for an ephemeral message that the bot itself sent.
- To be clear, this would be receiving a
Full Changelog: v5.0.0-alpha.8...v5.0.0-alpha.9
Installation
Gradle
repositories {
mavenCentral()
}
dependencies {
implementation("net.dv8tion:JDA:5.0.0-alpha.9")
}
Maven
<dependency>
<groupId>net.dv8tion</groupId>
<artifactId>JDA</artifactId>
<version>5.0.0-alpha.9</version>
</dependency>
v5.0.0-alpha.8 | alpha.6 Hotfix 2: Electric Boogaloo
Changelog
This release is a follow up hotfix release for 5.0.0-alpha.6 that wasn't completely mitigated by the 5.0.0-alpha.7 hotfix.
Check out the patch notes on 5.0.0-alpha.6 for the cool new stuff.
New Features
N/A
Changes
- Restructure message creation to handle a lack of guild_id by @DV8FromTheWorld in #2039
Removed
N/A
Full Changelog: v5.0.0-alpha.7...v5.0.0-alpha.8
Installation
Gradle
repositories {
mavenCentral()
}
dependencies {
implementation("net.dv8tion:JDA:5.0.0-alpha.8")
}
Maven
<dependency>
<groupId>net.dv8tion</groupId>
<artifactId>JDA</artifactId>
<version>5.0.0-alpha.8</version>
</dependency>
v5.0.0-alpha.7 | Hotfix for alpha.6
Changelog
This release is a hotfix release for 5.0.0-alpha.6. Check out the patch notes on that version for the cool stuff.
New Features
N/A
Changes
- Make javadocs fail on error by @Sanduhr32 in #2033
- Fixes NPE from uncached users by @oliver276 in #2035
- Make Messages for Interactions properly reference their channels instead of PrivateChannel by @oliver276 in #2038
Removed
N/A
Full Changelog: v5.0.0-alpha.6...v5.0.0-alpha.7
Installation
Gradle
repositories {
mavenCentral()
}
dependencies {
implementation("net.dv8tion:JDA:5.0.0-alpha.7")
}
Maven
<dependency>
<groupId>net.dv8tion</groupId>
<artifactId>JDA</artifactId>
<version>5.0.0-alpha.7</version>
</dependency>
v5.0.0-alpha.6 | Attachment Options & Breaking Cleanup
Changelog
This release includes a variety of breaking changes that were needed to either correctly model how Discord models things in their API or to better set us up for future development.
In this version, we added a new pattern for options on commands. You can now use getOption(name[, fallback], resolver)
to easily get any optional arguments for your commands:
public void onSlashCommandInteraction(SlashCommandInteractionEvent event)
{
// name fallback resolver
// null if user is not a member of the guild (fallback not used, since option is mapped to a User instance)
Member member = event.getOption("target", event::getMember, OptionMapping::getAsMember);
// null if fallback is used (getAsUser cannot be null)
User user = event.getOption("target", null , OptionMapping::getAsUser);
// null fallback implied
User nullable = event.getOption("target", OptionMapping::getAsUser); // <- implicit fallback null
// real use-cases:
int days = event.getOption("days", 7, OptionMapping::getAsInt); // optional ban days
String reason = event.getOption("reason", "banned by mod", OptionMapping::getAsString); // optional ban reason
}
You can also now flip the iteration direction for MessageChannel.getIterableHistory. A common request as of late, was to get the first messages of a channel, which can now be accomplished by doing channel.getIterableHistory().reverse().takeAsync(1000)
.
New Features
- Add support for attachment options by @MinnDevelopment in #2001
- Add CommandInteractionPayload#getOption fallback overloads by @MinnDevelopment in #2018
- Add PaginationAction#order by @MinnDevelopment in #1945
- Add Booster to memberCachePolicy by @sweetsofimc in #2022
- Add IGuildChannelContainer and getChannelById(Class, id) by @MinnDevelopment in #1949
Changes
- [Breaking] Change PrivateChannel#getUser to handle API nullability by @oliver276 in #2012
- [Breaking] Make getDefaultChannel return BaseGuildMessageChannel by @MinnDevelopment in #2016
- [Semi-Breaking] Dont override latest message id on deletion event by @ishwi in #2013
- [Breaking] Change some voice Regions and remove VOICE_CHANNEL_REGIONS set by @caneleex in #1962
- Fix OptionData#setAutoComplete logic. by @portlek in #2003
- Fix max file size limit in MessageAction by @Xirado in #2017
- Fix javadoc warnings by @Chew in #1976
- Fix misspelled ErrorResponse enum value by @Xirado in #2031
- Fix missing cache cleanup for news/stage/thread channels by @Mitmocc in #2029
Removed
- Removed excessive non-alphanumeric check by @RobotHanzo in #2021
- [Breaking] Remove StoreChannel by @V-Play-Games in #2011
Full Changelog: v5.0.0-alpha.5...v5.0.0-alpha.6
Installation
Gradle
repositories {
mavenCentral()
}
dependencies {
implementation("net.dv8tion:JDA:5.0.0-alpha.6")
}
Maven
<dependency>
<groupId>net.dv8tion</groupId>
<artifactId>JDA</artifactId>
<version>5.0.0-alpha.6</version>
</dependency>
v5.0.0-alpha.5 | Interactions Rework
Changelog
New Features
Interactions Rework
In this release we completely reworked how interactions work in JDA. The changes are significant, but they also bring with them a lot of improvements and new features. I would highly suggest that users take a look at the migration guide provided in the PR to better understand the changes.
Summary:
- Reworks of:
- Slash Commands
- Select Menus
- Buttons
- Introduction of new functionality:
- User Context Commands
- Message Context Commands
- Slash Command Auto Complete
- An improved hierarchy for Interactions
- An improved hierarchy for Components
Changes
- Lots of documentation around threads by @oliver276 in #1838
- Move
requestToSpeak
to StageChannel by @MinnDevelopment in #1978 ThreadChannel#getTimeCreated
is now accurate for Threads created after 2022/01/22 by @caneleex in #1996- Limit new thread message count to 50 by @freya022 in #1980
- ICategorizableChannel#getParentCategoryId now correctly returns
null
if not in a category by @Sanduhr32 in #1993 - Change MessageEmbed#getUrl docs to mention representing the title url by @caneleex in #1975
- Fixes setInvitable in ThreadChannelManager by @oliver276 in #2000
Removed
- N/A
Full Changelog: v5.0.0-alpha.4...v5.0.0-alpha.5
Installation
Gradle
repositories {
mavenCentral()
}
dependencies {
implementation("net.dv8tion:JDA:5.0.0-alpha.5")
}
Maven
<dependency>
<groupId>net.dv8tion</groupId>
<artifactId>JDA</artifactId>
<version>5.0.0-alpha.5</version>
</dependency>
v5.0.0-alpha.4 | Member Timeouts
Changelog
New Features
- Added support for member timeouts by @caneleex in #1902
Changes
- Fixed parsing pagination of private archived threads by @Sanduhr32 in #1979
- Only update CommandData limiting booleans for non-empty additions by @Sanduhr32 in #1963
Removed
- N/A
Full Changelog: v5.0.0-alpha.3...v5.0.0-alpha.4
Installation
Gradle
repositories {
mavenCentral()
}
dependencies {
implementation("net.dv8tion:JDA:5.0.0-alpha.4")
}
Maven
<dependency>
<groupId>net.dv8tion</groupId>
<artifactId>JDA</artifactId>
<version>5.0.0-alpha.4</version>
</dependency>
v5.0.0-alpha.3
Changelog
New Features
- Implement retrieveThreadMember by @Tais993 in #1919
- Add support for animated guild banners by @caneleex in #1897
- Move canTalk() from GuildMessageChannel to MessageChannel by @V-Play-Games in #1956
Changes
- Fix parsing of the nullable presence field on Thread Members Update by @caneleex in #1948
- Transform SelectionMenu magic values into constants by @caneleex in #1944
- Fix IllegalStateException for OptionType.MENTIONABLE by @averen in #1964
- Hardcode gateway url by @Xirado in #1957
- Use bitshifts instead of hexcodes in managers by @caneleex in #1953
Removed
- N/A
Full Changelog: v5.0.0-alpha.2...v5.0.0-alpha.3
Installation
Gradle
repositories {
mavenCentral()
}
dependencies {
implementation("net.dv8tion:JDA:5.0.0-alpha.3")
}
Maven
<dependency>
<groupId>net.dv8tion</groupId>
<artifactId>JDA</artifactId>
<version>5.0.0-alpha.3</version>
</dependency>
v5.0.0-alpha.2
Changelog
New Contributors
New Features
- Add missing ErrorResponse values by @Xirado in #1892
- Add GenericMessageEvent#getThreadChannel() by @rtm516 in #1924
- Make Guild#moveVoiceMember support AudioChannel instead by @caneleex in #1928
- add Message.Attachment#getDescription by @caneleex in #1930
Changes
- Implement parent channel fetching when checking thread permissions by @rtm516 in #1925
- fix wrong check in GenericMessageEvent#getGuildChannel by @caneleex in #1927
- Make SelectionMenu#getOptions return an unmodifiable list by @freya022 in #1922
- Rename ThreadAction to ThreadChannelAction by @caneleex in #1931
Removed
- Remove GuildManager#setVanityCode by @caneleex in #1933
Full Changelog: v5.0.0-alpha.1...v5.0.0-alpha.2
Installation
Gradle
repositories {
mavenCentral()
}
dependencies {
implementation("net.dv8tion:JDA:5.0.0-alpha.2")
}
Maven
<dependency>
<groupId>net.dv8tion</groupId>
<artifactId>JDA</artifactId>
<version>5.0.0-alpha.2</version>
</dependency>
v5.0.0-alpha.1 | Thread Support, Channel Hierarchy Rework
Welcome to the v5 alpha
While we are working through the alpha stage it is expected that things will not be completely hardened yet. Functionality may contain bugs. Docs will be may be missing for new features. Code is still subject to breaking changes. This is the edge of the edge, but this is where the new fun features are to play with. What life without a little danger? 😎
As such, we encourage you to jump in, update your bots, and play with the new feature, but also recognize that v5 is still very much a work-in-progress. We'll do our best to provide a bug free space, but there are additional breaking changes planned for v5, so keep an eye out! 🛠️
Branch Changes
In v4 we had 3 branches:
development
- In-progress work for v4 releases went here. All PRs were pointed at this.docs/development
- Documentation only changes went here. This would get merged into development to keep development history cleanerrelease
- When a new release was made a merge commit was made from development to release. release always showed the code at the time of release for the latest release.
In v5 we are simplifying this:
development
- This branch is being removed.docs/development
- This branch is being removedrelease
- This branch is being removedmaster
- This will be the primary and only branch. It will serve the same purpose that development did in v4, but with a more consistent naming expected by the community. All changes (PRs), regardless of their content, are to be made against this branch.
Additionally, just like with all major-revisions of JDA, the legacy code will be maintained.
As such, the contents of development
are currently available on legacy/v4
and will be available there even after development
is deleted. Any critical bug fixes that we backport to v4
will be made to legacy/v4
.
Version Schema changes:
Starting with v5, we are changing how we handle versions.
The new version schema: <major>.<minor>.<revision>[-<classification>.<classificationRevision>]
Examples:
5.0.0-alpha.1
5.0.0-beta.14
5.1.2
Historically, we versioned JDA as <major>.<minor>.<revision>_<buildVersion>
where buildVersion
was a continuously incremented number. This led us to have situations where we didn't make an actual release for a long time because developers could just update to the latest <buildVersion>
, effectively rendering the normal versioning meaningless. As such, in v5 we have decided to create releases much more often and in doing so we are dropping the <buildVersion>
identifier. As a note, these builds where the only part of the version that changed was the buildVersion
were JDA's snapshot builds.
Going forward, we are no longer going to be publishing our snapshot builds. This means that not every commit will lead to a repository-published version. The only version that will be published are releases. Releases are when the actual version of JDA has been changed. Anything that is not a release is a snapshot.
Snapshot builds will still be available in 2 ways:
- Jitpack
- Jenkins CI via JAR downloads
Additionally, the snapshot builds have a slight variant on the new versioning scheme in terms of build assets. For snapshot builds the assets are versioned as <major>.<minor>.<revision>[-<classification>.<classificationRevision>]_<git-commit-7-char-hash>
Examples:
5.0.0-alpha.1_d3fac3k
5.0.0-beta.14_67ylgde
5.1.2_fl1opac
Changelog
New Contributors
New Features
- JDA now supports threads via the new
ThreadChannel
construct. StageChannel
is now its own type, not an extension ofVoiceChannel
NewsChannel
is now a full-fledge type, not just a subset ofTextChannel
viaisNews()
AudioChannel
now exist as an interface that contains the shared parts ofVoiceChannel
andStageChannel
. The various parts of the audio system that dealt with channels now deal withAudioChannel
instead of explicitlyVoiceChannel
- Introduced "attribute" interfaces that allow interop between concrete channel types:
IInviteContainer
IPositionableChannel
IPermissionContainer
ICategorizableChannel
- etc
- Introduced
GuildChannel#getPermissionContainer
to easily get access to an instance ofIPermissionContainer
for the current channel. In the majority of cases this method will simply return the same channel but cast toIPermissionContainer
, but it can return other channels instead, like withThreadChannel
asThreadChannel
doesn't supportIPermissionContainer
and relies on its parent channel to determine permissions.- Additionally, you don't have to use this method. If you know the current
GuildChannel
instance you have implementsIPermissionContainer
you can just cast to it. No big deal. This getter is just here for simplicity without casting.
- Additionally, you don't have to use this method. If you know the current
- Unified channel events:
We've simplified detecting and handling events for channels by replacing the type-specific events (like TextChannelCreateEvent) with unified events that fire for every channel. You can differentiate between the specific channel types as needed viaevent.getChannelType()
ChannelCreateEvent
ChannelUpdateXEvent
(e.g:ChannelUpdateNameEvent
)ChannelDeleteEvent
- Type-trimmed Channel Managers
- ChannelManager
- attributes
- IPermissionContainerManager
- IPositionableChannelManager
- ICategorizableChannelManager
- middleman
- AudioChannelManager
- BaseGuildMessageChannelManager
- concrete
- CategoryManager
- NewsChannelManager
- StageChannelManager
- TextChannelManager
- ThreadChannelManager
- VoiceChannelManager
Changed
ActivityType.DEFAULT
renamed toActivityType.PLAYING
- Many permissions were renamed or removed
MESSAGE_READ
-> Removed. UseVIEW_CHANNEL
instead.MESSAGE_WRITE
->MESSAGE_SEND
USE_SLASH_COMMANDS
->USE_APPLICATION_COMMANDS
MANAGE_EMOTES
->MANAGE_EMOTES_AND_STICKERS
USE_PUBLIC_THREADS
->CREATE_PUBLIC_THREADS
USE_PRIVATE_THREADS
->CREATE_PRIVATE_THREADS
OptionData#addChoice(String, int)
->OptionData#addChoice(String, long)
MessageBulkDeleteEvent#getChannel
now returnsGuildMessageChannel
instead ofTextChannel
WebhookClient#getChannel
andWebhookManager#getChannel
now both returnBaseGuildMessageChannel
instead ofTextChannel
Removed
- All deprecated code from v4
ChannelManager#getType()
. UseChannelManager#getChannel()#getType()
ChannelManager#setNews
. UseTextChannelManager#setType
orNewsChannelManager#setType
ChannelAction#setNews
. UseGuild#createNewsChannel
NewsChannel
related methods removed fromTextChannel
asNewsChannel
is a full-fledged entity nowTextChannel#follow
->NewsChannel#follow
TextChannel#crosspostMessage
->NewsChannel#crosspostMessage
- Removed all
<Type>
specific channel events. Use the new Unified Channel events mentioned above.
This includes:<Type>ChannelCreateEvent
(ex:TextChannelCreateEvent
)<Type>ChannelUpdate<Field>Event
(ex:TextChannelUpdateNameEvent
)<Type>ChannelDeleteEvent
(ex:TextChannelDeleteEvent
)
- Removed all
<Context>Message<X>Events
(ex: GuildMessageReceivedEvent
)
This includes:Generic<Context>MessageEvent
(ex:GenericGuildMessageEvent
)<Context>MessageReceivedEvent
(ex:GuildMessageReceivedEvent
)<Context>MessageUpdateEvent
(ex:GuildMessageUpdateEvent
)<Context>MessageDeleteEvent
(ex:GuildMessageDeleteEvent
)<Context>MessageEmbedEvent
(ex:GuildMessageEmbedEvent
)<Context>MessageReaction<X>Event
(ex:GuildMessageReactionAddEvent
)- etc
Full Changelog: v4.4.0...v5.0.0-alpha.1
Installation
With v5 we are finally moving back to Maven Central for our releases. m2.dv8tion.net
will continue to host our v4 artifacts until the v4 LTS concludes, but going forward we will be publishing releases to Maven Central. For snapshot builds, please use jitpack.
Gradle
repositories {
mavenCentral()
}
dependencies {
implementation("net.dv8tion:JDA:5.0.0-alpha.1")
}
Maven
<dependency>
<groupId>net.dv8tion</groupId>
<artifactId>JDA</artifactId>
<version>5.0.0-alpha.1</version>
</dependency>
v4.4.0 | Long Term Support (LTS)
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
- Multi-embed support in
MessageAction
- StageChannel support
- Slash Command option
OptionType.NUMBER
support - Slash Command option
OptionType.CHANNEL
channel type restrictions - OptionType max/min support
- TimeFormat markdown support (#1676)
- Message#getReferencedMessage()
- GuildVoiceVideoEvent
- EmbedBuilder#copyFrom (#1738)
- SlashCommandEvent.getCommandString (#1693)
- Guild.NSFWLevel
- Message#getInteraction()
- Command#getVersion()
- MarkdownSanitizer: escape all markdown characters regardless of if they're being used as markdown regions (#1754)
- User Profiles
- Per-Guild Member Avatar
- Invite Targets: (#1628)
- RoleIcon support
- ApplicationInfo#getTermsOfService() & #getPrivacyPolicy()
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:
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
- Support multi-embeds in MessageAction by @MinnDevelopment in #1652
- Fix checks in CommandData#addSubcommand and CommandData#addSubcommandGroup by @MrLetsplay2003 in #1674
- add a check for null embeds field in DataMessage#getEmbeds by @caneleex in #1678
- Fixed the issue with last character handling for cases when the length of the message is 4001 characters by @maxtrap in #1680
- add missing checks to Message#suppressEmbeds by @caneleex in #1660
- fix parsing stickers by @caneleex in #1692
- First pass on stage channels by @MinnDevelopment in #1575
- Add TimeFormat and Timestamp by @MinnDevelopment in #1676
- Replace isEmpty check with isBlank in StageInstanceActionImpl#setTopic by @LenderSchlender in #1698
- Change checks for emote name length to check minimum length by @LenderSchlender in #1701
- Fix ChannelAction#setTopic not doing anything by @Xirado in #1709
- Add support for new SelectionMenu components by @MinnDevelopment in #1646
- Bump embed max description length by @Andre601 in #1703
- Change SelectionMenu.Builder#Builder visibility to protected by @freya022 in #1719
- Fix outdated sticker field name by @Andre601 in #1732
- Docs update by @MinnDevelopment in #1733
- Add thread permissions by @MinnDevelopment in #1742
- Implement access and retrieval of message_reference by @arynxd in #1686
- Fixing getReferencedMessage and permissions for resolving a MessageReference by @DManstrator in #1751
- Add GuildVoiceVideoEvent by @Xirado in #1716
- Implement retrieve helpers for private reaction events by @arynxd in #1750
- Add copyFrom to EmbedBuilder by @freya022 in #1738
- Fix exception handling for parsing errors by @MinnDevelopment in #1760
- Bump selection option limits and extract max length values of SelectOption and Button by @Alf-Melmac in #1753
- Add new message types for Threads by @oliver276 in #1759
- Add JDA Version to Websocket errors by @Andre601 in #1777
- Add SlashCommandEvent.getCommandString by @VixenKasai in #1693
- Add NUMBER support by @Andre601 in #1745
- Add missing getJDA() on Interaction by @nikammerlaan in #1782
- Update TextChannelUpdateNSFWEvent.java by @Olzie-12 in #1774
- Docs Update by @DV8FromTheWorld in #1792
- Ensure permission in PermissionException is not null by @ScoreUnder in #1764
- Change choice name length check to 100 instead of 32 by @oliver276 in #1801
- Enable unmuting suppressed users by @DeveloperTK in #1783
- Fix embed length checks by @arynxd in #1749
- Add NSFWLevel by @Xirado in #1793
- Add interaction related message flags by @freya022 in #1790
- Adding external sticker permission and adding external emoji to text channel overrides by @Sheldan in #1778
- add Interaction Object for Messages by @TopiSenpai in #1747
- Add Command#getVersion by @Xirado in #1741
- Add id as fallback on Command version by @Xirado in #1808
- Create ID alternatives to permission override methods in ChannelManager by @ScoreUnder in https://git...