mm-telegram 0.0.1__py3-none-any.whl → 0.0.3__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.
mm_telegram/py.typed
ADDED
File without changes
|
mm_telegram/simple_message.py
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
import time
|
2
2
|
|
3
3
|
import pydash
|
4
|
-
from mm_std import Err, Ok, Result
|
5
|
-
from mm_std.net import hrequest
|
4
|
+
from mm_std import Err, Ok, Result, hr
|
6
5
|
|
7
6
|
|
8
7
|
def send_telegram_message(bot_token: str, chat_id: int, message: str, long_message_delay: int = 3) -> Result[list[int]]:
|
@@ -12,7 +11,7 @@ def send_telegram_message(bot_token: str, chat_id: int, message: str, long_messa
|
|
12
11
|
while True:
|
13
12
|
text = messages.pop(0)
|
14
13
|
params = {"chat_id": chat_id, "text": text}
|
15
|
-
res =
|
14
|
+
res = hr(f"https://api.telegram.org/bot{bot_token}/sendMessage", method="post", params=params)
|
16
15
|
responses.append(res.json)
|
17
16
|
if res.error is not None:
|
18
17
|
return Err(res.error, data={"last_res": res.to_dict(), "responses": responses})
|
@@ -0,0 +1,6 @@
|
|
1
|
+
mm_telegram/__init__.py,sha256=5Q9z-kyvLHgp70L4aChMy2fsVwn_2hRqqE_-tbl99Us,75
|
2
|
+
mm_telegram/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
3
|
+
mm_telegram/simple_message.py,sha256=lwbB5TgI726cy_Fl4y-FvOwokp7KoHhDazY-quGeIfs,1185
|
4
|
+
mm_telegram-0.0.3.dist-info/METADATA,sha256=smfzjmZv1YIXXYzQHE1AxeXsc4f7McWcZ3vR1_NkGvY,109
|
5
|
+
mm_telegram-0.0.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
6
|
+
mm_telegram-0.0.3.dist-info/RECORD,,
|
@@ -1,5 +0,0 @@
|
|
1
|
-
mm_telegram/__init__.py,sha256=5Q9z-kyvLHgp70L4aChMy2fsVwn_2hRqqE_-tbl99Us,75
|
2
|
-
mm_telegram/simple_message.py,sha256=E7psm927DUay9Qh0K4P_BXXHvukhVR5-qJGqeUZYHHI,1219
|
3
|
-
mm_telegram-0.0.1.dist-info/METADATA,sha256=OQ-jpwE28FFMk92aAFAnZzVO6hfHQpwPmq7QmEAj8MA,108
|
4
|
-
mm_telegram-0.0.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
5
|
-
mm_telegram-0.0.1.dist-info/RECORD,,
|
File without changes
|