Skip to content

Conversation

freya022
Copy link
Owner

@freya022 freya022 commented May 31, 2025

Deprecations

  • Deprecated BotCommands#create(<configuration block>)
    • Added an overload accepting the arguments of the main method
  • Deprecated JDAConfiguration.DevTools
    • Replaced with shutdownTimeout in BConfig, which applies to the entire framework's shutdown

New Features

  • Added BContext#shutdown
  • Added BContext#shutdownNow
  • Added BContext#awaitShutdown
  • Added SHUTTING_DOWN and SHUTDOWN in BContext.Status
  • Added BConfig#enableShutdownHook
  • Added BConfig#shutdownTimeout
  • Added BConfig#args
    • Not directly configurable, passed in the entry point or retrieved from Spring
  • Added BRestartConfig
  • Added BShutdownEvent
  • Added ApplicationStartListener
    • Will most likely be only used by the restarter module

Changes

  • Made internal coroutine dispatchers use daemon threads
    • So the JVM can exit if the bot is shut down (assuming the user does not create more non-daemon threads)
  • Moved RequiresDefaultInjection to the API
  • Added isDaemon to namedDefaultScope, defaults to false (compatible)

To do

  • Don't activate outside of development environments
  • Fix trying to access JDA from a closed Spring ApplicationContext on shutdown
  • Have the JDA cache not have a bajillion gotchas
  • Docs
  • Fix resource leaks, if any (threads, classes referencing old restart class loaders)
  • Fix all TODOs

@freya022 freya022 added this to the v3.0 milestone May 31, 2025
@freya022 freya022 added type: feature V3 Targets BotCommands 3.x.x type: experimental Is not a stable API labels May 31, 2025
@freya022 freya022 force-pushed the feature/restarter branch from 9366ee3 to c82c3ac Compare June 22, 2025 18:37
@freya022 freya022 changed the base branch from 3.X to 3.X-dev June 22, 2025 18:38
@freya022 freya022 force-pushed the feature/restarter branch from c82c3ac to b4a5694 Compare June 26, 2025 20:38
freya022 added 12 commits June 27, 2025 12:19
When the filesystem changes while an instance is being restarted (slow builds/too short delay),
awaiting the new instance allows restarting
as soon as the framework is in a state where it can shut down properly
To avoid getting beans while it is closing
Not breaking as this didn't exist earlier
The Spring shutdown listener already doesn't wait for full shutdown
Unfortunately build tool/IDE support sucks for java agents,
while the JVM screams at runtime, it can be appeased
@freya022 freya022 removed this from the v3.0 milestone Jul 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: experimental Is not a stable API type: feature V3 Targets BotCommands 3.x.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant