forked from EvolutionAPI/evolution-client-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstance.py
More file actions
59 lines (54 loc) · 2.33 KB
/
instance.py
File metadata and controls
59 lines (54 loc) · 2.33 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
from typing import Optional, List, Dict
class WebhookConfig:
def __init__(self, url: str = None, byEvents: bool = False, base64: bool = True,
headers: Dict = None, events: List[str] = None):
self.url = url
self.byEvents = byEvents
self.base64 = base64
self.headers = headers
self.events = events
class EventsConfig:
def __init__(self, enabled: bool = True, events: List[str] = None):
self.enabled = enabled
self.events = events
class ChatwootConfig:
def __init__(self, accountId: str = None, token: str = None, url: str = None,
signMsg: bool = True, reopenConversation: bool = True,
conversationPending: bool = False, importContacts: bool = True,
nameInbox: str = "evolution", mergeBrazilContacts: bool = True,
importMessages: bool = True, daysLimitImportMessages: int = 3,
organization: str = "Evolution Bot",
logo: str = "https://evolution-api.com/files/evolution-api-favicon.png"):
self.chatwootAccountId = accountId
self.chatwootToken = token
self.chatwootUrl = url
self.chatwootSignMsg = signMsg
self.chatwootReopenConversation = reopenConversation
self.chatwootConversationPending = conversationPending
self.chatwootImportContacts = importContacts
self.chatwootNameInbox = nameInbox
self.chatwootMergeBrazilContacts = mergeBrazilContacts
self.chatwootImportMessages = importMessages
self.chatwootDaysLimitImportMessages = daysLimitImportMessages
self.chatwootOrganization = organization
self.chatwootLogo = logo
class InstanceConfig:
def __init__(
self,
instanceName: str,
integration: str = None,
token: str = None,
number: str = None,
qrcode: bool = None,
rejectCall: bool = None,
msgCall: str = None,
groupsIgnore: bool = None,
alwaysOnline: bool = None,
readMessages: bool = None,
readStatus: bool = None,
syncFullHistory: bool = None
):
self.__dict__['instanceName'] = instanceName
for key, value in locals().items():
if key != 'self' and key != 'instanceName' and value is not None:
self.__dict__[key] = value