forked from green-api/whatsapp-api-client-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmarking.py
More file actions
32 lines (24 loc) · 792 Bytes
/
marking.py
File metadata and controls
32 lines (24 loc) · 792 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from typing import Optional, TYPE_CHECKING
from ..response import Response
if TYPE_CHECKING:
from ..API import GreenApi
class Marking:
def __init__(self, api: "GreenApi"):
self.api = api
def readChat(
self, chatId: str, idMessage: Optional[str] = None
) -> Response:
"""
The method is aimed for marking messages in a chat as read.
https://green-api.com/en/docs/api/marks/ReadChat/
"""
request_body = locals()
if idMessage is None:
request_body.pop("idMessage")
request_body.pop("self")
return self.api.request(
"POST", (
"{{host}}/waInstance{{idInstance}}/"
"readChat/{{apiTokenInstance}}"
), request_body
)