satori-python-adapter-milky 0.3.0__tar.gz → 0.3.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.
Files changed (18) hide show
  1. {satori_python_adapter_milky-0.3.0 → satori_python_adapter_milky-0.3.2}/.mina/adapter_milky.toml +4 -4
  2. {satori_python_adapter_milky-0.3.0 → satori_python_adapter_milky-0.3.2}/PKG-INFO +6 -6
  3. {satori_python_adapter_milky-0.3.0 → satori_python_adapter_milky-0.3.2}/README.md +2 -2
  4. {satori_python_adapter_milky-0.3.0 → satori_python_adapter_milky-0.3.2}/pyproject.toml +15 -17
  5. {satori_python_adapter_milky-0.3.0 → satori_python_adapter_milky-0.3.2}/src/satori/adapters/milky/base.py +3 -1
  6. {satori_python_adapter_milky-0.3.0 → satori_python_adapter_milky-0.3.2}/src/satori/adapters/milky/message.py +9 -2
  7. {satori_python_adapter_milky-0.3.0 → satori_python_adapter_milky-0.3.2}/LICENSE +0 -0
  8. {satori_python_adapter_milky-0.3.0 → satori_python_adapter_milky-0.3.2}/src/satori/adapters/milky/__init__.py +0 -0
  9. {satori_python_adapter_milky-0.3.0 → satori_python_adapter_milky-0.3.2}/src/satori/adapters/milky/api.py +0 -0
  10. {satori_python_adapter_milky-0.3.0 → satori_python_adapter_milky-0.3.2}/src/satori/adapters/milky/events/__init__.py +0 -0
  11. {satori_python_adapter_milky-0.3.0 → satori_python_adapter_milky-0.3.2}/src/satori/adapters/milky/events/base.py +0 -0
  12. {satori_python_adapter_milky-0.3.0 → satori_python_adapter_milky-0.3.2}/src/satori/adapters/milky/events/group.py +0 -0
  13. {satori_python_adapter_milky-0.3.0 → satori_python_adapter_milky-0.3.2}/src/satori/adapters/milky/events/message.py +0 -0
  14. {satori_python_adapter_milky-0.3.0 → satori_python_adapter_milky-0.3.2}/src/satori/adapters/milky/events/request.py +0 -0
  15. {satori_python_adapter_milky-0.3.0 → satori_python_adapter_milky-0.3.2}/src/satori/adapters/milky/main.py +0 -0
  16. {satori_python_adapter_milky-0.3.0 → satori_python_adapter_milky-0.3.2}/src/satori/adapters/milky/sse.py +0 -0
  17. {satori_python_adapter_milky-0.3.0 → satori_python_adapter_milky-0.3.2}/src/satori/adapters/milky/utils.py +0 -0
  18. {satori_python_adapter_milky-0.3.0 → satori_python_adapter_milky-0.3.2}/src/satori/adapters/milky/webhook.py +0 -0
@@ -1,9 +1,9 @@
1
1
  includes = ["src/satori/adapters/milky"]
2
- raw-dependencies = ["satori-python-server<1.4.0,>= 1.3.0"]
2
+ raw-dependencies = ["satori-python-server<1.4.0,>= 1.3.3"]
3
3
 
4
4
  [project]
5
5
  name = "satori-python-adapter-milky"
6
- version = "0.3.0"
6
+ version = "0.3.2"
7
7
  authors = [
8
8
  {name = "RF-Tar-Railt", email = "rf_tar_railt@qq.com"}
9
9
  ]
@@ -16,11 +16,11 @@ classifiers = [
16
16
  "Typing :: Typed",
17
17
  "Development Status :: 4 - Beta",
18
18
  "License :: OSI Approved :: MIT License",
19
- "Programming Language :: Python :: 3.8",
20
- "Programming Language :: Python :: 3.9",
21
19
  "Programming Language :: Python :: 3.10",
22
20
  "Programming Language :: Python :: 3.11",
23
21
  "Programming Language :: Python :: 3.12",
22
+ "Programming Language :: Python :: 3.13",
23
+ "Programming Language :: Python :: 3.14",
24
24
  "Operating System :: OS Independent",
25
25
  ]
26
26
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: satori-python-adapter-milky
3
- Version: 0.3.0
3
+ Version: 0.3.2
4
4
  Summary: Satori Protocol SDK for python, adapter for Milky
5
5
  Home-page: https://github.com/RF-Tar-Railt/satori-python
6
6
  Author-Email: RF-Tar-Railt <rf_tar_railt@qq.com>
@@ -8,16 +8,16 @@ License: MIT
8
8
  Classifier: Typing :: Typed
9
9
  Classifier: Development Status :: 4 - Beta
10
10
  Classifier: License :: OSI Approved :: MIT License
11
- Classifier: Programming Language :: Python :: 3.8
12
- Classifier: Programming Language :: Python :: 3.9
13
11
  Classifier: Programming Language :: Python :: 3.10
14
12
  Classifier: Programming Language :: Python :: 3.11
15
13
  Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: Programming Language :: Python :: 3.13
15
+ Classifier: Programming Language :: Python :: 3.14
16
16
  Classifier: Operating System :: OS Independent
17
17
  Project-URL: Homepage, https://github.com/RF-Tar-Railt/satori-python
18
18
  Project-URL: Repository, https://github.com/RF-Tar-Railt/satori-python
19
19
  Requires-Python: <4.0,>=3.10
20
- Requires-Dist: satori-python-server<1.4.0,>=1.3.0
20
+ Requires-Dist: satori-python-server<1.4.0,>=1.3.3
21
21
  Description-Content-Type: text/markdown
22
22
 
23
23
  # satori-python
@@ -27,11 +27,11 @@ Description-Content-Type: text/markdown
27
27
  [![PyPI](https://img.shields.io/pypi/v/satori-python)](https://pypi.org/project/satori-python)
28
28
  [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/satori-python)](https://www.python.org/)
29
29
 
30
- 基于 [Satori](https://satori.chat/zh-CN/) 协议的 Python 开发工具包
30
+ 基于 [Satori](https://satori.chat/zh-CN/protocol) 协议的 Python 开发工具包
31
31
 
32
32
  ## 协议介绍
33
33
 
34
- [Satori Protocol](https://satori.chat/zh-CN/)
34
+ [Satori Protocol](https://satori.chat/zh-CN/protocol)
35
35
 
36
36
  ### 协议端
37
37
 
@@ -5,11 +5,11 @@
5
5
  [![PyPI](https://img.shields.io/pypi/v/satori-python)](https://pypi.org/project/satori-python)
6
6
  [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/satori-python)](https://www.python.org/)
7
7
 
8
- 基于 [Satori](https://satori.chat/zh-CN/) 协议的 Python 开发工具包
8
+ 基于 [Satori](https://satori.chat/zh-CN/protocol) 协议的 Python 开发工具包
9
9
 
10
10
  ## 协议介绍
11
11
 
12
- [Satori Protocol](https://satori.chat/zh-CN/)
12
+ [Satori Protocol](https://satori.chat/zh-CN/protocol)
13
13
 
14
14
  ### 协议端
15
15
 
@@ -1,11 +1,11 @@
1
1
  [project]
2
2
  name = "satori-python-adapter-milky"
3
- version = "0.3.0"
3
+ version = "0.3.2"
4
4
  authors = [
5
5
  { name = "RF-Tar-Railt", email = "rf_tar_railt@qq.com" },
6
6
  ]
7
7
  dependencies = [
8
- "satori-python-server<1.4.0,>= 1.3.0",
8
+ "satori-python-server<1.4.0,>= 1.3.3",
9
9
  ]
10
10
  description = "Satori Protocol SDK for python, adapter for Milky"
11
11
  readme = "README.md"
@@ -14,11 +14,11 @@ classifiers = [
14
14
  "Typing :: Typed",
15
15
  "Development Status :: 4 - Beta",
16
16
  "License :: OSI Approved :: MIT License",
17
- "Programming Language :: Python :: 3.8",
18
- "Programming Language :: Python :: 3.9",
19
17
  "Programming Language :: Python :: 3.10",
20
18
  "Programming Language :: Python :: 3.11",
21
19
  "Programming Language :: Python :: 3.12",
20
+ "Programming Language :: Python :: 3.13",
21
+ "Programming Language :: Python :: 3.14",
22
22
  "Operating System :: OS Independent",
23
23
  ]
24
24
 
@@ -38,15 +38,14 @@ build-backend = "mina.backend"
38
38
 
39
39
  [dependency-groups]
40
40
  dev = [
41
- "isort>=5.13.2",
42
- "black>=24.4.0",
43
- "ruff>=0.4.1",
41
+ "black>=26.3.0",
42
+ "ruff>=0.15.1",
44
43
  "pre-commit>=3.7.0",
45
- "fix-future-annotations>=0.5.0",
46
44
  "mina-build<0.6,>=0.5.1",
47
45
  "pdm-mina>=0.3.2",
48
46
  "nonechat<0.7.0,>=0.6.0",
49
47
  "uvicorn[standard]>=0.37.0",
48
+ "pydantic>=2.13.1",
50
49
  ]
51
50
 
52
51
  [tool.pdm.build]
@@ -60,7 +59,7 @@ excludes = [
60
59
 
61
60
  [tool.pdm.scripts.format]
62
61
  composite = [
63
- "isort ./src/ ./example/",
62
+ "ruff check --select I --fix ./src/ ./example/",
64
63
  "black ./src/ ./example/",
65
64
  "ruff check",
66
65
  ]
@@ -74,14 +73,6 @@ line-length = 120
74
73
  include = "\\.pyi?$"
75
74
  extend-exclude = ""
76
75
 
77
- [tool.isort]
78
- profile = "black"
79
- line_length = 120
80
- skip_gitignore = true
81
- extra_standard_library = [
82
- "typing_extensions",
83
- ]
84
-
85
76
  [tool.ruff]
86
77
  line-length = 120
87
78
  target-version = "py310"
@@ -91,6 +82,7 @@ exclude = [
91
82
  "exam2.py",
92
83
  "src/satori/_vendor/*",
93
84
  ]
85
+ respect-gitignore = true
94
86
 
95
87
  [tool.ruff.lint]
96
88
  select = [
@@ -110,6 +102,12 @@ ignore = [
110
102
  "T201",
111
103
  ]
112
104
 
105
+ [tool.ruff.lint.isort]
106
+ extra-standard-library = [
107
+ "typing_extensions",
108
+ ]
109
+ force-sort-within-sections = false
110
+
113
111
  [tool.pyright]
114
112
  pythonPlatform = "All"
115
113
  pythonVersion = "3.10"
@@ -132,7 +132,9 @@ class MilkyBaseAdapter(BaseAdapter, ABC):
132
132
  if not data:
133
133
  return
134
134
  user = decode_login_user(data)
135
- login = Login(0, LoginStatus.ONLINE, "milky", platform="milky", user=user, features=self.features.copy())
135
+ login = Login(
136
+ sn=0, status=LoginStatus.ONLINE, adapter="milky", platform="milky", user=user, features=self.features.copy()
137
+ )
136
138
  self_id = login.id
137
139
  previous = self.logins.get(self_id)
138
140
  self.logins[self_id] = login
@@ -157,8 +157,13 @@ class MilkyMessageEncoder:
157
157
  if poster := attrs.get("poster"):
158
158
  payload["thumb_uri"] = poster
159
159
  self.segments.append({"type": "video", "data": payload})
160
- case "milky:face":
161
- self.segments.append({"type": "face", "data": {"face_id": attrs["id"]}})
160
+ case "milky:face" | "emoji":
161
+ if ":" in attrs["id"]:
162
+ _, emj_id_str = attrs["id"].split(":", 1)
163
+ emj_id = emj_id_str
164
+ else:
165
+ emj_id = attrs["id"]
166
+ self.segments.append({"type": "face", "data": {"face_id": emj_id}})
162
167
  case "file":
163
168
  await self.flush()
164
169
  await self._send_file(attrs)
@@ -362,6 +367,8 @@ async def _decode_segments(net: MilkyNetwork, payload: dict, segments: Sequence[
362
367
  result.append(E.at(str(data.get("user_id"))))
363
368
  case "mention_all":
364
369
  result.append(E.at_all())
370
+ case "face":
371
+ result.append(E.emoji(str(data.get("face_id"))))
365
372
  case "image":
366
373
  result.append(E.image(_resource_url(data)))
367
374
  case "record":