Skip to content

Commit bdcf184

Browse files
committed
✨ version 0.7.0
resolve #6
1 parent 2052f60 commit bdcf184

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ SATORI_CLIENTS='
4141
{
4242
"host": "localhost",
4343
"port": "5500",
44+
"path": "",
4445
"token": "xxx"
4546
}
4647
]
@@ -49,6 +50,8 @@ SATORI_CLIENTS='
4950

5051
`host``port` 为 Satori 服务端的监听地址与端口,
5152

53+
`path` 为 Satori 服务端自定义的监听路径,如 `"/satori"`,默认为 `""`
54+
5255
`token` 由 Satori 服务端决定是否需要。
5356

5457

nonebot/adapters/satori/config.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,25 @@
66

77
class ClientInfo(BaseModel):
88
host: str = "localhost"
9+
"""服务端的地址"""
910
port: int
11+
"""服务端的端口"""
12+
path: str = ""
13+
"""服务端的自定义路径"""
1014
token: Optional[str] = None
15+
"""服务端的 token"""
1116

1217
@property
1318
def identity(self):
1419
return f"{self.host}:{self.port}#{self.token}"
1520

1621
@property
1722
def api_base(self):
18-
return URL(f"http://{self.host}:{self.port}") / "v1"
23+
return URL(f"http://{self.host}:{self.port}") / self.path / "v1"
1924

2025
@property
2126
def ws_base(self):
22-
return URL(f"ws://{self.host}:{self.port}") / "v1"
27+
return URL(f"ws://{self.host}:{self.port}") / self.path / "v1"
2328

2429

2530
class Config(BaseModel, extra=Extra.ignore):

0 commit comments

Comments
 (0)