simplematrixbotlib 2.12.2__tar.gz → 2.13.0__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.
- {simplematrixbotlib-2.12.2 → simplematrixbotlib-2.13.0}/PKG-INFO +6 -4
- {simplematrixbotlib-2.12.2 → simplematrixbotlib-2.13.0}/README.md +1 -1
- {simplematrixbotlib-2.12.2 → simplematrixbotlib-2.13.0}/pyproject.toml +2 -2
- {simplematrixbotlib-2.12.2 → simplematrixbotlib-2.13.0}/simplematrixbotlib/api.py +11 -6
- {simplematrixbotlib-2.12.2 → simplematrixbotlib-2.13.0}/simplematrixbotlib/config.py +18 -0
- {simplematrixbotlib-2.12.2 → simplematrixbotlib-2.13.0}/LICENSE +0 -0
- {simplematrixbotlib-2.12.2 → simplematrixbotlib-2.13.0}/simplematrixbotlib/__init__.py +0 -0
- {simplematrixbotlib-2.12.2 → simplematrixbotlib-2.13.0}/simplematrixbotlib/auth.py +0 -0
- {simplematrixbotlib-2.12.2 → simplematrixbotlib-2.13.0}/simplematrixbotlib/bot.py +0 -0
- {simplematrixbotlib-2.12.2 → simplematrixbotlib-2.13.0}/simplematrixbotlib/callbacks.py +0 -0
- {simplematrixbotlib-2.12.2 → simplematrixbotlib-2.13.0}/simplematrixbotlib/listener.py +0 -0
- {simplematrixbotlib-2.12.2 → simplematrixbotlib-2.13.0}/simplematrixbotlib/match.py +0 -0
- {simplematrixbotlib-2.12.2 → simplematrixbotlib-2.13.0}/simplematrixbotlib/py.typed +0 -0
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: simplematrixbotlib
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.13.0
|
|
4
4
|
Summary: An easy to use bot library for the Matrix ecosystem written in Python.
|
|
5
5
|
License: MIT
|
|
6
|
+
License-File: LICENSE
|
|
6
7
|
Keywords: simple,matrix,bot,lib,simple-matrix-bot-lib
|
|
7
8
|
Author: imbev
|
|
8
9
|
Author-email: imbev@protonmail.com
|
|
@@ -15,10 +16,11 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
15
16
|
Classifier: Programming Language :: Python :: 3.11
|
|
16
17
|
Classifier: Programming Language :: Python :: 3.12
|
|
17
18
|
Classifier: Programming Language :: Python :: 3.13
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
18
20
|
Classifier: Topic :: Communications :: Chat
|
|
19
21
|
Classifier: Topic :: Internet
|
|
20
22
|
Requires-Dist: markdown (>=3.3,<4.0)
|
|
21
|
-
Requires-Dist: matrix-nio (>=0.24
|
|
23
|
+
Requires-Dist: matrix-nio (>=0.24)
|
|
22
24
|
Requires-Dist: pillow (>=10.0.1,<11.0.0)
|
|
23
25
|
Requires-Dist: python-cryptography-fernet-wrapper (>=1.0.4,<2.0.0)
|
|
24
26
|
Requires-Dist: toml (>=0.10.2,<0.11.0)
|
|
@@ -28,7 +30,7 @@ Project-URL: Repository, https://codeberg.org/imbev/simplematrixbotlib
|
|
|
28
30
|
Description-Content-Type: text/markdown
|
|
29
31
|
|
|
30
32
|
# Simple-Matrix-Bot-Lib
|
|
31
|
-
(Version 2.12.
|
|
33
|
+
(Version 2.12.3)
|
|
32
34
|
|
|
33
35
|
Simple-Matrix-Bot-Lib is a Python bot library for the Matrix ecosystem built on [matrix-nio](https://github.com/poljar/matrix-nio).
|
|
34
36
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "simplematrixbotlib"
|
|
3
|
-
version = "2.
|
|
3
|
+
version = "2.13.0"
|
|
4
4
|
description = "An easy to use bot library for the Matrix ecosystem written in Python."
|
|
5
5
|
authors = ["imbev <imbev@protonmail.com>"]
|
|
6
6
|
license = "MIT"
|
|
@@ -20,7 +20,7 @@ classifiers = [
|
|
|
20
20
|
|
|
21
21
|
[tool.poetry.dependencies]
|
|
22
22
|
python = "^3.9"
|
|
23
|
-
matrix-nio = "
|
|
23
|
+
matrix-nio = ">=0.24"
|
|
24
24
|
python-cryptography-fernet-wrapper = "^1.0.4"
|
|
25
25
|
pillow = "^10.0.1"
|
|
26
26
|
markdown = "^3.3"
|
|
@@ -92,8 +92,8 @@ class Api:
|
|
|
92
92
|
)
|
|
93
93
|
|
|
94
94
|
client_config = AsyncClientConfig(
|
|
95
|
-
max_limit_exceeded=
|
|
96
|
-
max_timeouts=
|
|
95
|
+
max_limit_exceeded=self.config.max_limit_exceeded,
|
|
96
|
+
max_timeouts=self.config.max_timeouts,
|
|
97
97
|
store_sync_tokens=True,
|
|
98
98
|
encryption_enabled=self.config.encryption_enabled)
|
|
99
99
|
store_path = self.config.store_path
|
|
@@ -314,7 +314,7 @@ class Api:
|
|
|
314
314
|
|
|
315
315
|
await self._send_room(room_id=room_id, content=content)
|
|
316
316
|
|
|
317
|
-
async def send_reaction(self, room_id: str, event, key: str):
|
|
317
|
+
async def send_reaction(self, room_id: str, event: str | nio.events.room_events.Event, key: str):
|
|
318
318
|
"""
|
|
319
319
|
Send a reaction to a message in a Matrix room.
|
|
320
320
|
|
|
@@ -323,18 +323,23 @@ class Api:
|
|
|
323
323
|
room_id : str
|
|
324
324
|
The room id of the destination of the message.
|
|
325
325
|
|
|
326
|
-
event :
|
|
327
|
-
The event object you want to react to.
|
|
326
|
+
event : str | nio.events.room_events.Event
|
|
327
|
+
The event object or its event id you want to react to.
|
|
328
328
|
|
|
329
329
|
key: str
|
|
330
330
|
The content of the reaction. This is usually an emoji, but may technically be any text.
|
|
331
331
|
"""
|
|
332
332
|
|
|
333
|
+
if isinstance(event, nio.events.room_events.Event):
|
|
334
|
+
event_id = event.event_id
|
|
335
|
+
else:
|
|
336
|
+
event_id = event
|
|
337
|
+
|
|
333
338
|
await self._send_room(
|
|
334
339
|
room_id=room_id,
|
|
335
340
|
content={
|
|
336
341
|
"m.relates_to": {
|
|
337
|
-
"event_id":
|
|
342
|
+
"event_id": event_id,
|
|
338
343
|
"key": key,
|
|
339
344
|
"rel_type": "m.annotation"
|
|
340
345
|
}
|
|
@@ -64,6 +64,8 @@ class Config:
|
|
|
64
64
|
_decrypt_failure_msg = True
|
|
65
65
|
_set_presence="online"
|
|
66
66
|
_first_sync_full: bool = False
|
|
67
|
+
_max_limit_exceeded: int = 0
|
|
68
|
+
_max_timeouts: int = 0
|
|
67
69
|
|
|
68
70
|
def _load_config_dict(self, config_dict: dict) -> None:
|
|
69
71
|
# TODO: make this into a factory, so defaults for
|
|
@@ -86,6 +88,22 @@ class Config:
|
|
|
86
88
|
with open(file_path, 'w') as file:
|
|
87
89
|
toml.dump(tmp, file)
|
|
88
90
|
|
|
91
|
+
@property
|
|
92
|
+
def max_limit_exceeded(self) -> int:
|
|
93
|
+
return self._max_limit_exceeded
|
|
94
|
+
|
|
95
|
+
@max_limit_exceeded.setter
|
|
96
|
+
def max_limit_exceeded(self, value: int) -> None:
|
|
97
|
+
self._max_limit_exceeded = value
|
|
98
|
+
|
|
99
|
+
@property
|
|
100
|
+
def max_timeouts(self) -> int:
|
|
101
|
+
return self._max_timeouts
|
|
102
|
+
|
|
103
|
+
@max_timeouts.setter
|
|
104
|
+
def max_timeouts(self, value: int) -> None:
|
|
105
|
+
self._max_timeouts = value
|
|
106
|
+
|
|
89
107
|
@property
|
|
90
108
|
def timeout(self) -> int:
|
|
91
109
|
"""
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|