Skip to content
Compare
Choose a tag to compare

‼️ Java Update in Early 2023 ‼️

Starting in early 2023, support for Java 8 will be discontinued and Java 11 will be the new minimum requirement for using Javacord.
If you are not yet running Java 11+, we strongly recommend that you upgrade before the end of this year.

📦 Download

Using a Build Manager

Gradle

repositories { mavenCentral() }
dependencies { implementation 'org.javacord:javacord:3.5.0' }

Maven

<dependency>
    <groupId>org.javacord</groupId>
    <artifactId>javacord</artifactId>
    <version>3.5.0</version>
    <type>pom</type>
</dependency>

Sbt

libraryDependencies ++= Seq("org.javacord" % "javacord" % "3.5.0")

📋 Changelog

Highlights in this release:

  • Added support for new slash command permissions
  • Added support for interaction locales
  • Added support for server timeouts
  • Added support for slash command attachment options

Improvements

  • Added UserFlag#CERTIFIED_MODERATOR and UserFlag#BOT_HTTP_INTERACTIONS (#762)
  • Added locales for interactions (#947)
  • Improved BotInviteBuilder (#957)
  • Added Modal interactions (#962)
  • Added support for server timeouts (#948)
  • Added support for disabling event dispatching (#986)
  • Added support for ban pagination (#993)
  • Added ActivityFlag (#996)
  • Added missing/new Activity fields (#1000)
  • Added support for editing slash commands without a server instance (#1001)
  • Added MessageType#THREAD_CREATED (#1008)
  • Updated dependencies (#944, #1013)
  • Added dummy implementation for forum channels (#1009)
  • Added unknown channels to prevent errors for newly introduced channels (#1009)
  • Added support for slash command attachment options (#1015)
  • Added support for new slash command permissions (#1004, #1027)

Bugfixes

  • Fixed ServerTextChannel#hasSlowmode() (#731)
  • Fixed SlashCommandInteraction not properly parsing resolved users (#953)
  • Fixed exception when guilds are missing voice states (#929)
  • Fixed DiscordApi#getMessageById(...) returning cached messages from other channels (#963)
  • Fixed ServerThreadChannelBuilder#setInvitableFlag(...) (#966)
  • Fixed audit log reason not supporting non-ASCII characters (#971)
  • Fixed webhooks and interactions consuming global ratelimits (#972)
  • Fixed DiscordApi#hasAllUsersInCache() (#975)
  • Fixed exception when no nsfw field is present in channel category updates (#981)
  • Fixed Server#getBans(...) only returning the latest 1000 bans (#993)
  • Fixed unwanted log message (#1002)
  • Fixed wrong initial mute and deafen member state (#736)
  • Fixed exception for servers with forum channels (#1009)
  • Fixed duplicate message object creation for messages with attachments (#1017)
  • Fixed AssertionError for ServerThreadChannels (#1029)

Breaking Changes

  • Removed UserFlag#SYSTEM and renamed others (#762)
  • Removed deprecared methods in Message, LocalRatelimiter, and SlashCommandInteractionOptionsProvider (#847, #882)
  • Removed SafeSpecializable interface (#880)
  • Renamed Rename PermissionType#READ_MESSAGES to VIEW_CHANNEL (#952)
  • Removed support for broken and deprecared login with user accounts (#576)
  • Removed InteractionCallbackDataFlag (#961)
  • Changed return type of Message#getMentionedChannels() from List<ServerTextChannel> to List<ServerChannel> (#1012)
  • Removed support for old slash command permissions (#1004)
v3.4.0
Compare
Choose a tag to compare

📦 Download

Using a Build Manager

Gradle

repositories { mavenCentral() }
dependencies { implementation 'org.javacord:javacord:3.4.0' }

Maven

<dependency>
    <groupId>org.javacord</groupId>
    <artifactId>javacord</artifactId>
    <version>3.4.0</version>
    <type>pom</type>
</dependency>

Sbt

libraryDependencies ++= Seq("org.javacord" % "javacord" % "3.4.0")

Manually

The javacord-3.4.0-shaded.jar file contains Javacord and all its dependencies.

📋 Changelog

Highlights in this release:

  • Added support for threads
  • Added support for stickers
  • Improved support for interactions / slash commands (context menus, autocomplete, ...)
  • Many bugfixes

Improvements

  • Added option to control user cache (#816)
  • Add Server#requestMember(long) to get a server member by their user id (#684)
  • All message components listeners are now attachable to messages (#820)
  • Added DiscordApi#getKnownCustomEmojiOrCreateCustomEmoji(...) to get custom emojis from different shards (#830)
  • Added ability to edit message with message builder (#810)
  • Allow ephemeral deferred interaction responses (#838)
  • Added disabled field for Button convenience methods (#849)
  • Added missing methods to get the actual component (#850)
  • Added support for number slash command option type (#852, #919)
  • Remove members from cache when the bot leaves the server (#855)
  • Use 64 bit for permission bitmask (#861)
  • Added new permission types (#862)
  • Added MessageAttachment#isEphemeral() (#870)
  • Added new appender types to the MessageBuilder (#869)
  • The GUILD intent is now automatically set (#868)
  • Added new audit log action types (#872)
  • Allow voice self-states to be set directly on connect (#877)
  • DiscordApi#disconnect() now returns a future (#884)
  • Added support for threads (#864, #905, #907, #930)
  • MessageAuthor#getAvatar(...) now accepts an optional size parameter (#902)
  • Added support for stickers (#904)
  • Added method to manually request members + ServerMembersChunkEvent (#818)
  • Added support for min and max value setting of slash command options (#891)
  • Update Log4J api version (#922)
  • Added ServerThreadChannelUpdater and ServerThreadChannelBuilder (#903)
  • Improved MessageSet to utilize performance-improvements from newer Stream methods like Stream#takeWhile(...) (#938)
  • Added support for context menus (#867)
  • Added support for autocomplete interactions (#939, #943, #945)

Bugfixes

  • JavaDoc Fixes and Improvements (#828, #854, #863, #875, #876)
  • Fixed incoming interaction in unknown DM channels (#835)
  • Fixed MessageBuilder for messages with multiple embeds (#837)
  • Fixed User#getMutualServers() (#821)
  • Fixed SlashCommandInteractionOption#getBooleanValue() (#841)
  • Changed SlashCommandInteractionOption#isSubcommandOrGroup() to check the string representation instead of string value (#872)
  • Moved from deprecated "embed" field to "embeds" in UncachedMessageUtil (#848)
  • Fixed message cache deadlock (#860)
  • Fixed NPE in MessageBuilderBaseDelegateImpl when a list of embeds contains a null entry (#913)
  • ServerVoiceChannelEvent now extends ServerChannelEvent (#918)
  • Fixed NPE in SlashCommandInteractionOptionImpl#getUserValue() (#921)
  • Fixed NPE in SelectMenuInteractionImpl (#926)
  • Added missing interfaces to SelectMenuChooseEvent and ServerChangeRulesChannelEvent (#936)
  • Replaced hard coded discord CDN with the already static defined (#886)
  • Add methods to prevent ambiguous methods for sendMessage(...) variants (#912)
  • Fixed method signatures of bulk overwrite application command methods (#940)

Breaking Changes

  • Changed return type of User#getMutualServers() from Collection<Server> to Set<Server> (#821)
  • Changed message methods that take embed as argument only to needing an array of embeds (#856, #873)
  • Removed MessageComponentInteractionBase#getMessageId() (#846)
  • Changed return type of MessageComponentInteractionBase#getMessage() from Optional<Message> to Message (#846)
  • InteractionMessageBuilder#setFlags(...) now expects InteractionCallbackDataFlag instead of MessageFlags enums as parameters (#871)
  • Changed return type of DiscordApi#disconnect() from void to CompletableFuture<Void> (#884)
  • Changed return type of ChannelCategory#getChannels() from List<ServerChannel> to List<RegularServerChannel> (#864)
  • Moved position related methods from ServerChannel to RegularServerChannel (Threads do not have a position) (#864)
  • Replaced SlashCommandInteractionOption#getIntValue() with SlashCommandInteractionOption#getLongValue() and SlashCommandOptionChoiceBuilderDelegate#setValue(int) with SlashCommandOptionChoiceBuilderDelegate#setValue(long) (#899)
  • Fixed inconsistent slash command option naming (#919)
  • Moved canCreateInstantInvite and permission methods from the ServerChannel to the new RegularServerChannel (#903)
  • Moved permission methods from ServerChannel[Updater|Builder] to RegularServerChannel[Updater|Builder] (#903)

Deprecations

  • Deprecated MessageBuilder#addFile(...) in favor of MessageBuilder#addAttachment(...)
  • Deprecated SlashCommandInteractionOptionsProvider#get[First|Second|Third]Option[Boolean|Long|User|...]Value() in favor of getOption[Boolean|Long|User|...]ValueByIndex(...)
Compare
Choose a tag to compare

📦 Download

Using a Build Manager

Gradle

repositories { mavenCentral() }
dependencies { implementation 'org.javacord:javacord:3.3.2' }

Maven

<dependency>
    <groupId>org.javacord</groupId>
    <artifactId>javacord</artifactId>
    <version>3.3.2</version>
    <type>pom</type>
</dependency>

Sbt

libraryDependencies ++= Seq("org.javacord" % "javacord" % "3.3.2")

Manually

The javacord-3.3.2-shaded.jar file contains Javacord and all its dependencies.

📋 Changelog

This version includes an important fix for slash commands and adds support for select menus.

Improvements

  • Add support for select menus (#800)

Bugfixes

  • Fix slash commands in private channels and buggy ephemeral messages(#801)
Compare
Choose a tag to compare

📦 Download

Using a Build Manager

Gradle

repositories { mavenCentral() }
dependencies { implementation 'org.javacord:javacord:3.3.1' }

Maven

<dependency>
    <groupId>org.javacord</groupId>
    <artifactId>javacord</artifactId>
    <version>3.3.1</version>
    <type>pom</type>
</dependency>

Sbt

libraryDependencies ++= Seq("org.javacord" % "javacord" % "3.3.1")

Manually

The javacord-3.3.1-shaded.jar file contains Javacord and all its dependencies.

📋 Changelog

This version adds support for slash commands, buttons, and many other smaller features.
It also includes various bugfixes.

Improvements

Bugfixes

  • Fix NullPointerExceptions in event dispatcher (#698)
  • Fix incoming webhooks without a token (#778)
  • Fix issue for message references without a message id (#782)
  • Use millisecond precision for Cloudfare ratelimits (#756)
  • Fix broken UserChangeXyz events (#742)
  • Fix unwanted request identify ratelimit on resume (#694)
  • Fix settings of default global ratelimiter (#749)
  • Fix broken channel update handler for server news channels (#743)

Deprecations

  • Message#getReferencedMessageId() has been deprecated in favor of Message#getMessageReference() (#782)
Compare
Choose a tag to compare

📦 Download

Using a Build Manager

Gradle

repositories { mavenCentral() }
dependencies { implementation 'org.javacord:javacord:3.3.0' }

Maven

<dependency>
    <groupId>org.javacord</groupId>
    <artifactId>javacord</artifactId>
    <version>3.3.0</version>
    <type>pom</type>
</dependency>

Sbt

libraryDependencies ++= Seq("org.javacord" % "javacord" % "3.3.0")

Manually

The javacord-3.3.0-shaded.jar file contains Javacord and all its dependencies.

📋 Changelog

Improvements

  • Add new message types (#730)

Bugfixes

  • Fix broken message create events for private messages (#708)
  • Fix broken update events for users (#685)

Breaking Changes

  • PrivateCHannel#getRecipient() now returns an Optional<User>
Compare
Choose a tag to compare

📦 Download

Using a Build Manager

Gradle

repositories { mavenCentral() }
dependencies { implementation 'org.javacord:javacord:3.2.0' }

Maven

<dependency>
    <groupId>org.javacord</groupId>
    <artifactId>javacord</artifactId>
    <version>3.2.0</version>
    <type>pom</type>
</dependency>

Sbt

libraryDependencies ++= Seq("org.javacord" % "javacord" % "3.2.0")

Manually

The javacord-3.2.0-shaded.jar file contains Javacord and all its dependencies.

📋 Changelog

⚠️

It is recommended to update your bot or your might experience issues with servers that have the new stage channels

⚠️

Improvements

  • Allow sending messages to webhooks (#573)
  • Improve allowed mentions (#587).
  • Add methods to get the target of an invite (#616)
  • Add Message#getNonce() (#650)
  • Update to latest Gateway and REST endpoints (#679)
  • Add support for replies (#679)
  • Editing a message now returns the message (#650)
  • Add Message#crossPost() (#650)
  • Add methods to ban a user by their id (#667)
  • Add basic support for new stage channel type (#726)
  • Add support for multiple activities (#692)

Breaking Changes

  • Icon#asInputStream now returns an InputStream directly instead of a future (#448)
  • AllowedMentions#getAllowedRoleMentions() and #getAllowedUserMentions now return an Optional<List<Long>> instead of List<Long> (#587)
  • Removed AllowedMentionsgetGeneralMentions()
  • Changed return type of RichInvite#getInviter() to Optional<User> moved it to Invite#getInviter() (#616)
  • Editing a message now returns CompletableFuture<Message> instead of CompletableFuture<Void> (#650)
  • Webhook#getToken() was moved to IncomingWebhook and now returns String (#573)

Bugfixes

  • Fix exception for servers with stage channels (#726)
  • Fix privacy logger for empty tokens (#656)
  • Add missing server features (#723)
Compare
Choose a tag to compare

📦 Download

Using a Build Manager

Gradle

repositories { mavenCentral() }
dependencies { implementation 'org.javacord:javacord:3.1.2' }

Maven

<dependency>
    <groupId>org.javacord</groupId>
    <artifactId>javacord</artifactId>
    <version>3.1.2</version>
    <type>pom</type>
</dependency>

Sbt

libraryDependencies ++= Seq("org.javacord" % "javacord" % "3.1.2")

Manually

The javacord-3.1.2-shaded.jar file contains Javacord and all its dependencies.

📋 Changelog

Improvements

  • Added Server#requestOwner() method (#639)
  • Added ActivityType.COMPETING (#645)
  • Added User#getUserFlags() (i.e., badges) (#637)
  • Added events for invite creation and deletion (#644)
  • Added utility method to convert a message's content to a readable string without access to the message object (#640)

Bugfixes

  • Added missing/new websocket close codes (#646)
  • Fixed multiple role related issue (#640)
Compare
Choose a tag to compare

📦 Download

Using a Build Manager

Gradle

repositories { mavenCentral() }
dependencies { implementation 'org.javacord:javacord:3.1.1' }

Maven

<dependency>
    <groupId>org.javacord</groupId>
    <artifactId>javacord</artifactId>
    <version>3.1.1</version>
    <type>pom</type>
</dependency>

Sbt

libraryDependencies ++= Seq("org.javacord" % "javacord" % "3.1.1")

Manually

The javacord-3.1.1-shaded.jar file contains Javacord and all its dependencies.

📋 Changelog

This version is just a small bugfix update that fixes some bugs that found their way into the last update.

Bugfixes

  • Fixed small servers not becoming available when waitForUsersOnStartup(...) is enabled and GUILD_MEMBERS intent is set but not GUILD_PRESENCES (#631)
  • Fixed ServerVoiceChannelMemberEvent#getUser() throwing an exception if the user is not cached (#633)
  • Re-added missing implementation of User#equals(...) (#632)
  • Fixes some typos in JavaDoc comments (#635)
Compare
Choose a tag to compare

📦 Download

Using a Build Manager

Gradle

repositories { mavenCentral() }
dependencies { implementation 'org.javacord:javacord:3.1.0' }

Maven

<dependency>
    <groupId>org.javacord</groupId>
    <artifactId>javacord</artifactId>
    <version>3.1.0</version>
    <type>pom</type>
</dependency>

Sbt

libraryDependencies ++= Seq("org.javacord" % "javacord" % "3.1.0")

Manually

The javacord-3.1.0-shaded.jar file contains Javacord and all its dependencies.

❗️ Important Note ❗️

This version introduces Intents.
If you don't know what Intents are, you should take a look at our wiki article for more information.

Privileged Intents will be disabled by default on October 7.

  • If you do not have privileged intents enabled in the Developer Portal, older versions of Javacord will no longer work.
  • If you have both privileged intents (GUILD_MEMBERS and GUILD_PRESENCES) enabled, older Javacord versions will continue to work.
  • Version 3.1.0 (this version) will work in all cases.

📋 Changelog

This is an important update with many breaking changes. Please read the whole changelog carefully!

Improvements

  • Added support for Gateway Intents
  • Added support for disabling the user cache (when GUILD_MEMBERS intent is not set)

Breaking Changes

To support the disabled user cache, this version introduces some breaking changes, that are listed below:

  • Javacord will no longer wait for all users to be in the cache!
    • You can restore the old behavior by setting DiscordApiBuilder#setWaitForAllUsersOnStartup(true)
    • This requires you to have the GUILD_MEMBERS intent set -> See below for more information
  • By default, only non-privileged intents are set.
    • If your bot is whitelisted, you can use DiscordApiBuilder#setAllIntents() to "restore" the old behavior
    • See below for more information about the impact of only setting non-privileged intents
  • Server#getOwner() now returns an Optional<User> (instead of directly returning a user object).
    • There's a new method #getOwnerId() that always returns the owner's id (no Optional)
  • ServerChangeOwnerEvent#get<Old/New>Owner() now returns an Optional<User>.
    • There are new #get<Old/New>OwnerId() methods.
  • SingleReactionEvent, UserChangeActivityEvent, UserChangeStatusEvent, and UserStartTypingEvent are now OptionalUserEvents
    • This means that #getUser() now returns an Optional<User>.
    • There are new methods getUserId() and requestUser().
  • ServerChannel#getOverwritten[Role/User]Permissions() now returns Map<Long, Permissions> instead of Map<Permissionable, Permissions>
  • ServerChannelChangeOverwrittenPermissionsEvent#getEntity() now returns an Optional<DiscordEntity> (instead of directly returning a DiscordEntity).
    • There's a new method #getEntityId() as well as a #is<User/Role>Entity() method
  • The static Reaction.removeUser(...) methods now expect a user id instead of a user object
  • The UncachedMessageUtil#removeUserReactionByEmoji(...) methods now expect a user id instead of a user object
Additional Considerations

If your bot is not whitelisted for the GUILD_MEMBERS intent, Javacord will no longer be able to cache user objects.
This means that

  • Methods like DiscordApi#getCachedUsers() and Server#getMembers() will return empty collections
  • Methods that rely on the user cache will no longer work (e.g., User#getMutualServers)
  • When receiving users from events (e.g., from a MessageCreateEvent), methods like User#getRoles(Server), Server#isMember(User), or #canXyz(...) will only work for the server of the event

If you are whitelisted for the GUILD_MEMBERS intent, you can tell Javacord to wait for all users by setting DiscordApiBuilder#setWaitForAllUsersOnStartup(true).

If your bot is not whitelisted for the GUILD_PRESENCES intent, Javacord will not be able to provide information about a user's presence (i.e., their status (ONLINE, OFFLINE, ...) and their activities (i.e., what game they are playing)).
Additionally, without this intent it might take considerably longer to cache all users because of ratelimits (up to 10 minutes for shards with 1000 servers). It is advised against setting DiscordApiBuilder#setWaitForAllUsersOnStartup(true) unless absolutely necessary.

Bugfixes

  • none

Other Improvements

  • none

🗺 What's next?

Like said in our last version's changelog, we aim for making all entities immutable and (maybe?) introduce a Member entity.
To make updating as simple as possible, we have decided to keep this version as small as possible and only change what was absolutely necessary to support intents.

Compare
Choose a tag to compare

📦 Download

Using a Build Manager

Gradle

repositories { mavenCentral() }
dependencies { implementation 'org.javacord:javacord:3.0.7' }

Maven

<dependency>
    <groupId>org.javacord</groupId>
    <artifactId>javacord</artifactId>
    <version>3.0.7</version>
    <type>pom</type>
</dependency>

Sbt

libraryDependencies ++= Seq("org.javacord" % "javacord" % "3.0.7")

Manually

The javacord-3.0.7-shaded.jar file contains Javacord and all its dependencies.

📋 Changelog

Improvements

  • Added support for playing audio 🎶
  • Added methods to get the REST and gateway latency (#569, #570)
  • Added support for more precise global ratelimits (#579)
  • Added default global ratelimiter (#580)
  • Added read-only support for custom activities (#584)
  • Added new COMMUNITY server feature (#600)
  • Added option to disable the shutdown hook (#602)

Bugfixes

  • Fixed server boost level enum (#585)
  • Fixed #getReadableContent() for user and roles with non-Regex-friendly charachters in their name (#590)
  • Fixed Server#canManageRole(User, Role) (#594)

Other Improvements

  • Rework of the internal entity cache (#556, #567)
    • This is the first step towards immutable entities
    • This reduces the time-complexity of some methods like DiscordApi#getChannels() from O(n) to O(1) by removing the need for defensive copies

Deprecated Methods

  • none

🎶 Audio when?

Now!

🗺 What's next?

In our next release, we aim for a larger rework on how Javacord deals with Discord entities (Spoiler: They will become immutable). Additionally, we will add support for disabling the user cache (this will even be mandatory for bots without the privileged GUILD_MEMBERS intent) and introducing a new entity: Member.
You can expect the next version to introduce breaking changes.