v3.0.0-beta.8 | Safe localization module, command improvements and fixes
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
ApplicationCommandandTextCommand
Changes
- Split
ApplicationCommandinto optional interfacesSlashOptionChoiceProviderApplicationGeneratedValueSupplierProvider
- Split
TextCommandinto optional interfacesTextCommandHelpConsumerTextGeneratedValueSupplierProvider
New features
Introspection
- Added
method,declaringKClassanddeclaringClasstoExecutable
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#acceptinto two methodsacceptGlobalacceptCommand
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,@ConditionalServiceand custom@Conditionannotations are now searched on supplied services- Supplied services are those added at runtime, will not affect anyone
Annotated commands
- Removed exception thrown when both
@TopLevelSlashCommandDataand@SlashCommandDatahad a description (on a top-level command)@TopLevelSlashCommandDatawill get prioritized instead
Interactions
- Events of external components and modals are now logged on the
DEBUGlevel
Interaction filters
- Filters that do not acknowledge the interaction are now logged on the
WARNlevel
Fixes
Annotated application commands
- Fixed
@DeclarationFilterbeing 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>