?️ WhitelistBot
自动从 Discord 频道添加玩家至白名单——无需命令,省心省力。
WhitelistBot 连接你的 Discord 服务器和 Minecraft 服务器。设置一个专用频道,当玩家发送他们的 Minecraft 用户名时,机器人会立即将其加入白名单,并回复一个带颜色的嵌入消息。每个 Discord 账号仅限一个用户名,始终如此。
✨ 功能特性
- ? Discord → Minecraft 白名单添加 —— 玩家在频道中发送其用户名,机器人完成其余操作
- ? 每个 Discord 用户仅对应一个用户名 —— 通过 SQLite 数据库强制执行,无重复项
- ✅ 智能验证 —— 检查无效字符、已列入白名单的玩家以及已被占用的用户名
- ? 网页仪表盘 —— 在浏览器中添加和删除条目,支持搜索表格
- ? 自动生成密码 —— 首次启动时生成随机登录密码并保存至
webpage.yml
- ? 游戏内重载 ——
/wlbot reload 重新加载配置并重启机器人,无需重启服务器
- ? 彩色嵌入消息 —— 绿色表示成功,红色表示错误,棕色表示输入无效,橙色表示已注册
? 嵌入消息响应
| 情况 |
颜色 |
消息内容 |
| 有效的新用户名 |
? 绿色 |
✅ 已成功添加至白名单 |
| 用户名格式无效 |
? 棕色 |
⚠️ 包含无效字符 |
| Discord 用户已注册 |
? 橙色 |
⚠️ 已注册 |
| 用户名被其他用户占用 |
? 红色 |
❌ 用户名已被占用 |
| 已在白名单中 |
? 红色 |
❌ 已在白名单中 |
⚙️ 安装设置
1. 创建 Discord 机器人
- 访问 discord.com/developers/applications → 点击 New Application(新建应用程序)
- 导航至 Bot 页面 → 复制你的令牌(token)
- 在 Privileged Gateway Intents(特权网关意图)下启用 Message Content Intent
- 在 OAuth2 → URL Generator 中,选择
bot 作用域,勾选 Read Messages(读取消息)和 Send Messages(发送消息)权限,并将机器人邀请到你的服务器
2. 获取你的 ID
在 Discord 设置 → Advanced(高级)中启用 Developer Mode(开发者模式),然后:
- 右键点击你的服务器 → 选择 Copy Server ID(复制服务器 ID)
- 右键点击你的白名单频道 → 选择 Copy Channel ID(复制频道 ID)
3. 配置插件
编辑 plugins/WhitelistBot/config.yml:
discord:
bot-token: "YOUR_BOT_TOKEN_HERE"
guild-id: "YOUR_GUILD_ID_HERE"
channel-id: "YOUR_CHANNEL_ID_HERE"
4. 网页仪表盘
首次启动时,会在 plugins/WhitelistBot/webpage.yml 中创建一个包含随机生成密码的文件:
web:
password: "a3f9c2d1e8b04f7a"
port: 8080
在浏览器中打开 http://your-server-ip:8080 即可访问仪表盘。
? 网页仪表盘
内置的仪表盘允许你在不触碰服务器控制台的的情况下管理白名单条目。
- 添加条目 —— 输入 Discord ID + Minecraft 用户名以即时添加并列入白名单
- 删除条目 —— 按 Discord ID 删除,自动执行
/whitelist remove
- 搜索 —— 按 Discord ID 或 Minecraft 用户名过滤表格
- 安全登录 —— 基于会话的身份验证,使用你的
webpage.yml 密码
要更改密码或端口,请编辑 webpage.yml 并运行 /wlbot reload。
? 命令与权限
| 命令 |
描述 |
权限 |
/wlbot reload |
重新加载配置并重启机器人 |
whitelistbot.reload(默认:op) |
?️ 数据库
所有条目均存储在 plugins/WhitelistBot/whitelist.db(SQLite 文件)中。你可以使用 DB Browser for SQLite 打开它以手动查看或管理条目。
数据库存储以下内容:
- Discord ID
- Minecraft 用户名
- 被列入白名单的时间戳
?️ 兼容性
| Minecraft 版本 |
支持情况 |
| 1.18.x |
✅ |
| 1.19.x |
✅ |
| 1.20.x |
✅ |
| 1.21.x |
✅ |
需要 Paper 或 Spigot。1.18–1.19 版本需要 Java 17+,1.20+ 版本需要 Java 21+。
?️ WhitelistBot
Automatically whitelist players from a Discord channel — no commands, no hassle.
WhitelistBot bridges your Discord server and Minecraft server. Set up a dedicated channel, and when a player sends their Minecraft username, the bot instantly whitelists them and replies with a colour-coded embed. One username per Discord account, always.
✨ Features
- ? Discord → Minecraft whitelisting — players send their username in a channel, bot does the rest
- ? One username per Discord user — enforced via SQLite database, no duplicates
- ✅ Smart validation — checks for invalid characters, already-whitelisted players, and taken usernames
- ? Web dashboard — add and remove entries from a browser with a searchable table
- ? Auto-generated password — random login saved to
webpage.yml on first launch
- ? In-game reload —
/wlbot reload reloads config and restarts the bot without restarting the server
- ? Colour-coded embeds — green for success, red for errors, brown for invalid input, orange for already registered
? Embed Responses
| Situation |
Colour |
Message |
| Valid new username |
? Green |
✅ Successfully Whitelisted |
| Invalid username format |
? Brown |
⚠️ Invalid Characters |
| Discord user already registered |
? Orange |
⚠️ Already Registered |
| Username taken by another user |
? Red |
❌ Username Taken |
| Already on whitelist |
? Red |
❌ Already Whitelisted |
⚙️ Setup
1. Create a Discord Bot
- Go to discord.com/developers/applications → New Application
- Navigate to Bot → copy your token
- Enable Message Content Intent under Privileged Gateway Intents
- Under OAuth2 → URL Generator, select
bot scope with Read Messages + Send Messages permissions and invite it to your server
2. Get Your IDs
Enable Developer Mode in Discord Settings → Advanced, then:
- Right-click your server → Copy Server ID
- Right-click your whitelist channel → Copy Channel ID
3. Configure the Plugin
Edit plugins/WhitelistBot/config.yml:
discord:
bot-token: "YOUR_BOT_TOKEN_HERE"
guild-id: "YOUR_GUILD_ID_HERE"
channel-id: "YOUR_CHANNEL_ID_HERE"
4. Web Dashboard
On first launch, plugins/WhitelistBot/webpage.yml is created with a randomly generated password:
web:
password: "a3f9c2d1e8b04f7a"
port: 8080
Open http://your-server-ip:8080 in your browser to access the dashboard.
? Web Dashboard
The built-in dashboard lets you manage whitelist entries without touching the server console.
- Add entries — enter a Discord ID + Minecraft username to add and whitelist instantly
- Remove entries — remove by Discord ID, automatically runs
/whitelist remove
- Search — filter the table by Discord ID or Minecraft username
- Secure login — session-based auth with your
webpage.yml password
To change the password or port, edit webpage.yml and run /wlbot reload.
? Commands & Permissions
| Command |
Description |
Permission |
/wlbot reload |
Reloads config and restarts the bot |
whitelistbot.reload (default: op) |
?️ Database
All entries are stored in plugins/WhitelistBot/whitelist.db (SQLite). You can open it with DB Browser for SQLite to view or manage entries manually.
The database stores:
- Discord ID
- Minecraft username
- Timestamp of when they were whitelisted
?️ Compatibility
| Minecraft Version |
Supported |
| 1.18.x |
✅ |
| 1.19.x |
✅ |
| 1.20.x |
✅ |
| 1.21.x |
✅ |
Requires Paper or Spigot. Java 17+ required for 1.18–1.19, Java 21+ for 1.20+.
评论 0
登录后参与评分
还没有评论,来抢沙发吧