Skip to content

v3.0.0-alpha.21 | Easier localization data formats, Spring dev tools, blocking events and fixes

Compare
Choose a tag to compare
@freya022 freya022 released this 06 Dec 16:00
· 43 commits to 3.X since this release
61f0562

JDA version

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

New features

  • Added JacksonLocalizationMapReader
    • This easily lets you register readers for any data format supported by Jackson
    • Supports changing the produced LocalizationTemplates
    • 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 the core.hooks package

Deprecations

  • Deprecated the async property of @BEventListener
    • Replaced by the mode property, can be changed to SHARED, ASYNC or BLOCKING

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

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

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 with getEmoji(), this a bug fix

Application commands

  • Default application commands cache is now in standard data directories for Linux and macOS (#217)
    • Linux: $XGD_DATA_HOME/.local/share/BotCommands (fallbacks to $HOME/.local/share/BotCommands, source)
    • macOS: ~/Library/Application Support/io.github.freya022.BotCommands (source 1, source 2)

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.

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 for JDA and Guild

Resolvers

  • Added KotlinTypeToken to construct a KType 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 and j.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