mm-telegram 0.1.0__py3-none-any.whl → 0.1.1__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/simple_message.py
CHANGED
@@ -12,20 +12,20 @@ async def send_message(bot_token: str, chat_id: int, message: str, long_message_
|
|
12
12
|
params = {"chat_id": chat_id, "text": text}
|
13
13
|
res = await http_request(f"https://api.telegram.org/bot{bot_token}/sendMessage", method="post", json=params)
|
14
14
|
responses.append(res.to_dict())
|
15
|
-
if res.
|
16
|
-
return Result.
|
15
|
+
if res.is_err():
|
16
|
+
return Result.err(res.error or "error", extra={"responses": [responses]})
|
17
17
|
|
18
18
|
message_id = res.parse_json_body("result.message_id", none_on_error=True)
|
19
19
|
if message_id:
|
20
20
|
result.append(message_id)
|
21
21
|
else:
|
22
|
-
return Result.
|
22
|
+
return Result.err("unknown_response", extra={"responses": responses})
|
23
23
|
|
24
24
|
if len(messages):
|
25
25
|
await asyncio.sleep(long_message_delay)
|
26
26
|
else:
|
27
27
|
break
|
28
|
-
return Result.
|
28
|
+
return Result.ok(result, extra={"responses": responses})
|
29
29
|
|
30
30
|
|
31
31
|
def _split_string(text: str, chars_per_string: int) -> list[str]:
|
@@ -0,0 +1,6 @@
|
|
1
|
+
mm_telegram/__init__.py,sha256=Nl5I50id12u28Q0H_uHziyd2t_bjySeZAH1etBOVW3A,57
|
2
|
+
mm_telegram/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
3
|
+
mm_telegram/simple_message.py,sha256=fT0zhmUPqq_w2EvTdOKLC0JhVMh3nZmthApY8dmY_fk,1193
|
4
|
+
mm_telegram-0.1.1.dist-info/METADATA,sha256=8Iusxz_r-QCJMu7dN8BNW9VN2EFNUZBxO3G0NwNYnEc,108
|
5
|
+
mm_telegram-0.1.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
6
|
+
mm_telegram-0.1.1.dist-info/RECORD,,
|
@@ -1,6 +0,0 @@
|
|
1
|
-
mm_telegram/__init__.py,sha256=Nl5I50id12u28Q0H_uHziyd2t_bjySeZAH1etBOVW3A,57
|
2
|
-
mm_telegram/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
3
|
-
mm_telegram/simple_message.py,sha256=35wIa-37IFIxsaPnL01nrHyHznjHlAve7uM5787uC58,1208
|
4
|
-
mm_telegram-0.1.0.dist-info/METADATA,sha256=2wHZugcf1Qf7R-piYNQZuxQpRAa1qGXiqeKNkF5EQRI,108
|
5
|
-
mm_telegram-0.1.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
6
|
-
mm_telegram-0.1.0.dist-info/RECORD,,
|
File without changes
|