Skip to content

V4.0.0 - #21

Merged
eggy03 merged 66 commits into
mainfrom
v4.0.0
Jun 2, 2026
Merged

V4.0.0#21
eggy03 merged 66 commits into
mainfrom
v4.0.0

Conversation

@eggy03

@eggy03 eggy03 commented Jun 2, 2026

Copy link
Copy Markdown
Owner

This PR is a big refactor that introduces Quarkus as a supporting framework for the bot. The main reason for including Quarkus was to use it's CDI called ArC. Additionally, SmallRye Health is also used to create custom healthcheck endpoints.

The changes, despite being big, are strictly internal and is fully compatible with v3.7.3 of the bot.

The following are some of the notable internal changes that has been included with the PR:

  1. Almost every class is an @ApplicationScoped bean and it's lifecycle is now managed by Quarkus
  2. The package structure has been reorganized into listeners and handlers (previously known as helpers). The listeners contain classes which extend JDA's ListenerAdapter and are dependent on the handler classes which process the events accordingly. Every listener class has been modified to strictly follow this style.
  3. The previously known listener AuditLogEventListener has received the biggest refactor. Known as GuildAuditLogEntryEventListener, it has an abstract handler class GuildAuditLogEntryCreateEventHandler which provides overridable methods for each ActionType found in a GuildAuditLogEntryCreateEvent. Concrete implementations can override the methods for only the events they want to process. A final method in the abstract superclass takes care of routing the events fired, to appropriate overridden functions. See b29e4c0 and the provided javadocs to know more about this implementation. In short, this listener now has it's own event firing system like JDA's ListenerAdapter.
  4. The BootstrapService has also received a major overhaul. The login process is now assisted by Quarkus via @PostConstruct and logout, via @PreDestroy. Environment variable detection is now managed by Quarkus, instead of DotEnv. The service now exposes a built ShardManager bean through a producer method, available within the container and injectable.
  5. Starting from v4.0.0, the bot now exposes two custom health check endpoints via /q/health/live and q/health/ready. These two check for the bot's connection to Discord and report in case there are connection issues. Aside from that, the pre-built /q/health/started is also avalable.
  6. Usage of Virtual Threads have been removed. They may be brought back in later releases.
  7. Including quarkus makes it easier for native build support in future versions.

eggy03 added 30 commits May 29, 2026 08:48
Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
- Replace manual bootstrap with Quarkus CDI and `@QuarkusMain` in `Start.java`
- Remove `EnvConfig.java` and use `application.properties` for configuration
- Add `PaperTrailSdkBeanProvider.java` to produce SDK client beans

Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
- Move default configuration values to `application.properties`
- Update `BootstrapService.java` to check if proxy URL is blank instead of null

Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
- Delete the deprecated `StackWalkerUtils.java` file
- Remove obsolete comments referencing `StackWalkerUtils` in helper utility classes

Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
- Add `@ApplicationScoped` and `@Inject` to listener classes
- Replace manual `Executor` with `@RunOnVirtualThread` in `SelfKickListener`
- Remove unused imports and comments

Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
- Move helper classes from `listeners` to `service` package
- Flatten listener packages by removing nested subdirectories
- Update package declarations and imports across affected files
- Delete obsolete `package-info.java`

Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
- Merge helper classes into `AutoModerationService`
- Move `AutoModUtils` to `utils.auditlog` package
- Refactor `AuditLogListener` to use `@RunOnVirtualThread` and inject the new service

Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
- Rename `AuditLogListener` to `AuditLogEventListener`
- Extract the event parsing logic into a new `AuditLogEventHandler` class to improve maintainability and separate concerns

Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
- Consolidate static helpers into `ModActionEventHandlerService`
- Rename `AuditLogEventHandler` to `AuditLogEventHandlerDelegator`
- Rename `AutoModerationService` to `AutoModerationEventHandlerService` to align naming

Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
- undo grouping of helpers into services

Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
- Replace `AuditLogListener` with `AuditLogEntryEventListener` and `AbstractAuditLogEntryEventHandler`
- Decouple event routing from handling to support multiple CDI-based handlers
- Use `@RunOnVirtualThread` for virtual thread execution

Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
- Rename `AbstractAuditLogEntryEventHandler` to `AuditLogEntryEventHandler`
- Change visibility of `handleEvent` from package-private to `public`
- Add detailed Javadocs explaining the multicast-style event routing

Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
- Remove `@RunOnVirtualThread` and `@Blocking` annotations from `SelfKickListener.java` and `AuditLogEntryEventListener.java`
- Clean up unused imports and Javadoc references to virtual threads

Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
- Rename `AuditLogEntryEventListener` to `GuildAuditLogEntryEventListener`
- Rename `AuditLogEntryEventHandler` to `GuildAuditLogEntryCreateEventHandler`
- Remove `channelIdToSendTo` parameter and registration check

Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
- merge six helper classes into `AutoModEventHandler`
- move `AutoModUtils` to the utility package

Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
- merge five helper classes into `ModActionEventHandler`

Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
- Add Javadoc to `onUnknownEvent` and `onUnimplementedEvent` in `GuildAuditLogEntryCreateEventHandler.java`
- Clarify the purpose of these handlers for unknown and unimplemented `ActionType`s

Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
- merge eight helper classes from channel subpackage into `ChannelEventHandler`, `ChannelOverrideEventHandler` and `VoiceChannelStatusEventHandler`
- move `ChannelUtils` to the utility package (affects Thread helpers)

Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
- merge three helper classes from thread subpackage into `ThreadEventHandler`
- move `ThreadUtils` to the utility package

Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
- merge three helper classes from thread subpackage into `RoleEventHandler`
- move `RoleUtils` to the utility package

Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
- merge three helper classes from thread subpackage into `EmojiEventHandler`

Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
- merge three helper classes from thread subpackage into `StickerEventHandler`
- move `StickerUtils` to the utility package

Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
- Implement basic embed logging for prune events in `ModActionEventHandler.java`
- Send a placeholder embed notification with an implementation notice when a prune event occurs

Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
- merge three helper classes from thread subpackage into `GuildUpdateEventHandler`
- move `GuildUtils` to the utility package

Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
…ndler

- merge three helper classes from thread subpackage into `HomeSettingsEventHandler`

Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
- merge three helper classes from thread subpackage into `WebhookEventHandler`
- move `WebhookUtils` to the utility package

Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
- merge three helper classes from thread subpackage into `IntegrationEventHandler`

Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
- merge two helper classes from thread subpackage into `InviteEventHandler`
- move `InviteUtils` to the utility package

Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
…dler

- merge four helper classes from thread subpackage into `MemberStatusEventHandler`
- move `MemberStatusUtils` to the utility package

Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
eggy03 added 12 commits June 1, 2026 13:47
Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
- Specify the project as a Quarkus application
- Enable Quarkus-specific build and packaging features

Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
- Rename `papertrailbot-jar-with-dependencies.jar` to `papertrailbot-runner.jar` because of Quarkus

Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
- Add `quarkus-smallrye-health` dependency to `pom.xml`
- Implement `LivenessCheckController` for JDA shard health monitoring
- Implement `ReadinessCheckController` to verify all JDA shards are connected
- Configure `quarkus.http.port` in `application.properties` for health endpoints

Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
- Externalize `quarkus.log.level` to use `LOG_LEVEL` environment variable

Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
- Remove `quarkus.package.jar.type` property from `pom.xml`
- Update `Dockerfile` to copy the `quarkus-app` directory
- Adjust `Dockerfile` entrypoint to `bot/quarkus-run.jar`

Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
@eggy03 eggy03 self-assigned this Jun 2, 2026
@eggy03 eggy03 added documentation Improvements or additions to documentation enhancement New feature or request dependencies Pull requests that update a dependency file java Pull requests that update java code labels Jun 2, 2026
eggy03 added 2 commits June 2, 2026 19:30
Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
eggy03 added 2 commits June 2, 2026 19:53
Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
Signed-off-by: Egg-03 <111327101+eggy03@users.noreply.github.com>
@eggy03
eggy03 merged commit 0fa0435 into main Jun 2, 2026
8 checks passed
@eggy03
eggy03 deleted the v4.0.0 branch June 2, 2026 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation enhancement New feature or request java Pull requests that update java code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant