Skip to main content

基于NoneBot2的幻兽帕鲁 (Palworld) 服务器 REST API 插件

Project description

nonebot2 pypi python

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.tomlbot.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
PALWORLD_PLAYER_TRACKING=True  # 可选:是否开启玩家在线进出服务器的广播通知,默认 True
PALWORLD_PLAYER_TRACKING_INTERVAL=10  # 可选:玩家在线状态的轮询间隔(秒),默认 10

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


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_palworld_sync-0.1.2.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

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

nonebot_plugin_palworld_sync-0.1.2-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file nonebot_plugin_palworld_sync-0.1.2.tar.gz.

File metadata

File hashes

Hashes for nonebot_plugin_palworld_sync-0.1.2.tar.gz
Algorithm Hash digest
SHA256 d02f4c9d8508a3d3e655008cd64106ea81b38d78cf2779ade6f67a63b0aa4913
MD5 91aa250cbca4ef90ef22b27c2970ba88
BLAKE2b-256 1ef773c8c7911b89ca8eeda6ef4863e7df3619376b9dcb84519dc19428ade0ab

See more details on using hashes here.

File details

Details for the file nonebot_plugin_palworld_sync-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for nonebot_plugin_palworld_sync-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9e734b617515a1a42b76ced0f3be68bface9438f2507e0aaa2225c15bce63d43
MD5 81f820b1d1912d05e92ca7447f908f30
BLAKE2b-256 154eb107a54f9a17106ea866c8ade2d0ed45911da468c43066e148f1fb19edd1

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