================================================================================
UUID & IP LOCKER - DISCORD BOT SETUP GUIDE
================================================================================
This guide provides step-by-step instructions on how to create, configure,
and link the Discord Bot for the UUID & IP Locker plugin.
--------------------------------------------------------------------------------
1. CREATE THE DISCORD BOT APPLICATION
--------------------------------------------------------------------------------
1. Go to the Discord Developer Portal: https://discord.com/developers/applications
2. Click the "New Application" button in the top right.
3. Give your application a name (e.g., "Server Security Bot") and click "Create".
4. Navigate to the "Bot" tab on the left sidebar.
5. Click "Reset Token" (or "Copy Token") to get your Bot Token.
*IMPORTANT: Keep this token secret! Do not share it.*
--------------------------------------------------------------------------------
2. ENABLE REQUIRED INTENTS (CRITICAL)
--------------------------------------------------------------------------------
The bot requires specific "Intents" to read messages and see server members.
Without these, the bot will NOT function correctly.
1. In the "Bot" tab, scroll down to the "Privileged Gateway Intents" section.
2. Enable the following toggles:
- PRESENCE INTENT (Optional, but recommended)
- SERVER MEMBERS INTENT (REQUIRED for unlinking and DMing members)
- MESSAGE CONTENT INTENT (REQUIRED for reading commands if any)
3. Click "Save Changes".
--------------------------------------------------------------------------------
3. INVITE THE BOT TO YOUR SERVER
--------------------------------------------------------------------------------
1. Navigate to the "OAuth2" tab, then select "URL Generator".
2. Under "Scopes", check:
- [x] bot
3. Under "Bot Permissions", check:
- [x] Send Messages
- [x] Embed Links
- [x] Read Message History
- [x] Use External Emojis
4. Copy the generated URL at the bottom.
5. Paste the URL into your browser and select your server to invite the bot.
--------------------------------------------------------------------------------
4. CONFIGURE THE PLUGIN (config.yml)
--------------------------------------------------------------------------------
Open your 'config.yml' file in the plugin folder and update the 'discord-bot' section:
discord-bot:
enabled: true
token: "PASTE_YOUR_BOT_TOKEN_HERE"
guild-id: "YOUR_SERVER_ID" # Right-click server name -> Copy Server ID
admin-role-id: "ADMIN_ROLE_ID" # Right-click your Admin Role -> Copy Role ID
log-channel-id: "CHANNEL_ID" # Right-click a channel -> Copy Channel ID
*Note: To see "Copy ID" options, you must enable "Developer Mode" in Discord
Settings -> Advanced -> Developer Mode.*
--------------------------------------------------------------------------------
5. ACCOUNT LINKING FLOW
--------------------------------------------------------------------------------
Once the bot is online, players can link their accounts:
1. In-Game: Player runs `/link request <discord_id>`.
2. Webhook: A code is sent to the 'link-codes' webhook (Admin only).
3. Communication: Admin gives the code to the player.
4. In-Game: Player runs `/link verify <code>`.
5. Success: The account is now linked!
--------------------------------------------------------------------------------
6. DISCORD IP ALERTS (2FA)
--------------------------------------------------------------------------------
If 'features.send-verification-to-discord' is enabled in the GUI/Config:
1. A linked player joins from a NEW IP address.
2. The plugin blocks the join and generates a verification code.
3. The Discord Bot automatically DMs the player the code.
4. The player uses that code in-game via `/uuidiplocker verify <code>` to
authorize their new location.
--------------------------------------------------------------------------------
7. TROUBLESHOOTING
--------------------------------------------------------------------------------
- Bot not sending DMs:
- Ensure 'SERVER MEMBERS INTENT' is enabled in the Developer Portal.
- Ensure the player is actually in the Discord server.
- Check if the player has "Allow direct messages from server members" enabled.
- Bot not starting:
- Check your server console for token errors.
- Ensure 'enabled: true' is set in the config.
- Run `/uilreload` in-game to restart the bot.
================================================================================
End of Setup Guide
================================================================================