Skip to content

Commit b198982

Browse files
committed
SW-4489 Implemetned EditMessage support
1 parent 1fbc9dc commit b198982

3 files changed

Lines changed: 19 additions & 1 deletion

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ print(response.data)
231231
| `serviceMethods.getContacts` | The method is designed to get a list of contacts of the current account | [GetContacts](https://green-api.com/en/docs/api/service/GetContacts/) |
232232
| `serviceMethods.getContactInfo` | The method is designed to obtain information about the contact | [GetContactInfo](https://green-api.com/en/docs/api/service/GetContactInfo/) |
233233
| `serviceMethods.deleteMessage` | The method deletes the message from chat | [DeleteMessage](https://green-api.com/en/docs/api/service/deleteMessage/) |
234+
| `serviceMethods.editMessage` | The method edits the message in chat | [EditMessage](https://green-api.com/en/docs/api/service/editMessage/) |
234235
| `serviceMethods.archiveChat` | The method archives the chat | [ArchiveChat](https://green-api.com/en/docs/api/service/archiveChat/) |
235236
| `serviceMethods.unarchiveChat` | The method unarchives the chat | [UnarchiveChat](https://green-api.com/en/docs/api/service/unarchiveChat/) |
236237
| `serviceMethods.setDisappearingChat` | The method is designed to change the settings of disappearing messages in chats | [SetDisappearingChat](https://green-api.com/en/docs/api/service/SetDisappearingChat/) |

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setup(
77
name="whatsapp-api-client-python",
8-
version="0.0.47",
8+
version="0.0.48",
99
description=(
1010
"This library helps you easily create"
1111
" a Python application with WhatsApp API."

whatsapp_api_client_python/tools/serviceMethods.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,23 @@ def deleteMessage(self, chatId: str, idMessage: str) -> Response:
9494
), request_body
9595
)
9696

97+
def editMessage(self, chatId: str, idMessage: str, message: str) -> Response:
98+
"""
99+
The method edits a message in chat.
100+
101+
https://green-api.com/en/docs/api/service/editMessage/
102+
"""
103+
104+
request_body = locals()
105+
request_body.pop("self")
106+
107+
return self.api.request(
108+
"POST", (
109+
"{{host}}/waInstance{{idInstance}}/"
110+
"editMessage/{{apiTokenInstance}}"
111+
), request_body
112+
)
113+
97114
def archiveChat(self, chatId: str) -> Response:
98115
"""
99116
The method archives a chat.

0 commit comments

Comments
 (0)