v5.0.0-beta.10
Overview
With this release, we are taking the first steps to transition into the new username system for Discord by marking some methods as incubating or deprecated. This release also introduces support for AutoMod, both events and changing the AutoMod rules of a guild.
AutoMod Support (#2429)
You can now modify the AutoMod rules of a guild using AutoModRuleData
and Guild#createAutoModRule
.
Support for member profile AutoMod has not been added yet, due to the API being very unstable still.
Example
guild.createAutoModRule(
AutoModRule.onMessage("No morbius memes", TriggerConfig.keywordFilter("*morb*"))
.putResponses(AutoModResponse.blockMessage("This meme is unfunny."))
).queue();
Username Changes (#2462)
Discord is changing to globally unique usernames and removing discriminators, this is explained in their blog post. We are taking the first steps to transition with this release.
Deprecated Features
- JDA#getUserByTag
- Guild#getMemberByTag
- User#getDiscriminator
- User#getAsTag
- SelfUpdateDiscriminatorEvent
- UserUpdateDiscriminatorEvent
- AccountManager#setName
Incubating Features
These are likely to be deprecated and removed in the future.
- JDA#getUsersByName
- Guild#getMembersByName
Other Changes
- In the future,
User#getDiscriminator
will return"0000"
for users who have a globally unique username from the new system. - A new
User#getEffectiveName
has been introduced to get the "effective display name" of a user, meaning either theUser#getGlobalName
orUser#getName
. This also affectsMember#getEffectiveName
, which will now return based on precedenceguild nickname
>global name
>username
. User#getDefaultAvatarId
now depends on the user id instead of the discriminator (when they have the discriminator 0000)
New Features
- Add automod support by @MinnDevelopment in #2429
- Add ThreadChannel#retrieveStartMessage by @MinnDevelopment in #2438
Changes
- Improve handling of global rate-limit by @MinnDevelopment in #2465
- Start migration to new username API by @MinnDevelopment in #2462
- Improve handling of method discovery in AnnotatedEventManager by @freya022 in #2454
Bug Fixes
- Fix slow shutdown during reconnects by @MinnDevelopment in #2464
- Properly escape quotes with leading spaces by @Almighty-Satan in #2363
Full Changelog: v5.0.0-beta.9...v5.0.0-beta.10
Installation
Gradle
repositories {
mavenCentral()
}
dependencies {
implementation("net.dv8tion:JDA:5.0.0-beta.10")
}
Maven
<dependency>
<groupId>net.dv8tion</groupId>
<artifactId>JDA</artifactId>
<version>5.0.0-beta.10</version>
</dependency>