Skip to main content

nonebot-plugin-mc-whitelist-controller

Project description

NoneBotPluginLogo

NoneBotPluginText

nonebot-plugin-mc-whitelist-controller

GitHub License GitHub last commit GitHub last commit PyPI - Version

✨一个控制管理Minecraft服务器白名单的机器人插件✨

[!NOTE] 该项目目前还处于开发中,还不属于完全体,还不是很稳定!

📖 介绍

这是一个控制管理Minecraft服务器白名单的机器人插件,将mc服务器中的玩家id与QQ号绑定,实现对服务器内所有玩家的追根溯源,支持正版服务器和离线服务器。本插件可以在QQ中将玩家id注册入服务器白名单,同时会生成一个包含每个玩家id与其绑定的QQ号信息的json文件,供服务器管理员参看。

💿 安装

使用pip安装 在nonebot2项目插件目录下,打开命令行,输入以下安装命令
pip install nonebot-plugin-mc-whitelist-controller
使用git clone安装 可以将本项目克隆到你已经建立好的Nonebot机器人的目录内,并在project.toml中配置好本插件的安装目录
git clone https://github.com/leaf2006/nonebot-plugin-mc-whitelist-controller.git

⚙️ 配置

在 nonebot2 项目的.env文件中添加下表中的必填配置

配置项 必填 默认值 说明
WHITELIST_PATH 服务器whitelist.json的绝对路径
PROFILE_PATH profile.json 存放玩家id和QQ号的文件的绝对路径(若不存在该文件会自动创建),如果未填该配置会自动在机器人根目录创建profile.json
SERVER_STATUS offile 填写服务器状态(正版/离线服务器):online/offline
ADMINISTRATOR_ID 0 本插件管理员账户QQ号,可以查看玩家信息
  • WHITELIST_PATH配置示例:
# .env
# 本示例中给出的地址为虚构地址,仅供演示
WHITELIST_PATH=C:\Users\Minecraft\whitelist.json
  • PROFILE_PATH配置示例:
# .env
# 本示例中给出的地址为虚构地址,仅供演示
PROFILE_PATH=C:\Users\Minecraft\profile.json

此处PROFILE_PATH可以是绝对路径内的任意路径,但是在路径最后必须包括文件名,即使这个文件还未被创建

🎉 使用

指令表

指令 权限 需要@ 范围 说明
/注册 或 /register + [玩家id] 群员 群聊 向服务器白名单注册玩家信息
/指令列表 群员 群聊 查看指令列表
/玩家列表 注册管理员 私聊或群聊@ 查看玩家信息,仅已在.env注册过的管理员可用

[!IMPORTANT] 在首次使用本插件前,或切换过SERVER_STATUS参数后,请务必手动清除whitelist.json中除"[]"号外的所有内容,防止出现错误

效果图

注:以下示例展示的是在离线服务器环境下的实机演示

help

/register

此时whitelist.json会自动添加以下语句:

[
    // whitelist.json
    ...
    {
        "uuid": "dbc89c79-8236-36b0-b2cf-7dd0b9989b27",
        "name": "leaf2006"
    }
]

此时profile.json会自动添加以下语句,包括注册者的玩家id与QQ号:

[
    ...
    // nonebot_plugin_mc_whitelist_controller/data/profile.json
    {
        "name": "leaf2006",
        "qq": "此处代表该人的QQ号"
    }
]

Copyright © Leaf developer 2023-2026,遵循MIT开源协议

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nonebot_plugin_mc_whitelist_controller-0.9.0.tar.gz (12.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file nonebot_plugin_mc_whitelist_controller-0.9.0.tar.gz.

File metadata

File hashes

Hashes for nonebot_plugin_mc_whitelist_controller-0.9.0.tar.gz
Algorithm Hash digest
SHA256 68c1eab0b79303cac3949e82deb985d9fb81ed890ac3fb9d7bce0ed8967587d4
MD5 bf57bafe7e168f60c7e8d27560459488
BLAKE2b-256 1890567cf7caa43068cd05a9ef70b84d7938f2a297372525f5fc01ec47f611e5

See more details on using hashes here.

File details

Details for the file nonebot_plugin_mc_whitelist_controller-0.9.0-py3-none-any.whl.

File metadata

File hashes

Hashes for nonebot_plugin_mc_whitelist_controller-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5360a50b893f340e321d5642d8bea9472daf66895317715ed42fd2abe80f01d8
MD5 fb3a2ab6e9df9f69423975c322705339
BLAKE2b-256 2e1923e65de8b6c06ad191211fa8a6f4d02468f2263db09841dd15d56229a225

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page