Skip to content

Conversation

@Jakubk15
Copy link
Member

@Jakubk15 Jakubk15 commented Jan 17, 2026

This pull request introduces comprehensive Discord integration into the ParcelLockers plugin, including support for both native Discord bots and DiscordSRV, as well as configurable messages and settings. The changes add new configuration options, message templates, and implementation classes to enable Discord account linking, notifications, and commands.

Discord Integration Features:

  • Added Discord integration support with a toggle in PluginConfig. Includes settings for enabling/disabling and specifying the Discord bot token. [1] [2]
  • Implemented Discord account linking services and repository, supporting both DiscordSRV and a fallback linking system. Includes new classes such as DiscordLinkService, DiscordFallbackLinkService, and DiscordLinkRepository. [1] [2] [3]
  • Added DiscordClientManager for managing the Discord bot client lifecycle, including login and shutdown.
  • Integrated Discord-related commands (DiscordLinkCommand, DiscordUnlinkCommand, DiscordSrvLinkCommand, DiscordSrvUnlinkCommand) and event controllers for handling parcel delivery notifications via Discord. [1] [2]

Configuration and Messaging Enhancements:

  • Extended MessageConfig with a new DiscordMessages section, allowing customization of all messages related to Discord linking, verification, and notifications, including DiscordSRV-specific messages. [1] [2]
  • Updated plugin initialization and shutdown logic to handle Discord integration setup and teardown gracefully, including disabling the plugin if required Discord settings are missing. [1] [2] [3]

General Refactoring:

  • Refactored metrics and updater service initialization for clarity.

These changes collectively enable robust Discord integration, allowing users to link their Minecraft and Discord accounts, receive notifications, and configure all related messages and settings.

@Jakubk15 Jakubk15 added the 🆕 feature New feature or request label Jan 17, 2026
@Jakubk15 Jakubk15 marked this pull request as draft January 17, 2026 14:54
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a significant new feature: Discord integration. The implementation is comprehensive, covering configuration, commands for linking/unlinking accounts, and the necessary database persistence.

My review focuses on several key areas:

  • Critical Blocking Calls: There are several instances of blocking network and I/O calls (.block()) on the main server thread. These will cause your server to freeze and must be addressed. I've marked these as critical.
  • Code Readability: Some methods with asynchronous logic have deeply nested callbacks, which can be refactored for better readability and maintainability.
  • Configuration Defaults: The default values in the configuration should be set to be more generic for a public plugin.
  • Minor Logic Errors: I found a few minor issues, such as a duplicated condition and incorrect message targets for admin commands.

Overall, this is a great addition. Addressing the blocking calls is the highest priority before this can be safely used on a production server.

Jakubk15 and others added 6 commits January 17, 2026 16:07
…/DiscordLinkRepositoryOrmLite.java

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
…/DiscordLinkRepositoryOrmLite.java

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@Jakubk15 Jakubk15 linked an issue Jan 17, 2026 that may be closed by this pull request
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds Discord integration to the ParcelLockers plugin, enabling players to link their Minecraft accounts with Discord for notifications. The implementation includes account linking/unlinking commands with verification flow, repository layer for persistence, and Discord client lifecycle management.

Changes:

  • Added Discord client manager with async login/logout functionality
  • Implemented account linking commands with verification code flow using Paper's Dialog API
  • Created repository layer with OrmLite for storing Discord-Minecraft account links
  • Extended configuration with Discord settings and related messages

Reviewed changes

Copilot reviewed 11 out of 12 changed files in this pull request and generated 17 comments.

Show a summary per file
File Description
build.gradle.kts Added discord4j-core dependency and invalid JUnit version
DiscordLink.java Simple record for linking Minecraft UUID to Discord ID
DiscordNotificationType.java Unused enum defining notification delivery types
DiscordClientManager.java Manages Discord client lifecycle with async initialization issues
DiscordLinkRepository*.java Repository interface, entity, and OrmLite implementation with query bug
DiscordLinkCommand.java Account linking command with verification flow and security concerns
DiscordUnlinkCommand.java Account unlinking command for self and admin operations
PluginConfig.java Discord configuration settings with hardcoded test values
MessageConfig.java Discord-related user messages with misleading error text
ParcelLockers.java Plugin initialization with race condition and null handling issues

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Jakubk15 Jakubk15 marked this pull request as ready for review January 24, 2026 18:44
Jakubk15 and others added 8 commits January 24, 2026 19:51
…scordLinkCommand.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…scordLinkCommand.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…scordLinkCommand.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ementation/MessageConfig.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@Jakubk15 Jakubk15 requested review from CitralFlo and imDMK January 24, 2026 20:48
CitralFlo
CitralFlo previously approved these changes Jan 29, 2026
Copy link
Member

@CitralFlo CitralFlo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looking good.
I have seen better solutions ex. Redis / Kafka event with minimal setup. But this is much more open. Using general solutions is more based, instead of custom discord bot code with other dependencies - like the databases.

import java.util.Optional;
import java.util.UUID;

class VerificationCache {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why extracted ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Single responsibility principle


public class DiscordVerificationService {

private final VerificationCache verificationCache;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When could be init here

@Jakubk15
Copy link
Member Author

/gemini review

@Jakubk15 Jakubk15 requested review from imDMK and vLuckyyy January 31, 2026 13:58
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds a comprehensive Discord integration, supporting both a native bot and DiscordSRV. The implementation is well-structured, with clear separation of concerns for different integration providers, services, and commands. I've found a critical issue regarding the handling of the Discord bot token and a medium-severity suggestion to simplify some reactive code. Overall, this is a great addition to the plugin.

Copy link
Member

@noyzys noyzys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

☝️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🆕 feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Discord webhooks, bot, plugin integration

6 participants