基于NoneBot2的幻兽帕鲁 (Palworld) 服务器 REST API 插件
Project description
nonebot-plugin-palworld-sync
基于 Nonebot2 的幻兽帕鲁 (Palworld) 服务器 REST API 插件。
介绍
通过幻兽帕鲁官方 REST API 实现服务器状态监控与群内管理。支持群消息和游戏内互通、玩家踢出/封禁/解封、在线人数查询以及关机与存档等操作。
安装
推荐使用 nb-cli 安装:
nb plugin install nonebot-plugin-palworld-sync --upgrade
或使用包管理器
pip install nonebot-plugin-palworld-sync --upgrade
并在 pyproject.toml 或 bot.py 中加载插件:
plugins = ["nonebot_plugin_palworld_sync"]
1. 插件配置
幻兽帕鲁服务端配置 (PalWorldSettings.ini)
RESTAPIEnabled=True,RESTAPIPort=8212,AdminPassword="您的管理员密码"
Nonebot 环境变量配置 (.env)
PALWORLD_API_URL="http://<服务器IP>:8212"
PALWORLD_API_PASSWORD="您的管理员密码"
PALWORLD_QQ_GROUPS=["123456", "789012"] # 必填:本插件生效的 QQ 群号列表(JSON 数组格式),非列表内的群不响应任何指令
PALWORLD_FORWARD_GROUP_MSG=True # 可选:设置为 True 即可开启 QQ 群消息互通转发至游戏内,默认 False
2. 指令一览
公共指令
| 指令 | 参数要求 | 功能描述 |
|---|---|---|
| /pw status | 无 | 查看服务器状态 (版本、FPS、在线人数、核心设置等) |
| /pw players [目标] | [目标]: 选填 (名字/PlayerID/SteamID) | 查看在线玩家简表,若指定目标则返回其详细状态 |
管理员指令 (限超级用户、群主、群管理员)
| 指令 | 参数要求 | 功能描述 |
|---|---|---|
| /pw say | : 消息内容 | 发送全局广播消息 |
| /pw kick [reason] | : 名字/PlayerID/SteamID [reason]: 可空 |
踢出指定玩家 (支持在线玩家名字模糊匹配) |
| /pw ban [reason] | : 名字/PlayerID/SteamID [reason]: 可空 |
封禁指定玩家 (支持在线玩家名字模糊匹配) |
| /pw unban <steam_id> | <steam_id>: SteamID | 解封指定的玩家 |
| /pw save | 无 | 保存当前游戏世界的存盘 |
| /pw shutdown [秒/force] [msg] | [秒/force]: 秒数或 force 强制关闭 [msg]: 可空 |
关闭服务器 (优雅关机或强关合并) |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nonebot_plugin_palworld_sync-0.1.0.tar.gz.
File metadata
- Download URL: nonebot_plugin_palworld_sync-0.1.0.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aad31f5cfac0142d214bb8513d1d55278ce101171c2fcfb8914a1e6f85c025ad
|
|
| MD5 |
4cee7d7c68c067e1779f4b2a4e920a27
|
|
| BLAKE2b-256 |
c7722643d67e2d8bf0badad1c4faf3eb582ad0e91fa5c46658ce83d90896ab9b
|
File details
Details for the file nonebot_plugin_palworld_sync-0.1.0-py3-none-any.whl.
File metadata
- Download URL: nonebot_plugin_palworld_sync-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f62f36805e5b669799f0e40c788beebc0c16546c20ec3e864988e610b7d4d3ac
|
|
| MD5 |
81717e000ea419a434c2ef69b2bc3470
|
|
| BLAKE2b-256 |
0ada2bb49a49afed2721f523506de834a86eed4fd3e97f41b33edd3c315c7ca7
|