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

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.1.tar.gz (7.2 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.1-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for nonebot_plugin_palworld_sync-0.1.1.tar.gz
Algorithm Hash digest
SHA256 206a90edaf4cb1a6952e5440df4f5b84f5880117f810daf7c2be73581279c175
MD5 cd8cae14ea830c2f7f6d8b059c61c95b
BLAKE2b-256 0f66bb1b57b6682b86c3493f0c6bce073dfa8d41aedb426803c04450c1db107c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nonebot_plugin_palworld_sync-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bdddac9754f41dda6cb38035e15ce68420e4967be0ba5b09b0249e4863258bc1
MD5 b72844aadec592619e599997234bf049
BLAKE2b-256 f5fb10c26d0e7bf86003d0a74a2a2b87a9bf74f4e55d70b80fbd92a049e30f8e

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