Skip to content

v5.0.0-beta.10

Compare
Choose a tag to compare
@MinnDevelopment MinnDevelopment released this 04 Jun 14:01
· 162 commits to master since this release
6d48c21

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 the User#getGlobalName or User#getName. This also affects Member#getEffectiveName, which will now return based on precedence guild nickname > global name > username.
  • User#getDefaultAvatarId now depends on the user id instead of the discriminator (when they have the discriminator 0000)

New Features

Changes

Bug Fixes

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>