nonebot-plugin-valve-server-query
✨ NoneBot查服插件,可用于查询V社的游戏服务器,支持不同服组的权限配置以及服务器信息在线更新✨
安装
nb-cli
nb plugin install nonebot_plugin_valve_server_query
pip
pip install nonebot_plugin_valve_server_query
git(单独安装)
git clone https://github.com/LiLuo-B/nonebot-plugin-valve-server-query.git
source .venv/bin/activate
pip install poetry
poetry install
配置
.env|.env.prod|.env.dev
| 配置项 | 必填 | 默认值 | 说明 |
|---|---|---|---|
| a2s_path | 否 | "./data/valve" | 你的数据文件路径(包含权限配置与服务器信息) |
| a2s_ip | 否 | False | 是否将输出的域名转换为数字IP(防止动态公网IP暴露域名) |
| a2s_mask_name | 否 | False | 是否屏蔽玩家名字(防止玩家名字违规被举报封号) |
权限配置
用于服务器信息更新相关命令,文件位于a2s_path/authority.json,key为组名,value为拥有该组权限的QQ号列表
示例
{
"测试": [
"123456789",
"987654321"
],
"test": [
"11111111"
]
}
服务器信息批量添加配置
只需将json文件发送给机器人即可
示例
{
"组名": [
{
"id": 1,
"ip": "127.0.0.1:25535"
},
{
"id": 2,
"ip": "127.0.0.1:25536"
}
],
"测试": [
{
"id": 1,
"ip": "127.0.0.1:25535"
}
]
}
使用
| 指令 | 权限 | 相关参数 |
|---|---|---|
| a2s添加 | 详见权限配置 | 若用户仅一个组有权限,需要提供:id ip port,若用户有多个组的权限需要提供:组名 id ip port |
| a2s更新 | 详见权限配置 | 若用户仅一个组有权限,需要提供:id ip port,若用户有多个组的权限需要提供:组名 id ip port |
| a2s删除 | 详见权限配置 | 若用户仅一个组有权限,需要提供:id ,若用户有多个组的权限需要提供:组名 id |
| a2s列表 | 无 | 需要提供:组名,返回该组收录的所有ip:port |
| connect | 无 | 需要提供:ip:port,返回服务器信息 |
| 组名 | 无 | 不加参数返回该组所有服务器信息,加id返回该服信息 |
示例
查组
查服
json快捷更新
服务器添加
对多个组都有权限时
仅对一个组有权限时
服务器更新
对多个组都有权限时
仅对一个组有权限时
服务器删除
对多个组都有权限时
仅对一个组有权限时
服务器ip列表
Release files for nonebot-plugin-valve-server-query 0.5.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| nonebot_plugin_valve_server_query-0.5.8.tar.gz | 34.2 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| nonebot_plugin_valve_server_query-0.5.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 68.4 MB
Release files / nonebot_plugin_valve_server_query-0.5.8.tar.gz
| Download URL | nonebot_plugin_valve_server_query-0.5.8.tar.gz |
|---|---|
| Size | 34.2 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d48fa6ff20388f1536b45552daa370ac8b033194031d68ddeb03eeddae27981c
|
|
BLAKE2b-256 checksum How to use checksums |
3e53f7874978433622e2904294870136c5d626c390190a6448ac1bd32dfd52cf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.11.2
|
Release files / nonebot_plugin_valve_server_query-0.5.8-py3-none-any.whl
| Download URL | nonebot_plugin_valve_server_query-0.5.8-py3-none-any.whl |
|---|---|
| Size | 34.3 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a02b4c161f272b3986bbece90ff493f61c4eb93311c5b6283c0b62fa2c9515f4
|
|
BLAKE2b-256 checksum How to use checksums |
5968706b0e7490b6d568a3ff419634d1d2fe17ebb2a24619ab2045e28d8894d4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.11.2
|