satori-python-adapter-onebot11 0.3.2__tar.gz → 0.3.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {satori_python_adapter_onebot11-0.3.2 → satori_python_adapter_onebot11-0.3.3}/.mina/adapter_onebot11.toml +1 -1
- {satori_python_adapter_onebot11-0.3.2 → satori_python_adapter_onebot11-0.3.3}/PKG-INFO +1 -1
- {satori_python_adapter_onebot11-0.3.2 → satori_python_adapter_onebot11-0.3.3}/pyproject.toml +1 -1
- {satori_python_adapter_onebot11-0.3.2 → satori_python_adapter_onebot11-0.3.3}/src/satori/adapters/onebot11/api.py +16 -0
- {satori_python_adapter_onebot11-0.3.2 → satori_python_adapter_onebot11-0.3.3}/LICENSE +0 -0
- {satori_python_adapter_onebot11-0.3.2 → satori_python_adapter_onebot11-0.3.3}/README.md +0 -0
- {satori_python_adapter_onebot11-0.3.2 → satori_python_adapter_onebot11-0.3.3}/src/satori/adapters/onebot11/__init__.py +0 -0
- {satori_python_adapter_onebot11-0.3.2 → satori_python_adapter_onebot11-0.3.3}/src/satori/adapters/onebot11/events/__init__.py +0 -0
- {satori_python_adapter_onebot11-0.3.2 → satori_python_adapter_onebot11-0.3.3}/src/satori/adapters/onebot11/events/base.py +0 -0
- {satori_python_adapter_onebot11-0.3.2 → satori_python_adapter_onebot11-0.3.3}/src/satori/adapters/onebot11/events/message.py +0 -0
- {satori_python_adapter_onebot11-0.3.2 → satori_python_adapter_onebot11-0.3.3}/src/satori/adapters/onebot11/events/notice.py +0 -0
- {satori_python_adapter_onebot11-0.3.2 → satori_python_adapter_onebot11-0.3.3}/src/satori/adapters/onebot11/events/request.py +0 -0
- {satori_python_adapter_onebot11-0.3.2 → satori_python_adapter_onebot11-0.3.3}/src/satori/adapters/onebot11/forward.py +0 -0
- {satori_python_adapter_onebot11-0.3.2 → satori_python_adapter_onebot11-0.3.3}/src/satori/adapters/onebot11/message.py +0 -0
- {satori_python_adapter_onebot11-0.3.2 → satori_python_adapter_onebot11-0.3.3}/src/satori/adapters/onebot11/reverse.py +0 -0
- {satori_python_adapter_onebot11-0.3.2 → satori_python_adapter_onebot11-0.3.3}/src/satori/adapters/onebot11/utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: satori-python-adapter-onebot11
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.3
|
|
4
4
|
Summary: Satori Protocol SDK for python, adapter for OneBot 11
|
|
5
5
|
Home-page: https://github.com/RF-Tar-Railt/satori-python
|
|
6
6
|
Author-Email: RF-Tar-Railt <rf_tar_railt@qq.com>
|
|
@@ -197,6 +197,18 @@ def apply(adapter: Adapter, net_getter: Callable[[str], OneBotNetwork], login_ge
|
|
|
197
197
|
@adapter.route(Api.CHANNEL_GET)
|
|
198
198
|
async def channel_get(request: Request[ChannelParam]):
|
|
199
199
|
net = net_getter(request.self_id)
|
|
200
|
+
channel_id = request.params["channel_id"]
|
|
201
|
+
if channel_id.startswith("private:"):
|
|
202
|
+
user_id = channel_id.removeprefix("private:")
|
|
203
|
+
result = await net.call_api("get_stranger_info", {"user_id": int(user_id)})
|
|
204
|
+
if not result:
|
|
205
|
+
raise RuntimeError(f"Failed to get user {user_id}")
|
|
206
|
+
return Channel(
|
|
207
|
+
f"private:{user_id}",
|
|
208
|
+
ChannelType.DIRECT,
|
|
209
|
+
result["nickname"],
|
|
210
|
+
USER_AVATAR_URL.format(uin=user_id),
|
|
211
|
+
)
|
|
200
212
|
result = await net.call_api("get_group_info", {"group_id": int(request.params["channel_id"])})
|
|
201
213
|
if not result:
|
|
202
214
|
raise RuntimeError(f"Failed to get group {request.params['channel_id']}")
|
|
@@ -250,6 +262,8 @@ def apply(adapter: Adapter, net_getter: Callable[[str], OneBotNetwork], login_ge
|
|
|
250
262
|
@adapter.route(Api.CHANNEL_UPDATE)
|
|
251
263
|
async def channel_update(request: Request[ChannelUpdateParam]):
|
|
252
264
|
net = net_getter(request.self_id)
|
|
265
|
+
if request.params["channel_id"].startswith("private:"):
|
|
266
|
+
raise RuntimeError("Cannot update private channel")
|
|
253
267
|
await net.call_api(
|
|
254
268
|
"set_group_name",
|
|
255
269
|
{"group_id": int(request.params["channel_id"]), "group_name": request.params["data"]["name"]},
|
|
@@ -259,6 +273,8 @@ def apply(adapter: Adapter, net_getter: Callable[[str], OneBotNetwork], login_ge
|
|
|
259
273
|
@adapter.route(Api.CHANNEL_MUTE)
|
|
260
274
|
async def channel_mute(request: Request[ChannelMuteParam]):
|
|
261
275
|
net = net_getter(request.self_id)
|
|
276
|
+
if request.params["channel_id"].startswith("private:"):
|
|
277
|
+
raise RuntimeError("Cannot mute private channel")
|
|
262
278
|
await net.call_api(
|
|
263
279
|
"set_group_whole_ban",
|
|
264
280
|
{
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|