maxapi-python 1.1.7__py3-none-any.whl → 1.1.8__py3-none-any.whl
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.
- {maxapi_python-1.1.7.dist-info → maxapi_python-1.1.8.dist-info}/METADATA +10 -4
- {maxapi_python-1.1.7.dist-info → maxapi_python-1.1.8.dist-info}/RECORD +7 -7
- pymax/files.py +1 -1
- pymax/static.py +1 -0
- pymax/types.py +29 -1
- {maxapi_python-1.1.7.dist-info → maxapi_python-1.1.8.dist-info}/WHEEL +0 -0
- {maxapi_python-1.1.7.dist-info → maxapi_python-1.1.8.dist-info}/licenses/LICENSE +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: maxapi-python
|
3
|
-
Version: 1.1.
|
3
|
+
Version: 1.1.8
|
4
4
|
Summary: Python wrapper для API мессенджера Max
|
5
5
|
Project-URL: Homepage, https://github.com/noxzion/PyMax
|
6
6
|
Project-URL: Repository, https://github.com/noxzion/PyMax
|
@@ -157,7 +157,13 @@ if __name__ == "__main__":
|
|
157
157
|
|
158
158
|
## Авторы
|
159
159
|
|
160
|
-
- **[noxzion](https://github.com/noxzion)** —
|
161
|
-
- **[ink](https://github.com/ink-developer)** —
|
162
|
-
- **[fresh-milkshake](https://github.com/fresh-milkshake)** — контрибьютор и автор лого
|
160
|
+
- **[noxzion](https://github.com/noxzion)** — Оригинальный автор проекта
|
161
|
+
- **[ink](https://github.com/ink-developer)** — Главный разработчик, исследование API и его документация
|
163
162
|
|
163
|
+
## Контрибьюторы
|
164
|
+
|
165
|
+
Спасибо всем за помощь в разработке!
|
166
|
+
|
167
|
+
<a href="https://github.com/ink-developer/PyMax/graphs/contributors">
|
168
|
+
<img src="https://contrib.rocks/image?repo=ink-developer/PyMax" />
|
169
|
+
</a>
|
@@ -2,14 +2,14 @@ pymax/__init__.py,sha256=Wu5eniruWbotDUHBymdAyDNzt4g40r7Lb2pb9usQgjU,939
|
|
2
2
|
pymax/core.py,sha256=6fqnP-eAgbUTM6F0Kj09TPJ3IOgvkHz5EsjJTI18r5A,7813
|
3
3
|
pymax/crud.py,sha256=Mk-c87GItS91BlJu6INDbw1-ovXyoB2D9rXHK8voxpU,3207
|
4
4
|
pymax/exceptions.py,sha256=msS11MD7qZPm0qZ6O8fobTm-GTldm2IA3uQLTX6eDxc,919
|
5
|
-
pymax/files.py,sha256=
|
5
|
+
pymax/files.py,sha256=BVeJYfppbv4jb5C6inI08eY0WyJ0b45VXHTEKnnu0Zs,2660
|
6
6
|
pymax/filters.py,sha256=fxC3Bl5AqrB8BSdN-CtiLWucbHCRA2IODpsOy2NagGU,1471
|
7
7
|
pymax/interfaces.py,sha256=_D6iMQI74Gdtl6-HMoE1acRFRHeITgOZPVFpt5pvoow,2394
|
8
8
|
pymax/models.py,sha256=PsPGbOkERxesZZltjNrmqhOfRcO44Is2ThbEToREcB8,201
|
9
9
|
pymax/navigation.py,sha256=16c1_FZrw24uFlP6W5-F8OrEQE73bkQA3HSFqTdBtgo,5725
|
10
10
|
pymax/payloads.py,sha256=494RYjE3AjRbIrme1hcb2q5WNNcoZF13elqJeSVOW0Q,4158
|
11
|
-
pymax/static.py,sha256=
|
12
|
-
pymax/types.py,sha256=
|
11
|
+
pymax/static.py,sha256=8_2p5RNOl4LLDGVpoHqNa465zCJFcajKL-8d6FHI75w,4762
|
12
|
+
pymax/types.py,sha256=13QNTeiR0VsaMJerk5m1aH6hEnccvw8ydb8W3eYKNnk,20016
|
13
13
|
pymax/utils.py,sha256=F2TdoWfSwDLeh2uIcMIE_GTdXd7hU7gWti2i5P727bA,1364
|
14
14
|
pymax/mixins/__init__.py,sha256=-PSMwTVioS-VTy-EGfV-epaKFLy58R4N2b-rX6wJf-M,649
|
15
15
|
pymax/mixins/auth.py,sha256=vTNSZ6AunvDIMPQAvgYozpIZaCWMYiMDiabCBI7Sm6c,3079
|
@@ -22,7 +22,7 @@ pymax/mixins/socket.py,sha256=UNMU1Fh9J3xDV76J2Mx8bVHXo0gcS81qocOw8MM0XXs,15643
|
|
22
22
|
pymax/mixins/telemetry.py,sha256=0sQl6kvFVxobLthNAPNS9LzMrwwzZFA1xmOnvfiHWos,3522
|
23
23
|
pymax/mixins/user.py,sha256=VgAylqEeWMzgPaScakozZ1Wx0NwEnwVJLt1DtUbWaoM,4276
|
24
24
|
pymax/mixins/websocket.py,sha256=L958bXTYh6U89jnmd0VWIUVtmJweUVFOMqjEuH8jWGo,10079
|
25
|
-
maxapi_python-1.1.
|
26
|
-
maxapi_python-1.1.
|
27
|
-
maxapi_python-1.1.
|
28
|
-
maxapi_python-1.1.
|
25
|
+
maxapi_python-1.1.8.dist-info/METADATA,sha256=sq5nF0jGxbf-unNhIOGav1MB0vhGCL-7_p68Tlm5PnU,6063
|
26
|
+
maxapi_python-1.1.8.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
27
|
+
maxapi_python-1.1.8.dist-info/licenses/LICENSE,sha256=oe-AGp86WMKawV4KmqF28Q0m-kGAhPfAOPrEUm4MnVw,1064
|
28
|
+
maxapi_python-1.1.8.dist-info/RECORD,,
|
pymax/files.py
CHANGED
@@ -56,7 +56,7 @@ class Photo(BaseFile):
|
|
56
56
|
return (extension[1:], ("image/" + extension[1:]).lower())
|
57
57
|
elif self.url:
|
58
58
|
extension = Path(self.url).suffix.lower()
|
59
|
-
if extension in self.ALLOWED_EXTENSIONS:
|
59
|
+
if extension not in self.ALLOWED_EXTENSIONS:
|
60
60
|
raise ValueError(
|
61
61
|
f"Invalid photo extension in URL: {extension}. Allowed: {self.ALLOWED_EXTENSIONS}"
|
62
62
|
)
|
pymax/static.py
CHANGED
pymax/types.py
CHANGED
@@ -39,6 +39,32 @@ class Names:
|
|
39
39
|
return self.name
|
40
40
|
|
41
41
|
|
42
|
+
class ControlAttach:
|
43
|
+
def __init__(self, type: AttachType, event: str, **kwargs: dict[str, Any]) -> None:
|
44
|
+
self.type = type
|
45
|
+
self.event = event
|
46
|
+
self.extra = kwargs
|
47
|
+
|
48
|
+
@classmethod
|
49
|
+
def from_dict(cls, data: dict[str, Any]) -> "ControlAttach":
|
50
|
+
data = dict(data)
|
51
|
+
attach_type = AttachType(data.pop("_type"))
|
52
|
+
event = data.pop("event")
|
53
|
+
return cls(
|
54
|
+
type=attach_type,
|
55
|
+
event=event,
|
56
|
+
**data,
|
57
|
+
)
|
58
|
+
|
59
|
+
@override
|
60
|
+
def __repr__(self) -> str:
|
61
|
+
return f"ControlAttach(type={self.type!r}, event={self.event!r}, extra={self.extra!r})"
|
62
|
+
|
63
|
+
@override
|
64
|
+
def __str__(self) -> str:
|
65
|
+
return f"ControlAttach: {self.event}"
|
66
|
+
|
67
|
+
|
42
68
|
class PhotoAttach:
|
43
69
|
def __init__(
|
44
70
|
self,
|
@@ -281,7 +307,7 @@ class Message:
|
|
281
307
|
text: str,
|
282
308
|
status: MessageStatus | str | None,
|
283
309
|
type: MessageType | str,
|
284
|
-
attaches: list[PhotoAttach | VideoAttach | FileAttach],
|
310
|
+
attaches: list[PhotoAttach | VideoAttach | FileAttach | ControlAttach] | None,
|
285
311
|
) -> None:
|
286
312
|
self.chat_id = chat_id
|
287
313
|
self.sender = sender
|
@@ -306,6 +332,8 @@ class Message:
|
|
306
332
|
attaches.append(VideoAttach.from_dict(a))
|
307
333
|
elif a["_type"] == AttachType.FILE:
|
308
334
|
attaches.append(FileAttach.from_dict(a))
|
335
|
+
elif a["_type"] == AttachType.CONTROL:
|
336
|
+
attaches.append(ControlAttach.from_dict(a))
|
309
337
|
return cls(
|
310
338
|
chat_id=data.get("chatId"),
|
311
339
|
sender=message.get("sender"),
|
File without changes
|
File without changes
|