Skip to content

v3.0.0-beta.8 | Safe localization module, command improvements and fixes

Choose a tag to compare

@freya022 freya022 released this 22 Jan 18:31
3e12892

JDA

Overview

Added a safer localization module, removed superclass requirements of annotated commands and fixed stuff.

New module with much safer localization (#237)

A new incubating module has been added to enable you more pre-emptive checks for your localization needs!

It allows you to define interfaces to retrieve your messages, meaning cleaner commands, less chance to misspell something, and much, much earlier error messages if something isn't configured correctly.

See the README for more details.

Split and deprecate ApplicationCommand and TextCommand (#252)

This removes the requirement of extending ApplicationCommand/TextCommand by splitting them in optional interfaces for each feature.

Deprecations

  • Deprecated ApplicationCommand and TextCommand

Changes

  • Split ApplicationCommand into optional interfaces
    • SlashOptionChoiceProvider
    • ApplicationGeneratedValueSupplierProvider
  • Split TextCommand into optional interfaces
    • TextCommandHelpConsumer
    • TextGeneratedValueSupplierProvider

New features

Introspection

  • Added method, declaringKClass and declaringClass to Executable

Event listeners

  • Added support for lists and lazy services in event listener parameters

Misc

  • Added support for Kotlin 2.3.0
    • Haven't updated to it yet because of some (rare) reflection bugs

Deprecations

Text commands

  • Deprecated and split HelpBuilderConsumer#accept into two methods
    • acceptGlobal
    • acceptCommand

Changes

Dependencies

  • Updated to JDA 6.3.0
  • Updated to Caffeine 3.2.3
  • Updated to ClassGraph 4.8.184
  • Updated to JEmoji 1.7.5
  • Updated to Spring Boot 3.5.8 and Spring Framework 6.2.14
    • It will likely not get updated to Spring Boot 4, however, this library is compatible with it, you can upgrade it on your project with no issue

Built-in DI

  • @Dependencies, @ConditionalService and custom @Condition annotations are now searched on supplied services
    • Supplied services are those added at runtime, will not affect anyone

Annotated commands

  • Removed exception thrown when both @TopLevelSlashCommandData and @SlashCommandData had a description (on a top-level command)
    • @TopLevelSlashCommandData will get prioritized instead

Interactions

  • Events of external components and modals are now logged on the DEBUG level

Interaction filters

  • Filters that do not acknowledge the interaction are now logged on the WARN level

Fixes

Annotated application commands

  • Fixed @DeclarationFilter being applied incorrectly

Built-in DI

  • Fixed initialization exceptions not interrupting program startup when using ClassFile-based method accessors

Misc

  • Fixed building message with pre-CV2 content when the Components V2 flag is enabled by default

Don't hesitate to check out the examples and the wiki.

Full Changelog: v3.0.0-beta.7...v3.0.0-beta.8


Installation

As a reminder, the minimum Java version supported is Java 17.

Kotlin Gradle

repositories {
    mavenCentral()
}

dependencies {
    implementation("io.github.freya022:BotCommands:3.0.0-beta.8")
}

Maven

<dependency>
    <groupId>io.github.freya022</groupId>
    <artifactId>BotCommands</artifactId>
    <version>3.0.0-beta.8</version>
</dependency>