forked from EvolutionAPI/evolution-client-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchat.py
More file actions
93 lines (83 loc) · 1.92 KB
/
chat.py
File metadata and controls
93 lines (83 loc) · 1.92 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
from typing import List, Optional, Dict, Any
class BaseChat:
def __init__(self, **kwargs):
self.__dict__.update({k: v for k, v in kwargs.items() if v is not None})
class CheckIsWhatsappNumber(BaseChat):
def __init__(
self,
numbers: List[str]
):
super().__init__(
numbers=numbers
)
class MessageKey:
def __init__(
self,
remote_jid: str,
from_me: bool,
id: str,
participant: Optional[str] = None
):
self.remoteJid = remote_jid
self.fromMe = from_me
self.id = id
self.participant = participant
class ReadMessage:
def __init__(
self,
remote_jid: str,
from_me: bool,
id: str
):
self.remoteJid = remote_jid
self.fromMe = from_me
self.id = id
class ArchiveChat:
def __init__(
self,
last_message: Dict[str, Any],
chat: str,
archive: bool
):
self.lastMessage = last_message
self.chat = chat
self.archive = archive
class UnreadChat:
def __init__(
self,
last_message: Dict[str, Any],
chat: str
):
self.lastMessage = last_message
self.chat = chat
class ProfilePicture:
def __init__(self, number: str):
self.number = number
class MediaMessage:
def __init__(
self,
message: Dict[str, Any],
convert_to_mp4: bool = False
):
self.message = message
self.convertToMp4 = convert_to_mp4
class UpdateMessage:
def __init__(
self,
number: str,
key: Dict[str, Any],
text: str
):
self.number = number
self.key = key
self.text = text
class Presence:
def __init__(
self,
number: str,
delay: int,
presence: str
):
self.number = number
self.delay = delay
self.presence = presence