satori-python-client 0.9.1__tar.gz → 0.9.2__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_client-0.9.1 → satori_python_client-0.9.2}/.mina/client.toml +1 -1
- {satori_python_client-0.9.1 → satori_python_client-0.9.2}/PKG-INFO +2 -2
- {satori_python_client-0.9.1 → satori_python_client-0.9.2}/pyproject.toml +2 -2
- {satori_python_client-0.9.1 → satori_python_client-0.9.2}/src/satori/client/account.pyi +7 -7
- {satori_python_client-0.9.1 → satori_python_client-0.9.2}/src/satori/client/session.py +10 -10
- {satori_python_client-0.9.1 → satori_python_client-0.9.2}/LICENSE +0 -0
- {satori_python_client-0.9.1 → satori_python_client-0.9.2}/README.md +0 -0
- {satori_python_client-0.9.1 → satori_python_client-0.9.2}/src/satori/client/__init__.py +0 -0
- {satori_python_client-0.9.1 → satori_python_client-0.9.2}/src/satori/client/account.py +0 -0
- {satori_python_client-0.9.1 → satori_python_client-0.9.2}/src/satori/client/network/__init__.py +0 -0
- {satori_python_client-0.9.1 → satori_python_client-0.9.2}/src/satori/client/network/base.py +0 -0
- {satori_python_client-0.9.1 → satori_python_client-0.9.2}/src/satori/client/network/webhook.py +0 -0
- {satori_python_client-0.9.1 → satori_python_client-0.9.2}/src/satori/client/network/websocket.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: satori-python-client
|
|
3
|
-
Version: 0.9.
|
|
3
|
+
Version: 0.9.2
|
|
4
4
|
Summary: Satori Protocol SDK for python, specify client part
|
|
5
5
|
Home-page: https://github.com/RF-Tar-Railt/satori-python
|
|
6
6
|
Author-Email: RF-Tar-Railt <rf_tar_railt@qq.com>
|
|
@@ -19,7 +19,7 @@ Project-URL: Repository, https://github.com/RF-Tar-Railt/satori-python
|
|
|
19
19
|
Requires-Python: >=3.8
|
|
20
20
|
Requires-Dist: aiohttp>=3.8.6
|
|
21
21
|
Requires-Dist: launart>=0.8.2
|
|
22
|
-
Requires-Dist: satori-python-core>=0.9.
|
|
22
|
+
Requires-Dist: satori-python-core>=0.9.2
|
|
23
23
|
Description-Content-Type: text/markdown
|
|
24
24
|
|
|
25
25
|
# satori-python
|
|
@@ -7,7 +7,7 @@ authors = [
|
|
|
7
7
|
dependencies = [
|
|
8
8
|
"aiohttp>=3.8.6",
|
|
9
9
|
"launart>=0.8.2",
|
|
10
|
-
"satori-python-core >= 0.9.
|
|
10
|
+
"satori-python-core >= 0.9.2",
|
|
11
11
|
]
|
|
12
12
|
description = "Satori Protocol SDK for python, specify client part"
|
|
13
13
|
readme = "README.md"
|
|
@@ -23,7 +23,7 @@ classifiers = [
|
|
|
23
23
|
"Programming Language :: Python :: 3.12",
|
|
24
24
|
"Operating System :: OS Independent",
|
|
25
25
|
]
|
|
26
|
-
version = "0.9.
|
|
26
|
+
version = "0.9.2"
|
|
27
27
|
|
|
28
28
|
[project.license]
|
|
29
29
|
text = "MIT"
|
|
@@ -4,7 +4,7 @@ from typing import Any, Iterable, Protocol, overload
|
|
|
4
4
|
from yarl import URL
|
|
5
5
|
|
|
6
6
|
from satori.element import Element
|
|
7
|
-
from satori.model import Channel, Event, Guild, Login, Member,
|
|
7
|
+
from satori.model import Channel, Event, Guild, Login, Member, MessageObject, PageResult, Role, User
|
|
8
8
|
|
|
9
9
|
from .session import Session
|
|
10
10
|
|
|
@@ -38,12 +38,12 @@ class Account:
|
|
|
38
38
|
event: Event,
|
|
39
39
|
message: str | Iterable[str | Element],
|
|
40
40
|
**kwargs,
|
|
41
|
-
) -> list[
|
|
41
|
+
) -> list[MessageObject]: ...
|
|
42
42
|
async def send_message(
|
|
43
43
|
self,
|
|
44
44
|
channel_id: str,
|
|
45
45
|
message: str | Iterable[str | Element],
|
|
46
|
-
) -> list[
|
|
46
|
+
) -> list[MessageObject]:
|
|
47
47
|
"""发送消息
|
|
48
48
|
|
|
49
49
|
参数:
|
|
@@ -55,7 +55,7 @@ class Account:
|
|
|
55
55
|
self,
|
|
56
56
|
user_id: str,
|
|
57
57
|
message: str | Iterable[str | Element],
|
|
58
|
-
) -> list[
|
|
58
|
+
) -> list[MessageObject]:
|
|
59
59
|
"""发送私聊消息
|
|
60
60
|
|
|
61
61
|
参数:
|
|
@@ -82,8 +82,8 @@ class Account:
|
|
|
82
82
|
*,
|
|
83
83
|
channel_id: str,
|
|
84
84
|
content: str,
|
|
85
|
-
) -> list[
|
|
86
|
-
async def message_get(self, *, channel_id: str, message_id: str) ->
|
|
85
|
+
) -> list[MessageObject]: ...
|
|
86
|
+
async def message_get(self, *, channel_id: str, message_id: str) -> MessageObject: ...
|
|
87
87
|
async def message_delete(self, *, channel_id: str, message_id: str) -> None: ...
|
|
88
88
|
async def message_update(
|
|
89
89
|
self,
|
|
@@ -94,7 +94,7 @@ class Account:
|
|
|
94
94
|
) -> None: ...
|
|
95
95
|
async def message_list(
|
|
96
96
|
self, *, channel_id: str, next_token: str | None = None
|
|
97
|
-
) -> PageResult[
|
|
97
|
+
) -> PageResult[MessageObject]: ...
|
|
98
98
|
async def channel_get(self, *, channel_id: str) -> Channel: ...
|
|
99
99
|
async def channel_list(self, *, guild_id: str, next_token: str | None = None) -> PageResult[Channel]: ...
|
|
100
100
|
async def channel_create(self, *, guild_id: str, data: Channel) -> Channel: ...
|
|
@@ -15,7 +15,7 @@ from satori.exception import (
|
|
|
15
15
|
NotFoundException,
|
|
16
16
|
UnauthorizedException,
|
|
17
17
|
)
|
|
18
|
-
from satori.model import Channel, Event, Guild, Login, Member,
|
|
18
|
+
from satori.model import Channel, Event, Guild, Login, Member, MessageObject, PageResult, Role, User
|
|
19
19
|
|
|
20
20
|
if TYPE_CHECKING:
|
|
21
21
|
from .account import Account
|
|
@@ -61,7 +61,7 @@ class Session:
|
|
|
61
61
|
self,
|
|
62
62
|
event: Event,
|
|
63
63
|
message: str | Iterable[str | Element],
|
|
64
|
-
) -> list[
|
|
64
|
+
) -> list[MessageObject]:
|
|
65
65
|
if not event.channel:
|
|
66
66
|
raise RuntimeError("Event cannot be replied to!")
|
|
67
67
|
return await self.send_message(event.channel.id, message)
|
|
@@ -70,7 +70,7 @@ class Session:
|
|
|
70
70
|
self,
|
|
71
71
|
channel: str | Channel,
|
|
72
72
|
message: str | Iterable[str | Element],
|
|
73
|
-
) -> list[
|
|
73
|
+
) -> list[MessageObject]:
|
|
74
74
|
"""发送消息
|
|
75
75
|
|
|
76
76
|
参数:
|
|
@@ -85,7 +85,7 @@ class Session:
|
|
|
85
85
|
self,
|
|
86
86
|
user: str | User,
|
|
87
87
|
message: str | Iterable[str | Element],
|
|
88
|
-
) -> list[
|
|
88
|
+
) -> list[MessageObject]:
|
|
89
89
|
"""发送私聊消息
|
|
90
90
|
|
|
91
91
|
参数:
|
|
@@ -121,20 +121,20 @@ class Session:
|
|
|
121
121
|
self,
|
|
122
122
|
channel_id: str,
|
|
123
123
|
content: str,
|
|
124
|
-
) -> list[
|
|
124
|
+
) -> list[MessageObject]:
|
|
125
125
|
res = await self.call_api(
|
|
126
126
|
Api.MESSAGE_CREATE,
|
|
127
127
|
{"channel_id": channel_id, "content": content},
|
|
128
128
|
)
|
|
129
129
|
res = cast(List[dict], res)
|
|
130
|
-
return [
|
|
130
|
+
return [MessageObject.parse(i) for i in res]
|
|
131
131
|
|
|
132
|
-
async def message_get(self, channel_id: str, message_id: str) ->
|
|
132
|
+
async def message_get(self, channel_id: str, message_id: str) -> MessageObject:
|
|
133
133
|
res = await self.call_api(
|
|
134
134
|
Api.MESSAGE_GET,
|
|
135
135
|
{"channel_id": channel_id, "message_id": message_id},
|
|
136
136
|
)
|
|
137
|
-
return
|
|
137
|
+
return MessageObject.parse(res)
|
|
138
138
|
|
|
139
139
|
async def message_delete(self, channel_id: str, message_id: str) -> None:
|
|
140
140
|
await self.call_api(
|
|
@@ -153,12 +153,12 @@ class Session:
|
|
|
153
153
|
{"channel_id": channel_id, "message_id": message_id, "content": content},
|
|
154
154
|
)
|
|
155
155
|
|
|
156
|
-
async def message_list(self, channel_id: str, next_token: str | None = None) -> PageResult[
|
|
156
|
+
async def message_list(self, channel_id: str, next_token: str | None = None) -> PageResult[MessageObject]:
|
|
157
157
|
res = await self.call_api(
|
|
158
158
|
Api.MESSAGE_LIST,
|
|
159
159
|
{"channel_id": channel_id, "next": next_token},
|
|
160
160
|
)
|
|
161
|
-
return PageResult.parse(res,
|
|
161
|
+
return PageResult.parse(res, MessageObject.parse)
|
|
162
162
|
|
|
163
163
|
async def channel_get(self, channel_id: str) -> Channel:
|
|
164
164
|
res = await self.call_api(
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{satori_python_client-0.9.1 → satori_python_client-0.9.2}/src/satori/client/network/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{satori_python_client-0.9.1 → satori_python_client-0.9.2}/src/satori/client/network/webhook.py
RENAMED
|
File without changes
|
{satori_python_client-0.9.1 → satori_python_client-0.9.2}/src/satori/client/network/websocket.py
RENAMED
|
File without changes
|