A PocketMine-MP plugin that allows players to register their Discord accounts and link them with in-game usernames.
A PocketMine-MP plugin that allows players to register their Discord accounts and link them with in-game usernames. The plugin sends a verification code to a configured Discord webhook, which can then be used by players to verify their accounts in-game.
DiscordAuth folder inside the plugins directory of your PocketMine-MP server.The plugin uses two configuration files:
config.yml: Stores general configuration settings like messages and webhook URL.users.yml: Stores the registered user data, including their Minecraft usernames and associated Discord IDs.config.yml:# Webhook URL for sending verification messages.
webhook-url: "https://discord.com/api/webhooks/your-webhook-url"
# Messages used throughout the plugin.
verification-title: "Discord Verification"
verification-message: "Player {player_name} is trying to verify their Discord account. Verification code: {verification_code}"
discord-verification-message: "Player {discord_id} is requesting verification with code {verification_code}"
verification-sent: "A verification message has been sent to Discord. Please check your channel."
register-usage: "Usage: /register <verification_code>"
invalid-code: "Invalid verification code."
registration-success: "Your Discord account has been successfully linked!"
already-registered: "This Discord account is already linked to a player."
invalid-discord-id: "Please provide a valid Discord ID."
discord-usage: "Usage: /discord <discord_id>"
code-not-for-player: "The verification code is not for you."
role-command: "/give {player} discord_role"
users.yml:123456789012345678:
player: "player_name"
discord_id: "123456789012345678"
/discord <discord_id>: Starts the registration process by sending a verification message to the configured Discord webhook./register <verification_code>: Completes the registration using the verification code received in Discord./discord <discord_id> to start the registration process./register <verification_code> to link their Discord account to their Minecraft username.users.yml file.This plugin is released under the MIT License. See the LICENSE file for more details.