Skip to content

v5.0.0-alpha.1 | Thread Support, Channel Hierarchy Rework

Compare
Choose a tag to compare
@DV8FromTheWorld DV8FromTheWorld released this 29 Nov 23:07
· 498 commits to master since this release

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 cleaner
  • release - 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 removed
  • release - This branch is being removed
  • master - 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:

  1. Jitpack
  2. 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 of VoiceChannel
  • NewsChannel is now a full-fledge type, not just a subset of TextChannel via isNews()
  • AudioChannel now exist as an interface that contains the shared parts of VoiceChannel and StageChannel. The various parts of the audio system that dealt with channels now deal with AudioChannel instead of explicitly VoiceChannel
  • 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 of IPermissionContainer for the current channel. In the majority of cases this method will simply return the same channel but cast to IPermissionContainer, but it can return other channels instead, like with ThreadChannel as ThreadChannel doesn't support IPermissionContainer 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 implements IPermissionContainer you can just cast to it. No big deal. This getter is just here for simplicity without casting.
  • 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 via event.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 to ActivityType.PLAYING
  • Many permissions were renamed or removed
    • MESSAGE_READ -> Removed. Use VIEW_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 returns GuildMessageChannel instead of TextChannel
  • WebhookClient#getChannel and WebhookManager#getChannel now both return BaseGuildMessageChannel instead of TextChannel

Removed

  • All deprecated code from v4
  • ChannelManager#getType(). Use ChannelManager#getChannel()#getType()
  • ChannelManager#setNews. Use TextChannelManager#setType or NewsChannelManager#setType
  • ChannelAction#setNews. Use Guild#createNewsChannel
  • NewsChannel related methods removed from TextChannel as NewsChannel is a full-fledged entity now
    • TextChannel#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>