v3.0.0-alpha.21 | Easier localization data formats, Spring dev tools, blocking events and fixes
Overview
Added easier localization data format support, support for Spring devtools, blocking events and fixes.
Jackson-based localization map readers (#218)
A general-purpose localization map reader based on Jackson was added, so you can add support for any data format supported by Jackson.
Breaking changes
- Removed
DefaultJsonLocalizationMapReader
- Replaced by a
JacksonLocalizationMapReader
, using the JSON data format - Also changed the bean name to reflect the change, should not affect anyone
- Replaced by a
New features
- Added
JacksonLocalizationMapReader
- This easily lets you register readers for any data format supported by Jackson
- Supports changing the produced
LocalizationTemplate
s - Support changing the
ClassLoader
used to load resources- This should only be useful when working across named modules
Spring developer tools support (#219)
This allows you to reload your entire application without restarting the entire JVM, leading to faster reload times.
You can configure a few properties with the jda.devtools.*
prefix.
Blocking event listeners (#220)
You are now able to listen to events in the same thread they were fired in.
Breaking changes
- Moved
EventDispatcher
to thecore.hooks
package
Deprecations
- Deprecated the
async
property of@BEventListener
- Replaced by the
mode
property, can be changed toSHARED
,ASYNC
orBLOCKING
- Replaced by the
Additions
- You are now able to listen to events on the same thread they were fired on, using
mode = RunMode.BLOCKING
.
Breaking changes
Rate limiting
- (Java only) Static factories are now prefixed with
create
- This was necessary as you could not use
default
due to it being a context-less Java keyword
- This was necessary as you could not use
JDAService
- (Java only) Static factories are now prefixed with
create
- This was necessary as you could not use
default
due to it being a context-less Java keyword
- This was necessary as you could not use
Changes
Dependencies
- JDA: 5.1.1 -> 5.2.1
- Spring boot (optional): 3.2.2 -> 3.2.12
- JEmoji: 1.3.3 -> 1.6.0
- You can safely remove this dependency if you do not wish to resolve Unicode emojis from shortcodes
- Note: If you were using JEmoji's
Emoji#getUnicode()
, you will need to replace it withgetEmoji()
, this a bug fix
Application commands
- Default application commands cache is now in standard data directories for Linux and macOS (#217)
Default rate limiter
PriorityGlobalRestRateLimiter
now immediately forwards interaction requests (Global RL doesn't apply on them)
New features
Events
- Added
PreFirstGatewayConnectEvent
- This event is suited for usages when you need to run logic after loading all services,
and after the token was validated, but before JDA actual logs in the gateway and starts receiving events.
- This event is suited for usages when you need to run logic after loading all services,
Rate limiting
- Added Kotlin extensions when defining bucket refill
Extensions
- Added emoji helpers, to get emojis lazily and convert between JEmoji and JDA emojis
lazyUnicodeEmoji
Emoji#asUnicodeEmoji
EmojiUtils#asUnicodeEmoji
- Added more
OrNull
extensions forJDA
andGuild
Resolvers
- Added
KotlinTypeToken
to construct aKType
wrapper, as an alternative for parametrized types in resolvers
Bug fixes
Spring
- Fixed metadata files
Resolvers
- Improved equality checks between Kotlin and Java equivalents (like
k.c.List
andj.u.List
)
Application commands
- Fixed top-level slash command descriptions sometimes using a subcommand description
JDAService
- Fixed a false positive mismatch due to JDA returning both old and renamed intents as enabled
Default rate limiter
- Fixed the
PriorityGlobalRestRateLimiter
"discarding" requests when all tokens were used, until they were refilled - Fixed the
PriorityGlobalRestRateLimiter
sending requests in the wrong order due to priority ties being broken arbitrarily
Extensions
- Fixed
deleteDelayed
Don't hesitate to check out the examples and the wiki.
Full Changelog: v3.0.0-alpha.20...v3.0.0-alpha.21