` the Bot.
@@ -3930,7 +3928,7 @@ async def get_file(
api_kwargs=api_kwargs,
)
- file_path = cast("dict", result).get("file_path")
+ file_path = cast(dict, result).get("file_path")
if file_path and not is_local_file(file_path):
result["file_path"] = f"{self._base_file_url}/{file_path}"
@@ -4593,7 +4591,7 @@ async def get_updates(
# waiting for the server to return and there's no way of knowing the connection had been
# dropped in real time.
result = cast(
- "list[JSONDict]",
+ list[JSONDict],
await self._post(
"getUpdates",
data,
diff --git a/telegram/ext/_extbot.py b/telegram/ext/_extbot.py
index a3b437b3fa1..49308bc1534 100644
--- a/telegram/ext/_extbot.py
+++ b/telegram/ext/_extbot.py
@@ -253,7 +253,7 @@ def __init__(
return
if not isinstance(arbitrary_callback_data, bool):
- maxsize = cast("int", arbitrary_callback_data)
+ maxsize = cast(int, arbitrary_callback_data)
else:
maxsize = 1024
From bb82a546b8cc9bb7cdaaa5121a033cf745d8cd9f Mon Sep 17 00:00:00 2001
From: Hinrich Mahler <22366557+Bibo-Joshi@users.noreply.github.com>
Date: Mon, 14 Apr 2025 21:57:52 +0200
Subject: [PATCH 5/8] update chango fragments
---
changes/unreleased/4756.JT5nmUmGRG6qDEh5ScMn5f.toml | 4 ++++
changes/unreleased/4757.GsMGs86c9aGvTR75rnBYHV.toml | 5 -----
2 files changed, 4 insertions(+), 5 deletions(-)
delete mode 100644 changes/unreleased/4757.GsMGs86c9aGvTR75rnBYHV.toml
diff --git a/changes/unreleased/4756.JT5nmUmGRG6qDEh5ScMn5f.toml b/changes/unreleased/4756.JT5nmUmGRG6qDEh5ScMn5f.toml
index d7da32f643c..219c3412640 100644
--- a/changes/unreleased/4756.JT5nmUmGRG6qDEh5ScMn5f.toml
+++ b/changes/unreleased/4756.JT5nmUmGRG6qDEh5ScMn5f.toml
@@ -3,3 +3,7 @@ features = "Full Support for Bot API 9.0"
uid = "4756"
author_uid = "Bibo-Joshi"
closes_threads = ["4754"]
+[[pull_requests]]
+uid = "4757"
+author_uid = "Bibo-Joshi"
+closes_threads = []
diff --git a/changes/unreleased/4757.GsMGs86c9aGvTR75rnBYHV.toml b/changes/unreleased/4757.GsMGs86c9aGvTR75rnBYHV.toml
deleted file mode 100644
index 83801dce428..00000000000
--- a/changes/unreleased/4757.GsMGs86c9aGvTR75rnBYHV.toml
+++ /dev/null
@@ -1,5 +0,0 @@
-features = "Api 9.0 business methods"
-[[pull_requests]]
-uid = "4757"
-author_uid = "Bibo-Joshi"
-closes_threads = []
From 69bd6eb4f94177f205e4952b54220ae563a2885f Mon Sep 17 00:00:00 2001
From: Hinrich Mahler <22366557+Bibo-Joshi@users.noreply.github.com>
Date: Mon, 14 Apr 2025 22:05:38 +0200
Subject: [PATCH 6/8] Fix tests
---
telegram/_bot.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/telegram/_bot.py b/telegram/_bot.py
index e8a06bcc32a..6e706ce0953 100644
--- a/telegram/_bot.py
+++ b/telegram/_bot.py
@@ -9484,7 +9484,7 @@ async def delete_business_messages(
"""
data: JSONDict = {
"business_connection_id": business_connection_id,
- "message_ids": parse_sequence_arg(message_ids),
+ "message_ids": message_ids,
}
return await self._post(
"deleteBusinessMessages",
From 55c28b59d366563651abf830491f7521e5dba82b Mon Sep 17 00:00:00 2001
From: Bibo-Joshi <22366557+Bibo-Joshi@users.noreply.github.com>
Date: Wed, 16 Apr 2025 16:30:21 +0200
Subject: [PATCH 7/8] explicitly cast time Delta to seconds
Co-authored-by: Abdelrahman Elkheir <90580077+aelkheir@users.noreply.github.com>
---
telegram/constants.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/telegram/constants.py b/telegram/constants.py
index a2b15c41efd..b7e98462fac 100644
--- a/telegram/constants.py
+++ b/telegram/constants.py
@@ -712,7 +712,7 @@ class BusinessLimit(IntEnum):
__slots__ = ()
- READ_BUSINESS_MESSAGE_ACTIVITY_TIMEOUT = dtm.timedelta(hours=24).total_seconds()
+ READ_BUSINESS_MESSAGE_ACTIVITY_TIMEOUT = int(dtm.timedelta(hours=24).total_seconds())
""":obj:`int`: Time in seconds in which the chat must have been active for
:meth:`~telegram.Bot.read_business_message` to work.
"""
From eb108975f1534bf1504c6b9ba09ad7e5a1b2a35f Mon Sep 17 00:00:00 2001
From: Hinrich Mahler <22366557+Bibo-Joshi@users.noreply.github.com>
Date: Wed, 16 Apr 2025 17:30:19 +0200
Subject: [PATCH 8/8] add missing assertion in
`test_instance_method_read_business_message`
---
tests/test_chat.py | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/tests/test_chat.py b/tests/test_chat.py
index 0f1dfeaa072..c241b080392 100644
--- a/tests/test_chat.py
+++ b/tests/test_chat.py
@@ -1400,6 +1400,11 @@ async def make_assertion(*_, **kwargs):
)
assert await check_defaults_handling(chat.read_business_message, chat.get_bot())
+ monkeypatch.setattr(chat.get_bot(), "read_business_message", make_assertion)
+ assert await chat.read_business_message(
+ message_id="message_id", business_connection_id="business_connection_id"
+ )
+
def test_mention_html(self):
chat = Chat(id=1, type="foo")
with pytest.raises(TypeError, match="Can not create a mention to a private group chat"):
pFad - Phonifier reborn
Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies:
Alternative Proxy
pFad Proxy
pFad v3 Proxy
pFad v4 Proxy