From 1100425233778abbda6daf1d2d0b9b4631ec00cb Mon Sep 17 00:00:00 2001 From: Anna Date: Wed, 19 Nov 2025 09:55:17 +0300 Subject: [PATCH 1/6] SDK-40 --- examples/full.py | 6 ++++-- requirements.txt | 2 +- setup.py | 4 ++-- whatsapp_chatbot_python/manager/handler.py | 20 ++++++++++++-------- 4 files changed, 19 insertions(+), 13 deletions(-) diff --git a/examples/full.py b/examples/full.py index 3693f1a..87906a7 100644 --- a/examples/full.py +++ b/examples/full.py @@ -27,7 +27,7 @@ def message_handler(notification: Notification) -> None: @bot.router.message(text_message=["1", "Report a problem"]) def report_problem_handler(notification: Notification) -> None: notification.answer( - "https://github.com/green-api/issues/issues/new", link_preview=False + "https://github.com/green-api/issues/issues/new", link_preview=False, typing_time=2000 ) @@ -47,7 +47,9 @@ def show_available_rates_handler(notification: Notification) -> None: @bot.router.message(text_message=["4", "Call a support operator"]) def call_support_operator_handler(notification: Notification) -> None: - notification.answer("Good. A tech support operator will contact you soon.") + notification.answer( + "Good. A tech support operator will contact you soon.", typing_time=2000 + ) @bot.router.message(text_message=["5", "Show interactive buttons"]) def show_interactive_buttons_handler(notification: Notification) -> None: diff --git a/requirements.txt b/requirements.txt index c7a1388..c9ea938 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -whatsapp-api-client-python>=0.0.49 +whatsapp-api-client-python>=0.0.53 diff --git a/setup.py b/setup.py index 66b9028..949289c 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setup( name="whatsapp-chatbot-python", - version="0.9.7", + version="0.9.8", description=( "This library helps you easily create" " a Python chatbot with WhatsApp API." @@ -43,6 +43,6 @@ "Creative Commons Attribution-NoDerivatives 4.0 International" " (CC BY-ND 4.0)" ), - install_requires=["whatsapp-api-client-python>=0.0.49"], + install_requires=["whatsapp-api-client-python>=0.0.53"], python_requires=">=3.7" ) diff --git a/whatsapp_chatbot_python/manager/handler.py b/whatsapp_chatbot_python/manager/handler.py index 7d6eb2a..bfeb23d 100644 --- a/whatsapp_chatbot_python/manager/handler.py +++ b/whatsapp_chatbot_python/manager/handler.py @@ -86,12 +86,13 @@ def answer( message: str, quoted_message_id: Optional[str] = None, archive_chat: Optional[bool] = None, - link_preview: Optional[bool] = None + link_preview: Optional[bool] = None, + typing_time: Optional[int] = None ) -> Optional[Response]: chat = self.get_chat() if chat: return self.api.sending.sendMessage( - chat, message, quoted_message_id, archive_chat, link_preview + chat, message, quoted_message_id, archive_chat, link_preview, typing_time ) def answer_buttons( @@ -113,7 +114,7 @@ def answer_with_interactive_buttons( body: str, buttons: List[Dict[str, Union[str, Dict[str, str]]]], header: Optional[str] = None, - footer: Optional[str] = None, + footer: Optional[str] = None ) -> Optional[Response]: chat = self.get_chat() if chat: @@ -126,7 +127,7 @@ def answer_with_interactive_buttons_reply( body: str, buttons: List[Dict[str, str]], header: Optional[str] = None, - footer: Optional[str] = None, + footer: Optional[str] = None ) -> Optional[Response]: chat = self.get_chat() if chat: @@ -139,12 +140,14 @@ def answer_with_file( file: str, file_name: Optional[str] = None, caption: Optional[str] = None, - quoted_message_id: Optional[str] = None + quoted_message_id: Optional[str] = None, + typing_time: Optional[int] = None, + typing_type: Optional[str] = None ) -> Optional[Response]: chat = self.get_chat() if chat: return self.api.sending.sendFileByUpload( - chat, file, file_name, caption, quoted_message_id + chat, file, file_name, caption, quoted_message_id, typing_time, typing_type ) def answer_with_poll( @@ -152,12 +155,13 @@ def answer_with_poll( message: str, options: List[Dict[str, str]], multiple_answers: Optional[bool] = None, - quoted_message_id: Optional[str] = None + quoted_message_id: Optional[str] = None, + typing_time: Optional[int] = None ) -> Optional[Response]: chat = self.get_chat() if chat: return self.api.sending.sendPoll( - chat, message, options, multiple_answers, quoted_message_id + chat, message, options, multiple_answers, quoted_message_id, typing_time ) HandlerType = Callable[[Notification], Any] From b52d9a470e9771a2ec6a693cf1dec280ad205436 Mon Sep 17 00:00:00 2001 From: Anna Date: Wed, 19 Nov 2025 10:02:45 +0300 Subject: [PATCH 2/6] aiogram version fix --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index c9ea938..7ff3c1a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,2 @@ whatsapp-api-client-python>=0.0.53 +aiogram>=3.22.0 \ No newline at end of file From 803fc89dbae40fa2eebbc3edac0e5ac73c037b51 Mon Sep 17 00:00:00 2001 From: Anna Date: Wed, 19 Nov 2025 10:06:30 +0300 Subject: [PATCH 3/6] aiogram ver change --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 7ff3c1a..a40c46c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ whatsapp-api-client-python>=0.0.53 -aiogram>=3.22.0 \ No newline at end of file +aiogram>=3.13.1 \ No newline at end of file From 23f72299b26aa0b8f0a2c1bc4be93ad03cff6417 Mon Sep 17 00:00:00 2001 From: Anna Date: Wed, 19 Nov 2025 10:08:39 +0300 Subject: [PATCH 4/6] - req --- requirements.txt | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index a40c46c..0000000 --- a/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -whatsapp-api-client-python>=0.0.53 -aiogram>=3.13.1 \ No newline at end of file From 4a0b8f45c928a9b80fe9d00b3b436ccac005e99a Mon Sep 17 00:00:00 2001 From: Anna Date: Wed, 19 Nov 2025 10:32:42 +0300 Subject: [PATCH 5/6] +req --- requirements.txt | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..244cca1 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,4 @@ +whatsapp-api-client-python>=0.0.53 +aiogram>=3.21.0 +aiofiles>=24.1.0 +aiohttp>=3.9.0 \ No newline at end of file From d5ab2b0aa2ea3399cf2fbac49b928a9ee5977449 Mon Sep 17 00:00:00 2001 From: Anna Date: Wed, 19 Nov 2025 10:45:20 +0300 Subject: [PATCH 6/6] upd workflow --- .github/workflows/python-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 9408e0d..04d0336 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-24.04 strategy: matrix: - python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ] + python-version: [ "3.9", "3.10", "3.11", "3.12" ] steps: - uses: actions/checkout@v3