waapi 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- waapi/__init__.py +33 -0
- waapi/_actions.py +152 -0
- waapi/_generated.py +4094 -0
- waapi/_http.py +97 -0
- waapi/client.py +118 -0
- waapi/exceptions.py +60 -0
- waapi/py.typed +0 -0
- waapi-0.1.0.dist-info/METADATA +185 -0
- waapi-0.1.0.dist-info/RECORD +11 -0
- waapi-0.1.0.dist-info/WHEEL +4 -0
- waapi-0.1.0.dist-info/licenses/LICENSE +21 -0
waapi/_generated.py
ADDED
|
@@ -0,0 +1,4094 @@
|
|
|
1
|
+
"""Client actions generated from the WaAPI OpenAPI specification.
|
|
2
|
+
|
|
3
|
+
DO NOT EDIT. Regenerate with:
|
|
4
|
+
|
|
5
|
+
python3 scripts/sync_actions.py ../eazewhatsapp-proxy
|
|
6
|
+
|
|
7
|
+
Hand-written methods belong in _actions.py, which composes these classes in.
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from __future__ import annotations
|
|
11
|
+
|
|
12
|
+
from typing import TYPE_CHECKING, Any
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class _Calls:
|
|
16
|
+
"""The contract the mixins rely on, declared for the type checker only."""
|
|
17
|
+
|
|
18
|
+
if TYPE_CHECKING:
|
|
19
|
+
|
|
20
|
+
def action(
|
|
21
|
+
self,
|
|
22
|
+
name: str,
|
|
23
|
+
payload: dict[str, Any] | None = None,
|
|
24
|
+
*,
|
|
25
|
+
instance_id: int | str | None = None,
|
|
26
|
+
) -> Any: ...
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class GeneratedActions(_Calls):
|
|
30
|
+
"""Every client action, blocking."""
|
|
31
|
+
|
|
32
|
+
def send_message(
|
|
33
|
+
self,
|
|
34
|
+
chat_id: str,
|
|
35
|
+
message: str,
|
|
36
|
+
*,
|
|
37
|
+
mentions: list[Any] | None = None,
|
|
38
|
+
reply_to_message_id: str | None = None,
|
|
39
|
+
preview_link: bool | None = None,
|
|
40
|
+
firedandforget: bool | None = None,
|
|
41
|
+
instance_id: int | str | None = None,
|
|
42
|
+
) -> Any:
|
|
43
|
+
"""send a text message to a chat"""
|
|
44
|
+
return self.action(
|
|
45
|
+
"send-message",
|
|
46
|
+
{
|
|
47
|
+
"chatId": chat_id,
|
|
48
|
+
"message": message,
|
|
49
|
+
"mentions": mentions,
|
|
50
|
+
"replyToMessageId": reply_to_message_id,
|
|
51
|
+
"previewLink": preview_link,
|
|
52
|
+
"firedandforget": firedandforget,
|
|
53
|
+
},
|
|
54
|
+
instance_id=instance_id,
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
def send_media(
|
|
58
|
+
self,
|
|
59
|
+
chat_id: str,
|
|
60
|
+
*,
|
|
61
|
+
media_url: str | None = None,
|
|
62
|
+
media_base64: str | None = None,
|
|
63
|
+
media_caption: str | None = None,
|
|
64
|
+
media_name: str | None = None,
|
|
65
|
+
reply_to_message_id: str | None = None,
|
|
66
|
+
preview_link: bool | None = None,
|
|
67
|
+
as_sticker: bool | None = None,
|
|
68
|
+
as_voice: bool | None = None,
|
|
69
|
+
as_document: bool | None = None,
|
|
70
|
+
firedandforget: bool | None = None,
|
|
71
|
+
instance_id: int | str | None = None,
|
|
72
|
+
) -> Any:
|
|
73
|
+
"""send a media message (image, video, audio, document)"""
|
|
74
|
+
return self.action(
|
|
75
|
+
"send-media",
|
|
76
|
+
{
|
|
77
|
+
"chatId": chat_id,
|
|
78
|
+
"mediaUrl": media_url,
|
|
79
|
+
"mediaBase64": media_base64,
|
|
80
|
+
"mediaCaption": media_caption,
|
|
81
|
+
"mediaName": media_name,
|
|
82
|
+
"replyToMessageId": reply_to_message_id,
|
|
83
|
+
"previewLink": preview_link,
|
|
84
|
+
"asSticker": as_sticker,
|
|
85
|
+
"asVoice": as_voice,
|
|
86
|
+
"asDocument": as_document,
|
|
87
|
+
"firedandforget": firedandforget,
|
|
88
|
+
},
|
|
89
|
+
instance_id=instance_id,
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
def send_seen(
|
|
93
|
+
self,
|
|
94
|
+
chat_id: str,
|
|
95
|
+
*,
|
|
96
|
+
instance_id: int | str | None = None,
|
|
97
|
+
) -> Any:
|
|
98
|
+
"""mark chat messages as seen (blue ticks)"""
|
|
99
|
+
return self.action(
|
|
100
|
+
"send-seen",
|
|
101
|
+
{
|
|
102
|
+
"chatId": chat_id,
|
|
103
|
+
},
|
|
104
|
+
instance_id=instance_id,
|
|
105
|
+
)
|
|
106
|
+
|
|
107
|
+
def send_vcard(
|
|
108
|
+
self,
|
|
109
|
+
chat_id: str,
|
|
110
|
+
v_card: dict[str, Any],
|
|
111
|
+
*,
|
|
112
|
+
firedandforget: bool | None = None,
|
|
113
|
+
instance_id: int | str | None = None,
|
|
114
|
+
) -> Any:
|
|
115
|
+
"""send vCard"""
|
|
116
|
+
return self.action(
|
|
117
|
+
"send-vcard",
|
|
118
|
+
{
|
|
119
|
+
"chatId": chat_id,
|
|
120
|
+
"vCard": v_card,
|
|
121
|
+
"firedandforget": firedandforget,
|
|
122
|
+
},
|
|
123
|
+
instance_id=instance_id,
|
|
124
|
+
)
|
|
125
|
+
|
|
126
|
+
def send_location(
|
|
127
|
+
self,
|
|
128
|
+
chat_id: str,
|
|
129
|
+
latitude: float,
|
|
130
|
+
longitude: float,
|
|
131
|
+
*,
|
|
132
|
+
options: dict[str, Any] | None = None,
|
|
133
|
+
firedandforget: bool | None = None,
|
|
134
|
+
instance_id: int | str | None = None,
|
|
135
|
+
) -> Any:
|
|
136
|
+
"""send location"""
|
|
137
|
+
return self.action(
|
|
138
|
+
"send-location",
|
|
139
|
+
{
|
|
140
|
+
"chatId": chat_id,
|
|
141
|
+
"latitude": latitude,
|
|
142
|
+
"longitude": longitude,
|
|
143
|
+
"options": options,
|
|
144
|
+
"firedandforget": firedandforget,
|
|
145
|
+
},
|
|
146
|
+
instance_id=instance_id,
|
|
147
|
+
)
|
|
148
|
+
|
|
149
|
+
def get_chats(
|
|
150
|
+
self,
|
|
151
|
+
*,
|
|
152
|
+
offset: int | None = None,
|
|
153
|
+
limit: int | None = None,
|
|
154
|
+
instance_id: int | str | None = None,
|
|
155
|
+
) -> Any:
|
|
156
|
+
"""get all chats"""
|
|
157
|
+
return self.action(
|
|
158
|
+
"get-chats",
|
|
159
|
+
{
|
|
160
|
+
"offset": offset,
|
|
161
|
+
"limit": limit,
|
|
162
|
+
},
|
|
163
|
+
instance_id=instance_id,
|
|
164
|
+
)
|
|
165
|
+
|
|
166
|
+
def mark_chat_unread(
|
|
167
|
+
self,
|
|
168
|
+
chat_id: str,
|
|
169
|
+
*,
|
|
170
|
+
instance_id: int | str | None = None,
|
|
171
|
+
) -> Any:
|
|
172
|
+
"""mark chat as unread"""
|
|
173
|
+
return self.action(
|
|
174
|
+
"mark-chat-unread",
|
|
175
|
+
{
|
|
176
|
+
"chatId": chat_id,
|
|
177
|
+
},
|
|
178
|
+
instance_id=instance_id,
|
|
179
|
+
)
|
|
180
|
+
|
|
181
|
+
def mute_chat(
|
|
182
|
+
self,
|
|
183
|
+
chat_id: str,
|
|
184
|
+
*,
|
|
185
|
+
unmute_date: str | None = None,
|
|
186
|
+
instance_id: int | str | None = None,
|
|
187
|
+
) -> Any:
|
|
188
|
+
"""mute chat"""
|
|
189
|
+
return self.action(
|
|
190
|
+
"mute-chat",
|
|
191
|
+
{
|
|
192
|
+
"chatId": chat_id,
|
|
193
|
+
"unmuteDate": unmute_date,
|
|
194
|
+
},
|
|
195
|
+
instance_id=instance_id,
|
|
196
|
+
)
|
|
197
|
+
|
|
198
|
+
def unmute_chat(
|
|
199
|
+
self,
|
|
200
|
+
chat_id: str,
|
|
201
|
+
*,
|
|
202
|
+
instance_id: int | str | None = None,
|
|
203
|
+
) -> Any:
|
|
204
|
+
"""unmute chat"""
|
|
205
|
+
return self.action(
|
|
206
|
+
"unmute-chat",
|
|
207
|
+
{
|
|
208
|
+
"chatId": chat_id,
|
|
209
|
+
},
|
|
210
|
+
instance_id=instance_id,
|
|
211
|
+
)
|
|
212
|
+
|
|
213
|
+
def pin_chat(
|
|
214
|
+
self,
|
|
215
|
+
chat_id: str,
|
|
216
|
+
*,
|
|
217
|
+
instance_id: int | str | None = None,
|
|
218
|
+
) -> Any:
|
|
219
|
+
"""pin chat"""
|
|
220
|
+
return self.action(
|
|
221
|
+
"pin-chat",
|
|
222
|
+
{
|
|
223
|
+
"chatId": chat_id,
|
|
224
|
+
},
|
|
225
|
+
instance_id=instance_id,
|
|
226
|
+
)
|
|
227
|
+
|
|
228
|
+
def unpin_chat(
|
|
229
|
+
self,
|
|
230
|
+
chat_id: str,
|
|
231
|
+
*,
|
|
232
|
+
instance_id: int | str | None = None,
|
|
233
|
+
) -> Any:
|
|
234
|
+
"""unpin chat"""
|
|
235
|
+
return self.action(
|
|
236
|
+
"unpin-chat",
|
|
237
|
+
{
|
|
238
|
+
"chatId": chat_id,
|
|
239
|
+
},
|
|
240
|
+
instance_id=instance_id,
|
|
241
|
+
)
|
|
242
|
+
|
|
243
|
+
def fetch_messages(
|
|
244
|
+
self,
|
|
245
|
+
chat_id: str,
|
|
246
|
+
*,
|
|
247
|
+
limit: int | None = None,
|
|
248
|
+
offset: int | None = None,
|
|
249
|
+
from_me: bool | None = None,
|
|
250
|
+
include_media: bool | None = None,
|
|
251
|
+
instance_id: int | str | None = None,
|
|
252
|
+
) -> Any:
|
|
253
|
+
"""fetch messages from a chat"""
|
|
254
|
+
return self.action(
|
|
255
|
+
"fetch-messages",
|
|
256
|
+
{
|
|
257
|
+
"chatId": chat_id,
|
|
258
|
+
"limit": limit,
|
|
259
|
+
"offset": offset,
|
|
260
|
+
"fromMe": from_me,
|
|
261
|
+
"includeMedia": include_media,
|
|
262
|
+
},
|
|
263
|
+
instance_id=instance_id,
|
|
264
|
+
)
|
|
265
|
+
|
|
266
|
+
def get_message_by_id(
|
|
267
|
+
self,
|
|
268
|
+
message_id: str,
|
|
269
|
+
*,
|
|
270
|
+
include_media: bool | None = None,
|
|
271
|
+
instance_id: int | str | None = None,
|
|
272
|
+
) -> Any:
|
|
273
|
+
"""get message by ID"""
|
|
274
|
+
return self.action(
|
|
275
|
+
"get-message-by-id",
|
|
276
|
+
{
|
|
277
|
+
"messageId": message_id,
|
|
278
|
+
"includeMedia": include_media,
|
|
279
|
+
},
|
|
280
|
+
instance_id=instance_id,
|
|
281
|
+
)
|
|
282
|
+
|
|
283
|
+
def download_media(
|
|
284
|
+
self,
|
|
285
|
+
message_id: str,
|
|
286
|
+
*,
|
|
287
|
+
instance_id: int | str | None = None,
|
|
288
|
+
) -> Any:
|
|
289
|
+
"""download media from message"""
|
|
290
|
+
return self.action(
|
|
291
|
+
"download-media",
|
|
292
|
+
{
|
|
293
|
+
"messageId": message_id,
|
|
294
|
+
},
|
|
295
|
+
instance_id=instance_id,
|
|
296
|
+
)
|
|
297
|
+
|
|
298
|
+
def get_message_info_by_id(
|
|
299
|
+
self,
|
|
300
|
+
message_id: str,
|
|
301
|
+
*,
|
|
302
|
+
instance_id: int | str | None = None,
|
|
303
|
+
) -> Any:
|
|
304
|
+
"""get message info by id"""
|
|
305
|
+
return self.action(
|
|
306
|
+
"get-message-info-by-id",
|
|
307
|
+
{
|
|
308
|
+
"messageId": message_id,
|
|
309
|
+
},
|
|
310
|
+
instance_id=instance_id,
|
|
311
|
+
)
|
|
312
|
+
|
|
313
|
+
def delete_message_by_id(
|
|
314
|
+
self,
|
|
315
|
+
message_id: str,
|
|
316
|
+
*,
|
|
317
|
+
for_everyone: bool | None = None,
|
|
318
|
+
instance_id: int | str | None = None,
|
|
319
|
+
) -> Any:
|
|
320
|
+
"""delete message by id"""
|
|
321
|
+
return self.action(
|
|
322
|
+
"delete-message-by-id",
|
|
323
|
+
{
|
|
324
|
+
"messageId": message_id,
|
|
325
|
+
"forEveryone": for_everyone,
|
|
326
|
+
},
|
|
327
|
+
instance_id=instance_id,
|
|
328
|
+
)
|
|
329
|
+
|
|
330
|
+
def edit_message(
|
|
331
|
+
self,
|
|
332
|
+
message_id: str,
|
|
333
|
+
message: str,
|
|
334
|
+
*,
|
|
335
|
+
instance_id: int | str | None = None,
|
|
336
|
+
) -> Any:
|
|
337
|
+
"""edit a message"""
|
|
338
|
+
return self.action(
|
|
339
|
+
"edit-message",
|
|
340
|
+
{
|
|
341
|
+
"messageId": message_id,
|
|
342
|
+
"message": message,
|
|
343
|
+
},
|
|
344
|
+
instance_id=instance_id,
|
|
345
|
+
)
|
|
346
|
+
|
|
347
|
+
def forward_message(
|
|
348
|
+
self,
|
|
349
|
+
message_id: str,
|
|
350
|
+
chat_id: str,
|
|
351
|
+
*,
|
|
352
|
+
instance_id: int | str | None = None,
|
|
353
|
+
) -> Any:
|
|
354
|
+
"""forward a message"""
|
|
355
|
+
return self.action(
|
|
356
|
+
"forward-message",
|
|
357
|
+
{
|
|
358
|
+
"messageId": message_id,
|
|
359
|
+
"chatId": chat_id,
|
|
360
|
+
},
|
|
361
|
+
instance_id=instance_id,
|
|
362
|
+
)
|
|
363
|
+
|
|
364
|
+
def search_messages(
|
|
365
|
+
self,
|
|
366
|
+
query: str,
|
|
367
|
+
*,
|
|
368
|
+
options: dict[str, Any] | None = None,
|
|
369
|
+
instance_id: int | str | None = None,
|
|
370
|
+
) -> Any:
|
|
371
|
+
"""search messages"""
|
|
372
|
+
return self.action(
|
|
373
|
+
"search-messages",
|
|
374
|
+
{
|
|
375
|
+
"query": query,
|
|
376
|
+
"options": options,
|
|
377
|
+
},
|
|
378
|
+
instance_id=instance_id,
|
|
379
|
+
)
|
|
380
|
+
|
|
381
|
+
def get_contacts(
|
|
382
|
+
self,
|
|
383
|
+
*,
|
|
384
|
+
instance_id: int | str | None = None,
|
|
385
|
+
) -> Any:
|
|
386
|
+
"""get all contacts"""
|
|
387
|
+
return self.action(
|
|
388
|
+
"get-contacts",
|
|
389
|
+
{},
|
|
390
|
+
instance_id=instance_id,
|
|
391
|
+
)
|
|
392
|
+
|
|
393
|
+
def get_number_id(
|
|
394
|
+
self,
|
|
395
|
+
number: str,
|
|
396
|
+
*,
|
|
397
|
+
instance_id: int | str | None = None,
|
|
398
|
+
) -> Any:
|
|
399
|
+
"""get chat ID from phone number"""
|
|
400
|
+
return self.action(
|
|
401
|
+
"get-number-id",
|
|
402
|
+
{
|
|
403
|
+
"number": number,
|
|
404
|
+
},
|
|
405
|
+
instance_id=instance_id,
|
|
406
|
+
)
|
|
407
|
+
|
|
408
|
+
def get_country_code(
|
|
409
|
+
self,
|
|
410
|
+
number: str,
|
|
411
|
+
*,
|
|
412
|
+
instance_id: int | str | None = None,
|
|
413
|
+
) -> Any:
|
|
414
|
+
"""get country code"""
|
|
415
|
+
return self.action(
|
|
416
|
+
"get-country-code",
|
|
417
|
+
{
|
|
418
|
+
"number": number,
|
|
419
|
+
},
|
|
420
|
+
instance_id=instance_id,
|
|
421
|
+
)
|
|
422
|
+
|
|
423
|
+
def get_formatted_number(
|
|
424
|
+
self,
|
|
425
|
+
number: str,
|
|
426
|
+
*,
|
|
427
|
+
instance_id: int | str | None = None,
|
|
428
|
+
) -> Any:
|
|
429
|
+
"""get formatted number"""
|
|
430
|
+
return self.action(
|
|
431
|
+
"get-formatted-number",
|
|
432
|
+
{
|
|
433
|
+
"number": number,
|
|
434
|
+
},
|
|
435
|
+
instance_id=instance_id,
|
|
436
|
+
)
|
|
437
|
+
|
|
438
|
+
def is_registered_user(
|
|
439
|
+
self,
|
|
440
|
+
contact_id: str,
|
|
441
|
+
*,
|
|
442
|
+
instance_id: int | str | None = None,
|
|
443
|
+
) -> Any:
|
|
444
|
+
"""is registered user"""
|
|
445
|
+
return self.action(
|
|
446
|
+
"is-registered-user",
|
|
447
|
+
{
|
|
448
|
+
"contactId": contact_id,
|
|
449
|
+
},
|
|
450
|
+
instance_id=instance_id,
|
|
451
|
+
)
|
|
452
|
+
|
|
453
|
+
def create_poll(
|
|
454
|
+
self,
|
|
455
|
+
chat_id: str,
|
|
456
|
+
caption: str,
|
|
457
|
+
options: list[Any],
|
|
458
|
+
*,
|
|
459
|
+
multiple_answers: bool | None = None,
|
|
460
|
+
instance_id: int | str | None = None,
|
|
461
|
+
) -> Any:
|
|
462
|
+
"""create poll message"""
|
|
463
|
+
return self.action(
|
|
464
|
+
"create-poll",
|
|
465
|
+
{
|
|
466
|
+
"chatId": chat_id,
|
|
467
|
+
"caption": caption,
|
|
468
|
+
"options": options,
|
|
469
|
+
"multipleAnswers": multiple_answers,
|
|
470
|
+
},
|
|
471
|
+
instance_id=instance_id,
|
|
472
|
+
)
|
|
473
|
+
|
|
474
|
+
def get_poll_votes(
|
|
475
|
+
self,
|
|
476
|
+
message_id: str,
|
|
477
|
+
*,
|
|
478
|
+
instance_id: int | str | None = None,
|
|
479
|
+
) -> Any:
|
|
480
|
+
"""get poll votes"""
|
|
481
|
+
return self.action(
|
|
482
|
+
"get-poll-votes",
|
|
483
|
+
{
|
|
484
|
+
"messageId": message_id,
|
|
485
|
+
},
|
|
486
|
+
instance_id=instance_id,
|
|
487
|
+
)
|
|
488
|
+
|
|
489
|
+
def get_stories(
|
|
490
|
+
self,
|
|
491
|
+
*,
|
|
492
|
+
instance_id: int | str | None = None,
|
|
493
|
+
) -> Any:
|
|
494
|
+
"""[BETA] get stories"""
|
|
495
|
+
return self.action(
|
|
496
|
+
"get-stories",
|
|
497
|
+
{},
|
|
498
|
+
instance_id=instance_id,
|
|
499
|
+
)
|
|
500
|
+
|
|
501
|
+
def post_status(
|
|
502
|
+
self,
|
|
503
|
+
*,
|
|
504
|
+
content: str | None = None,
|
|
505
|
+
media_url: str | None = None,
|
|
506
|
+
media_caption: str | None = None,
|
|
507
|
+
media_name: str | None = None,
|
|
508
|
+
background_color: int | None = None,
|
|
509
|
+
font_style: int | None = None,
|
|
510
|
+
send_video_as_gif: bool | None = None,
|
|
511
|
+
send_audio_as_voice: bool | None = None,
|
|
512
|
+
audience: dict[str, Any] | None = None,
|
|
513
|
+
instance_id: int | str | None = None,
|
|
514
|
+
) -> Any:
|
|
515
|
+
"""[BETA] post a text or media status/story"""
|
|
516
|
+
return self.action(
|
|
517
|
+
"post-status",
|
|
518
|
+
{
|
|
519
|
+
"content": content,
|
|
520
|
+
"mediaUrl": media_url,
|
|
521
|
+
"mediaCaption": media_caption,
|
|
522
|
+
"mediaName": media_name,
|
|
523
|
+
"backgroundColor": background_color,
|
|
524
|
+
"fontStyle": font_style,
|
|
525
|
+
"sendVideoAsGif": send_video_as_gif,
|
|
526
|
+
"sendAudioAsVoice": send_audio_as_voice,
|
|
527
|
+
"audience": audience,
|
|
528
|
+
},
|
|
529
|
+
instance_id=instance_id,
|
|
530
|
+
)
|
|
531
|
+
|
|
532
|
+
def set_status_privacy(
|
|
533
|
+
self,
|
|
534
|
+
type: str,
|
|
535
|
+
*,
|
|
536
|
+
contacts: list[Any] | None = None,
|
|
537
|
+
instance_id: int | str | None = None,
|
|
538
|
+
) -> Any:
|
|
539
|
+
"""[BETA] set the Status privacy"""
|
|
540
|
+
return self.action(
|
|
541
|
+
"set-status-privacy",
|
|
542
|
+
{
|
|
543
|
+
"type": type,
|
|
544
|
+
"contacts": contacts,
|
|
545
|
+
},
|
|
546
|
+
instance_id=instance_id,
|
|
547
|
+
)
|
|
548
|
+
|
|
549
|
+
def get_status_privacy(
|
|
550
|
+
self,
|
|
551
|
+
*,
|
|
552
|
+
instance_id: int | str | None = None,
|
|
553
|
+
) -> Any:
|
|
554
|
+
"""[BETA] get the current Status privacy"""
|
|
555
|
+
return self.action(
|
|
556
|
+
"get-status-privacy",
|
|
557
|
+
{},
|
|
558
|
+
instance_id=instance_id,
|
|
559
|
+
)
|
|
560
|
+
|
|
561
|
+
def get_profile_pic_url(
|
|
562
|
+
self,
|
|
563
|
+
contact_id: str,
|
|
564
|
+
*,
|
|
565
|
+
instance_id: int | str | None = None,
|
|
566
|
+
) -> Any:
|
|
567
|
+
"""get profile picture URL"""
|
|
568
|
+
return self.action(
|
|
569
|
+
"get-profile-pic-url",
|
|
570
|
+
{
|
|
571
|
+
"contactId": contact_id,
|
|
572
|
+
},
|
|
573
|
+
instance_id=instance_id,
|
|
574
|
+
)
|
|
575
|
+
|
|
576
|
+
def get_contact_by_id(
|
|
577
|
+
self,
|
|
578
|
+
contact_id: str,
|
|
579
|
+
*,
|
|
580
|
+
instance_id: int | str | None = None,
|
|
581
|
+
) -> Any:
|
|
582
|
+
"""get contact details by ID"""
|
|
583
|
+
return self.action(
|
|
584
|
+
"get-contact-by-id",
|
|
585
|
+
{
|
|
586
|
+
"contactId": contact_id,
|
|
587
|
+
},
|
|
588
|
+
instance_id=instance_id,
|
|
589
|
+
)
|
|
590
|
+
|
|
591
|
+
def get_lid(
|
|
592
|
+
self,
|
|
593
|
+
contact_ids: list[Any],
|
|
594
|
+
*,
|
|
595
|
+
instance_id: int | str | None = None,
|
|
596
|
+
) -> Any:
|
|
597
|
+
"""get contact LID and phone"""
|
|
598
|
+
return self.action(
|
|
599
|
+
"get-lid",
|
|
600
|
+
{
|
|
601
|
+
"contactIds": contact_ids,
|
|
602
|
+
},
|
|
603
|
+
instance_id=instance_id,
|
|
604
|
+
)
|
|
605
|
+
|
|
606
|
+
def upsert_contact(
|
|
607
|
+
self,
|
|
608
|
+
phone_number: str,
|
|
609
|
+
first_name: str,
|
|
610
|
+
last_name: str,
|
|
611
|
+
*,
|
|
612
|
+
sync_to_addressbook: bool | None = None,
|
|
613
|
+
instance_id: int | str | None = None,
|
|
614
|
+
) -> Any:
|
|
615
|
+
"""[BETA] add and update contact"""
|
|
616
|
+
return self.action(
|
|
617
|
+
"upsert-contact",
|
|
618
|
+
{
|
|
619
|
+
"phoneNumber": phone_number,
|
|
620
|
+
"firstName": first_name,
|
|
621
|
+
"lastName": last_name,
|
|
622
|
+
"syncToAddressbook": sync_to_addressbook,
|
|
623
|
+
},
|
|
624
|
+
instance_id=instance_id,
|
|
625
|
+
)
|
|
626
|
+
|
|
627
|
+
def delete_contact(
|
|
628
|
+
self,
|
|
629
|
+
phone_number: str,
|
|
630
|
+
*,
|
|
631
|
+
instance_id: int | str | None = None,
|
|
632
|
+
) -> Any:
|
|
633
|
+
"""delete contact"""
|
|
634
|
+
return self.action(
|
|
635
|
+
"delete-contact",
|
|
636
|
+
{
|
|
637
|
+
"phoneNumber": phone_number,
|
|
638
|
+
},
|
|
639
|
+
instance_id=instance_id,
|
|
640
|
+
)
|
|
641
|
+
|
|
642
|
+
def block_contact(
|
|
643
|
+
self,
|
|
644
|
+
contact_id: str,
|
|
645
|
+
*,
|
|
646
|
+
instance_id: int | str | None = None,
|
|
647
|
+
) -> Any:
|
|
648
|
+
"""block a contact"""
|
|
649
|
+
return self.action(
|
|
650
|
+
"block-contact",
|
|
651
|
+
{
|
|
652
|
+
"contactId": contact_id,
|
|
653
|
+
},
|
|
654
|
+
instance_id=instance_id,
|
|
655
|
+
)
|
|
656
|
+
|
|
657
|
+
def unblock_contact(
|
|
658
|
+
self,
|
|
659
|
+
contact_id: str,
|
|
660
|
+
*,
|
|
661
|
+
instance_id: int | str | None = None,
|
|
662
|
+
) -> Any:
|
|
663
|
+
"""unblock a contact"""
|
|
664
|
+
return self.action(
|
|
665
|
+
"unblock-contact",
|
|
666
|
+
{
|
|
667
|
+
"contactId": contact_id,
|
|
668
|
+
},
|
|
669
|
+
instance_id=instance_id,
|
|
670
|
+
)
|
|
671
|
+
|
|
672
|
+
def get_blocked_contacts(
|
|
673
|
+
self,
|
|
674
|
+
*,
|
|
675
|
+
instance_id: int | str | None = None,
|
|
676
|
+
) -> Any:
|
|
677
|
+
"""get blocked contacts"""
|
|
678
|
+
return self.action(
|
|
679
|
+
"get-blocked-contacts",
|
|
680
|
+
{},
|
|
681
|
+
instance_id=instance_id,
|
|
682
|
+
)
|
|
683
|
+
|
|
684
|
+
def get_common_groups(
|
|
685
|
+
self,
|
|
686
|
+
contact_id: str,
|
|
687
|
+
*,
|
|
688
|
+
instance_id: int | str | None = None,
|
|
689
|
+
) -> Any:
|
|
690
|
+
"""get common groups with contact"""
|
|
691
|
+
return self.action(
|
|
692
|
+
"get-common-groups",
|
|
693
|
+
{
|
|
694
|
+
"contactId": contact_id,
|
|
695
|
+
},
|
|
696
|
+
instance_id=instance_id,
|
|
697
|
+
)
|
|
698
|
+
|
|
699
|
+
def get_contact_about_info(
|
|
700
|
+
self,
|
|
701
|
+
contact_id: str,
|
|
702
|
+
*,
|
|
703
|
+
instance_id: int | str | None = None,
|
|
704
|
+
) -> Any:
|
|
705
|
+
"""get contact about info"""
|
|
706
|
+
return self.action(
|
|
707
|
+
"get-contact-about-info",
|
|
708
|
+
{
|
|
709
|
+
"contactId": contact_id,
|
|
710
|
+
},
|
|
711
|
+
instance_id=instance_id,
|
|
712
|
+
)
|
|
713
|
+
|
|
714
|
+
def get_chat_by_id(
|
|
715
|
+
self,
|
|
716
|
+
chat_id: str,
|
|
717
|
+
*,
|
|
718
|
+
instance_id: int | str | None = None,
|
|
719
|
+
) -> Any:
|
|
720
|
+
"""get chat by id"""
|
|
721
|
+
return self.action(
|
|
722
|
+
"get-chat-by-id",
|
|
723
|
+
{
|
|
724
|
+
"chatId": chat_id,
|
|
725
|
+
},
|
|
726
|
+
instance_id=instance_id,
|
|
727
|
+
)
|
|
728
|
+
|
|
729
|
+
def delete_chat_by_id(
|
|
730
|
+
self,
|
|
731
|
+
chat_id: str,
|
|
732
|
+
*,
|
|
733
|
+
instance_id: int | str | None = None,
|
|
734
|
+
) -> Any:
|
|
735
|
+
"""delete chat by id"""
|
|
736
|
+
return self.action(
|
|
737
|
+
"delete-chat-by-id",
|
|
738
|
+
{
|
|
739
|
+
"chatId": chat_id,
|
|
740
|
+
},
|
|
741
|
+
instance_id=instance_id,
|
|
742
|
+
)
|
|
743
|
+
|
|
744
|
+
def create_group(
|
|
745
|
+
self,
|
|
746
|
+
group_name: str,
|
|
747
|
+
group_participants: list[Any],
|
|
748
|
+
*,
|
|
749
|
+
instance_id: int | str | None = None,
|
|
750
|
+
) -> Any:
|
|
751
|
+
"""create group"""
|
|
752
|
+
return self.action(
|
|
753
|
+
"create-group",
|
|
754
|
+
{
|
|
755
|
+
"groupName": group_name,
|
|
756
|
+
"groupParticipants": group_participants,
|
|
757
|
+
},
|
|
758
|
+
instance_id=instance_id,
|
|
759
|
+
)
|
|
760
|
+
|
|
761
|
+
def get_group_participants(
|
|
762
|
+
self,
|
|
763
|
+
chat_id: str,
|
|
764
|
+
*,
|
|
765
|
+
instance_id: int | str | None = None,
|
|
766
|
+
) -> Any:
|
|
767
|
+
"""get group participants"""
|
|
768
|
+
return self.action(
|
|
769
|
+
"get-group-participants",
|
|
770
|
+
{
|
|
771
|
+
"chatId": chat_id,
|
|
772
|
+
},
|
|
773
|
+
instance_id=instance_id,
|
|
774
|
+
)
|
|
775
|
+
|
|
776
|
+
def get_group_info(
|
|
777
|
+
self,
|
|
778
|
+
chat_id: str,
|
|
779
|
+
*,
|
|
780
|
+
instance_id: int | str | None = None,
|
|
781
|
+
) -> Any:
|
|
782
|
+
"""get group info"""
|
|
783
|
+
return self.action(
|
|
784
|
+
"get-group-info",
|
|
785
|
+
{
|
|
786
|
+
"chatId": chat_id,
|
|
787
|
+
},
|
|
788
|
+
instance_id=instance_id,
|
|
789
|
+
)
|
|
790
|
+
|
|
791
|
+
def get_reactions(
|
|
792
|
+
self,
|
|
793
|
+
*,
|
|
794
|
+
message_id: str | None = None,
|
|
795
|
+
instance_id: int | str | None = None,
|
|
796
|
+
) -> Any:
|
|
797
|
+
"""get message reactions"""
|
|
798
|
+
return self.action(
|
|
799
|
+
"get-reactions",
|
|
800
|
+
{
|
|
801
|
+
"messageId": message_id,
|
|
802
|
+
},
|
|
803
|
+
instance_id=instance_id,
|
|
804
|
+
)
|
|
805
|
+
|
|
806
|
+
def react_to_message(
|
|
807
|
+
self,
|
|
808
|
+
message_id: str,
|
|
809
|
+
reaction: str,
|
|
810
|
+
*,
|
|
811
|
+
instance_id: int | str | None = None,
|
|
812
|
+
) -> Any:
|
|
813
|
+
"""react to message"""
|
|
814
|
+
return self.action(
|
|
815
|
+
"react-to-message",
|
|
816
|
+
{
|
|
817
|
+
"messageId": message_id,
|
|
818
|
+
"reaction": reaction,
|
|
819
|
+
},
|
|
820
|
+
instance_id=instance_id,
|
|
821
|
+
)
|
|
822
|
+
|
|
823
|
+
def update_group_info(
|
|
824
|
+
self,
|
|
825
|
+
chat_id: str,
|
|
826
|
+
*,
|
|
827
|
+
subject: str | None = None,
|
|
828
|
+
description: str | None = None,
|
|
829
|
+
picture_url: str | None = None,
|
|
830
|
+
instance_id: int | str | None = None,
|
|
831
|
+
) -> Any:
|
|
832
|
+
"""update group info"""
|
|
833
|
+
return self.action(
|
|
834
|
+
"update-group-info",
|
|
835
|
+
{
|
|
836
|
+
"chatId": chat_id,
|
|
837
|
+
"subject": subject,
|
|
838
|
+
"description": description,
|
|
839
|
+
"pictureUrl": picture_url,
|
|
840
|
+
},
|
|
841
|
+
instance_id=instance_id,
|
|
842
|
+
)
|
|
843
|
+
|
|
844
|
+
def get_message_mentions(
|
|
845
|
+
self,
|
|
846
|
+
message_id: str,
|
|
847
|
+
*,
|
|
848
|
+
instance_id: int | str | None = None,
|
|
849
|
+
) -> Any:
|
|
850
|
+
"""get message mentions"""
|
|
851
|
+
return self.action(
|
|
852
|
+
"get-message-mentions",
|
|
853
|
+
{
|
|
854
|
+
"messageId": message_id,
|
|
855
|
+
},
|
|
856
|
+
instance_id=instance_id,
|
|
857
|
+
)
|
|
858
|
+
|
|
859
|
+
def pin_message(
|
|
860
|
+
self,
|
|
861
|
+
message_id: str,
|
|
862
|
+
*,
|
|
863
|
+
duration: int | None = None,
|
|
864
|
+
instance_id: int | str | None = None,
|
|
865
|
+
) -> Any:
|
|
866
|
+
"""pin message"""
|
|
867
|
+
return self.action(
|
|
868
|
+
"pin-message",
|
|
869
|
+
{
|
|
870
|
+
"messageId": message_id,
|
|
871
|
+
"duration": duration,
|
|
872
|
+
},
|
|
873
|
+
instance_id=instance_id,
|
|
874
|
+
)
|
|
875
|
+
|
|
876
|
+
def unpin_message(
|
|
877
|
+
self,
|
|
878
|
+
message_id: str,
|
|
879
|
+
*,
|
|
880
|
+
instance_id: int | str | None = None,
|
|
881
|
+
) -> Any:
|
|
882
|
+
"""unpin message"""
|
|
883
|
+
return self.action(
|
|
884
|
+
"unpin-message",
|
|
885
|
+
{
|
|
886
|
+
"messageId": message_id,
|
|
887
|
+
},
|
|
888
|
+
instance_id=instance_id,
|
|
889
|
+
)
|
|
890
|
+
|
|
891
|
+
def star_message(
|
|
892
|
+
self,
|
|
893
|
+
message_id: str,
|
|
894
|
+
*,
|
|
895
|
+
instance_id: int | str | None = None,
|
|
896
|
+
) -> Any:
|
|
897
|
+
"""star message"""
|
|
898
|
+
return self.action(
|
|
899
|
+
"star-message",
|
|
900
|
+
{
|
|
901
|
+
"messageId": message_id,
|
|
902
|
+
},
|
|
903
|
+
instance_id=instance_id,
|
|
904
|
+
)
|
|
905
|
+
|
|
906
|
+
def unstar_message(
|
|
907
|
+
self,
|
|
908
|
+
message_id: str,
|
|
909
|
+
*,
|
|
910
|
+
instance_id: int | str | None = None,
|
|
911
|
+
) -> Any:
|
|
912
|
+
"""unstar message"""
|
|
913
|
+
return self.action(
|
|
914
|
+
"unstar-message",
|
|
915
|
+
{
|
|
916
|
+
"messageId": message_id,
|
|
917
|
+
},
|
|
918
|
+
instance_id=instance_id,
|
|
919
|
+
)
|
|
920
|
+
|
|
921
|
+
def update_group_settings(
|
|
922
|
+
self,
|
|
923
|
+
chat_id: str,
|
|
924
|
+
*,
|
|
925
|
+
message_admin_only: bool | None = None,
|
|
926
|
+
instance_id: int | str | None = None,
|
|
927
|
+
) -> Any:
|
|
928
|
+
"""update group settings"""
|
|
929
|
+
return self.action(
|
|
930
|
+
"update-group-settings",
|
|
931
|
+
{
|
|
932
|
+
"chatId": chat_id,
|
|
933
|
+
"messageAdminOnly": message_admin_only,
|
|
934
|
+
},
|
|
935
|
+
instance_id=instance_id,
|
|
936
|
+
)
|
|
937
|
+
|
|
938
|
+
def add_group_participant(
|
|
939
|
+
self,
|
|
940
|
+
chat_id: str,
|
|
941
|
+
participant: str,
|
|
942
|
+
*,
|
|
943
|
+
instance_id: int | str | None = None,
|
|
944
|
+
) -> Any:
|
|
945
|
+
"""add group participant"""
|
|
946
|
+
return self.action(
|
|
947
|
+
"add-group-participant",
|
|
948
|
+
{
|
|
949
|
+
"chatId": chat_id,
|
|
950
|
+
"participant": participant,
|
|
951
|
+
},
|
|
952
|
+
instance_id=instance_id,
|
|
953
|
+
)
|
|
954
|
+
|
|
955
|
+
def remove_group_participant(
|
|
956
|
+
self,
|
|
957
|
+
chat_id: str,
|
|
958
|
+
participant: str,
|
|
959
|
+
*,
|
|
960
|
+
instance_id: int | str | None = None,
|
|
961
|
+
) -> Any:
|
|
962
|
+
"""remove group participant"""
|
|
963
|
+
return self.action(
|
|
964
|
+
"remove-group-participant",
|
|
965
|
+
{
|
|
966
|
+
"chatId": chat_id,
|
|
967
|
+
"participant": participant,
|
|
968
|
+
},
|
|
969
|
+
instance_id=instance_id,
|
|
970
|
+
)
|
|
971
|
+
|
|
972
|
+
def promote_group_participant(
|
|
973
|
+
self,
|
|
974
|
+
chat_id: str,
|
|
975
|
+
participant: str,
|
|
976
|
+
*,
|
|
977
|
+
instance_id: int | str | None = None,
|
|
978
|
+
) -> Any:
|
|
979
|
+
"""promote group participant"""
|
|
980
|
+
return self.action(
|
|
981
|
+
"promote-group-participant",
|
|
982
|
+
{
|
|
983
|
+
"chatId": chat_id,
|
|
984
|
+
"participant": participant,
|
|
985
|
+
},
|
|
986
|
+
instance_id=instance_id,
|
|
987
|
+
)
|
|
988
|
+
|
|
989
|
+
def demote_group_participant(
|
|
990
|
+
self,
|
|
991
|
+
chat_id: str,
|
|
992
|
+
participant: str,
|
|
993
|
+
*,
|
|
994
|
+
instance_id: int | str | None = None,
|
|
995
|
+
) -> Any:
|
|
996
|
+
"""demote group participant"""
|
|
997
|
+
return self.action(
|
|
998
|
+
"demote-group-participant",
|
|
999
|
+
{
|
|
1000
|
+
"chatId": chat_id,
|
|
1001
|
+
"participant": participant,
|
|
1002
|
+
},
|
|
1003
|
+
instance_id=instance_id,
|
|
1004
|
+
)
|
|
1005
|
+
|
|
1006
|
+
def accept_group_member_requests(
|
|
1007
|
+
self,
|
|
1008
|
+
chat_id: str,
|
|
1009
|
+
*,
|
|
1010
|
+
requester_ids: list[Any] | str | None = None,
|
|
1011
|
+
instance_id: int | str | None = None,
|
|
1012
|
+
) -> Any:
|
|
1013
|
+
"""approve group membership requests"""
|
|
1014
|
+
return self.action(
|
|
1015
|
+
"accept-group-member-requests",
|
|
1016
|
+
{
|
|
1017
|
+
"chatId": chat_id,
|
|
1018
|
+
"requesterIds": requester_ids,
|
|
1019
|
+
},
|
|
1020
|
+
instance_id=instance_id,
|
|
1021
|
+
)
|
|
1022
|
+
|
|
1023
|
+
def deny_group_member_requests(
|
|
1024
|
+
self,
|
|
1025
|
+
chat_id: str,
|
|
1026
|
+
*,
|
|
1027
|
+
requester_ids: list[Any] | str | None = None,
|
|
1028
|
+
instance_id: int | str | None = None,
|
|
1029
|
+
) -> Any:
|
|
1030
|
+
"""deny group membership requests"""
|
|
1031
|
+
return self.action(
|
|
1032
|
+
"deny-group-member-requests",
|
|
1033
|
+
{
|
|
1034
|
+
"chatId": chat_id,
|
|
1035
|
+
"requesterIds": requester_ids,
|
|
1036
|
+
},
|
|
1037
|
+
instance_id=instance_id,
|
|
1038
|
+
)
|
|
1039
|
+
|
|
1040
|
+
def get_group_member_requests(
|
|
1041
|
+
self,
|
|
1042
|
+
chat_id: str,
|
|
1043
|
+
*,
|
|
1044
|
+
instance_id: int | str | None = None,
|
|
1045
|
+
) -> Any:
|
|
1046
|
+
"""get group membership requests"""
|
|
1047
|
+
return self.action(
|
|
1048
|
+
"get-group-member-requests",
|
|
1049
|
+
{
|
|
1050
|
+
"chatId": chat_id,
|
|
1051
|
+
},
|
|
1052
|
+
instance_id=instance_id,
|
|
1053
|
+
)
|
|
1054
|
+
|
|
1055
|
+
def accept_invite(
|
|
1056
|
+
self,
|
|
1057
|
+
invite_code: str,
|
|
1058
|
+
*,
|
|
1059
|
+
instance_id: int | str | None = None,
|
|
1060
|
+
) -> Any:
|
|
1061
|
+
"""accept group invite"""
|
|
1062
|
+
return self.action(
|
|
1063
|
+
"accept-invite",
|
|
1064
|
+
{
|
|
1065
|
+
"inviteCode": invite_code,
|
|
1066
|
+
},
|
|
1067
|
+
instance_id=instance_id,
|
|
1068
|
+
)
|
|
1069
|
+
|
|
1070
|
+
def accept_group_invite(
|
|
1071
|
+
self,
|
|
1072
|
+
*,
|
|
1073
|
+
invite_code: str | None = None,
|
|
1074
|
+
invite_data: dict[str, Any] | None = None,
|
|
1075
|
+
instance_id: int | str | None = None,
|
|
1076
|
+
) -> Any:
|
|
1077
|
+
"""accept group invite"""
|
|
1078
|
+
return self.action(
|
|
1079
|
+
"accept-group-invite",
|
|
1080
|
+
{
|
|
1081
|
+
"inviteCode": invite_code,
|
|
1082
|
+
"inviteData": invite_data,
|
|
1083
|
+
},
|
|
1084
|
+
instance_id=instance_id,
|
|
1085
|
+
)
|
|
1086
|
+
|
|
1087
|
+
def get_invite_info(
|
|
1088
|
+
self,
|
|
1089
|
+
invite_code: str,
|
|
1090
|
+
*,
|
|
1091
|
+
instance_id: int | str | None = None,
|
|
1092
|
+
) -> Any:
|
|
1093
|
+
"""get group invite info"""
|
|
1094
|
+
return self.action(
|
|
1095
|
+
"get-invite-info",
|
|
1096
|
+
{
|
|
1097
|
+
"inviteCode": invite_code,
|
|
1098
|
+
},
|
|
1099
|
+
instance_id=instance_id,
|
|
1100
|
+
)
|
|
1101
|
+
|
|
1102
|
+
def create_channel(
|
|
1103
|
+
self,
|
|
1104
|
+
name: str,
|
|
1105
|
+
*,
|
|
1106
|
+
description: str | None = None,
|
|
1107
|
+
picture_url: str | None = None,
|
|
1108
|
+
instance_id: int | str | None = None,
|
|
1109
|
+
) -> Any:
|
|
1110
|
+
"""create a channel"""
|
|
1111
|
+
return self.action(
|
|
1112
|
+
"create-channel",
|
|
1113
|
+
{
|
|
1114
|
+
"name": name,
|
|
1115
|
+
"description": description,
|
|
1116
|
+
"pictureUrl": picture_url,
|
|
1117
|
+
},
|
|
1118
|
+
instance_id=instance_id,
|
|
1119
|
+
)
|
|
1120
|
+
|
|
1121
|
+
def get_channels(
|
|
1122
|
+
self,
|
|
1123
|
+
*,
|
|
1124
|
+
instance_id: int | str | None = None,
|
|
1125
|
+
) -> Any:
|
|
1126
|
+
"""get channels"""
|
|
1127
|
+
return self.action(
|
|
1128
|
+
"get-channels",
|
|
1129
|
+
{},
|
|
1130
|
+
instance_id=instance_id,
|
|
1131
|
+
)
|
|
1132
|
+
|
|
1133
|
+
def get_channel_by_id(
|
|
1134
|
+
self,
|
|
1135
|
+
*,
|
|
1136
|
+
channel_id: str | None = None,
|
|
1137
|
+
instance_id: int | str | None = None,
|
|
1138
|
+
) -> Any:
|
|
1139
|
+
"""get channel by id"""
|
|
1140
|
+
return self.action(
|
|
1141
|
+
"get-channel-by-id",
|
|
1142
|
+
{
|
|
1143
|
+
"channelId": channel_id,
|
|
1144
|
+
},
|
|
1145
|
+
instance_id=instance_id,
|
|
1146
|
+
)
|
|
1147
|
+
|
|
1148
|
+
def subscribe_to_channel(
|
|
1149
|
+
self,
|
|
1150
|
+
*,
|
|
1151
|
+
channel_id: str | None = None,
|
|
1152
|
+
instance_id: int | str | None = None,
|
|
1153
|
+
) -> Any:
|
|
1154
|
+
"""subscribe to channel"""
|
|
1155
|
+
return self.action(
|
|
1156
|
+
"subscribe-to-channel",
|
|
1157
|
+
{
|
|
1158
|
+
"channelId": channel_id,
|
|
1159
|
+
},
|
|
1160
|
+
instance_id=instance_id,
|
|
1161
|
+
)
|
|
1162
|
+
|
|
1163
|
+
def unsubscribe_from_channel(
|
|
1164
|
+
self,
|
|
1165
|
+
*,
|
|
1166
|
+
channel_id: str | None = None,
|
|
1167
|
+
delete_channel_data: bool | None = None,
|
|
1168
|
+
instance_id: int | str | None = None,
|
|
1169
|
+
) -> Any:
|
|
1170
|
+
"""unsubscribe from channel"""
|
|
1171
|
+
return self.action(
|
|
1172
|
+
"unsubscribe-from-channel",
|
|
1173
|
+
{
|
|
1174
|
+
"channelId": channel_id,
|
|
1175
|
+
"deleteChannelData": delete_channel_data,
|
|
1176
|
+
},
|
|
1177
|
+
instance_id=instance_id,
|
|
1178
|
+
)
|
|
1179
|
+
|
|
1180
|
+
def search_channels(
|
|
1181
|
+
self,
|
|
1182
|
+
*,
|
|
1183
|
+
country_codes: list[Any] | None = None,
|
|
1184
|
+
search_text: str | None = None,
|
|
1185
|
+
view: str | None = None,
|
|
1186
|
+
limit: int | None = None,
|
|
1187
|
+
skip_subscribed_newsletters: bool | None = None,
|
|
1188
|
+
instance_id: int | str | None = None,
|
|
1189
|
+
) -> Any:
|
|
1190
|
+
"""search channels"""
|
|
1191
|
+
return self.action(
|
|
1192
|
+
"search-channels",
|
|
1193
|
+
{
|
|
1194
|
+
"countryCodes": country_codes,
|
|
1195
|
+
"searchText": search_text,
|
|
1196
|
+
"view": view,
|
|
1197
|
+
"limit": limit,
|
|
1198
|
+
"skipSubscribedNewsletters": skip_subscribed_newsletters,
|
|
1199
|
+
},
|
|
1200
|
+
instance_id=instance_id,
|
|
1201
|
+
)
|
|
1202
|
+
|
|
1203
|
+
def create_community(
|
|
1204
|
+
self,
|
|
1205
|
+
title: str,
|
|
1206
|
+
*,
|
|
1207
|
+
description: str | None = None,
|
|
1208
|
+
closed: bool | None = None,
|
|
1209
|
+
allow_non_admin_sub_group_creation: bool | None = None,
|
|
1210
|
+
create_general_chat: bool | None = None,
|
|
1211
|
+
existing_group_ids: list[Any] | None = None,
|
|
1212
|
+
instance_id: int | str | None = None,
|
|
1213
|
+
) -> Any:
|
|
1214
|
+
"""[BETA] create a community"""
|
|
1215
|
+
return self.action(
|
|
1216
|
+
"create-community",
|
|
1217
|
+
{
|
|
1218
|
+
"title": title,
|
|
1219
|
+
"description": description,
|
|
1220
|
+
"closed": closed,
|
|
1221
|
+
"allowNonAdminSubGroupCreation": allow_non_admin_sub_group_creation,
|
|
1222
|
+
"createGeneralChat": create_general_chat,
|
|
1223
|
+
"existingGroupIds": existing_group_ids,
|
|
1224
|
+
},
|
|
1225
|
+
instance_id=instance_id,
|
|
1226
|
+
)
|
|
1227
|
+
|
|
1228
|
+
def get_communities(
|
|
1229
|
+
self,
|
|
1230
|
+
*,
|
|
1231
|
+
instance_id: int | str | None = None,
|
|
1232
|
+
) -> Any:
|
|
1233
|
+
"""[BETA] get communities"""
|
|
1234
|
+
return self.action(
|
|
1235
|
+
"get-communities",
|
|
1236
|
+
{},
|
|
1237
|
+
instance_id=instance_id,
|
|
1238
|
+
)
|
|
1239
|
+
|
|
1240
|
+
def get_community_by_id(
|
|
1241
|
+
self,
|
|
1242
|
+
community_id: str,
|
|
1243
|
+
*,
|
|
1244
|
+
instance_id: int | str | None = None,
|
|
1245
|
+
) -> Any:
|
|
1246
|
+
"""[BETA] get community by id"""
|
|
1247
|
+
return self.action(
|
|
1248
|
+
"get-community-by-id",
|
|
1249
|
+
{
|
|
1250
|
+
"communityId": community_id,
|
|
1251
|
+
},
|
|
1252
|
+
instance_id=instance_id,
|
|
1253
|
+
)
|
|
1254
|
+
|
|
1255
|
+
def get_community_subgroups(
|
|
1256
|
+
self,
|
|
1257
|
+
community_id: str,
|
|
1258
|
+
*,
|
|
1259
|
+
instance_id: int | str | None = None,
|
|
1260
|
+
) -> Any:
|
|
1261
|
+
"""[BETA] get community subgroups"""
|
|
1262
|
+
return self.action(
|
|
1263
|
+
"get-community-subgroups",
|
|
1264
|
+
{
|
|
1265
|
+
"communityId": community_id,
|
|
1266
|
+
},
|
|
1267
|
+
instance_id=instance_id,
|
|
1268
|
+
)
|
|
1269
|
+
|
|
1270
|
+
def send_community_announcement(
|
|
1271
|
+
self,
|
|
1272
|
+
community_id: str,
|
|
1273
|
+
*,
|
|
1274
|
+
target: str | None = None,
|
|
1275
|
+
message: str | None = None,
|
|
1276
|
+
media_url: str | None = None,
|
|
1277
|
+
media_caption: str | None = None,
|
|
1278
|
+
media_name: str | None = None,
|
|
1279
|
+
preview_link: bool | None = None,
|
|
1280
|
+
as_sticker: bool | None = None,
|
|
1281
|
+
as_voice: bool | None = None,
|
|
1282
|
+
as_document: bool | None = None,
|
|
1283
|
+
instance_id: int | str | None = None,
|
|
1284
|
+
) -> Any:
|
|
1285
|
+
"""[BETA] send community announcement"""
|
|
1286
|
+
return self.action(
|
|
1287
|
+
"send-community-announcement",
|
|
1288
|
+
{
|
|
1289
|
+
"communityId": community_id,
|
|
1290
|
+
"target": target,
|
|
1291
|
+
"message": message,
|
|
1292
|
+
"mediaUrl": media_url,
|
|
1293
|
+
"mediaCaption": media_caption,
|
|
1294
|
+
"mediaName": media_name,
|
|
1295
|
+
"previewLink": preview_link,
|
|
1296
|
+
"asSticker": as_sticker,
|
|
1297
|
+
"asVoice": as_voice,
|
|
1298
|
+
"asDocument": as_document,
|
|
1299
|
+
},
|
|
1300
|
+
instance_id=instance_id,
|
|
1301
|
+
)
|
|
1302
|
+
|
|
1303
|
+
def link_community_subgroup(
|
|
1304
|
+
self,
|
|
1305
|
+
community_id: str,
|
|
1306
|
+
group_ids: list[Any],
|
|
1307
|
+
*,
|
|
1308
|
+
instance_id: int | str | None = None,
|
|
1309
|
+
) -> Any:
|
|
1310
|
+
"""[BETA] link community subgroup"""
|
|
1311
|
+
return self.action(
|
|
1312
|
+
"link-community-subgroup",
|
|
1313
|
+
{
|
|
1314
|
+
"communityId": community_id,
|
|
1315
|
+
"groupIds": group_ids,
|
|
1316
|
+
},
|
|
1317
|
+
instance_id=instance_id,
|
|
1318
|
+
)
|
|
1319
|
+
|
|
1320
|
+
def unlink_community_subgroup(
|
|
1321
|
+
self,
|
|
1322
|
+
community_id: str,
|
|
1323
|
+
group_ids: list[Any],
|
|
1324
|
+
*,
|
|
1325
|
+
remove_orphan_members: bool | None = None,
|
|
1326
|
+
instance_id: int | str | None = None,
|
|
1327
|
+
) -> Any:
|
|
1328
|
+
"""[BETA] unlink community subgroup"""
|
|
1329
|
+
return self.action(
|
|
1330
|
+
"unlink-community-subgroup",
|
|
1331
|
+
{
|
|
1332
|
+
"communityId": community_id,
|
|
1333
|
+
"groupIds": group_ids,
|
|
1334
|
+
"removeOrphanMembers": remove_orphan_members,
|
|
1335
|
+
},
|
|
1336
|
+
instance_id=instance_id,
|
|
1337
|
+
)
|
|
1338
|
+
|
|
1339
|
+
def leave_community(
|
|
1340
|
+
self,
|
|
1341
|
+
community_id: str,
|
|
1342
|
+
*,
|
|
1343
|
+
instance_id: int | str | None = None,
|
|
1344
|
+
) -> Any:
|
|
1345
|
+
"""[BETA] leave community"""
|
|
1346
|
+
return self.action(
|
|
1347
|
+
"leave-community",
|
|
1348
|
+
{
|
|
1349
|
+
"communityId": community_id,
|
|
1350
|
+
},
|
|
1351
|
+
instance_id=instance_id,
|
|
1352
|
+
)
|
|
1353
|
+
|
|
1354
|
+
def archive_chat(
|
|
1355
|
+
self,
|
|
1356
|
+
chat_id: str,
|
|
1357
|
+
*,
|
|
1358
|
+
instance_id: int | str | None = None,
|
|
1359
|
+
) -> Any:
|
|
1360
|
+
"""archive chat"""
|
|
1361
|
+
return self.action(
|
|
1362
|
+
"archive-chat",
|
|
1363
|
+
{
|
|
1364
|
+
"chatId": chat_id,
|
|
1365
|
+
},
|
|
1366
|
+
instance_id=instance_id,
|
|
1367
|
+
)
|
|
1368
|
+
|
|
1369
|
+
def unarchive_chat(
|
|
1370
|
+
self,
|
|
1371
|
+
chat_id: str,
|
|
1372
|
+
*,
|
|
1373
|
+
instance_id: int | str | None = None,
|
|
1374
|
+
) -> Any:
|
|
1375
|
+
"""unarchive chat"""
|
|
1376
|
+
return self.action(
|
|
1377
|
+
"unarchive-chat",
|
|
1378
|
+
{
|
|
1379
|
+
"chatId": chat_id,
|
|
1380
|
+
},
|
|
1381
|
+
instance_id=instance_id,
|
|
1382
|
+
)
|
|
1383
|
+
|
|
1384
|
+
def get_labels(
|
|
1385
|
+
self,
|
|
1386
|
+
*,
|
|
1387
|
+
instance_id: int | str | None = None,
|
|
1388
|
+
) -> Any:
|
|
1389
|
+
"""get all labels"""
|
|
1390
|
+
return self.action(
|
|
1391
|
+
"get-labels",
|
|
1392
|
+
{},
|
|
1393
|
+
instance_id=instance_id,
|
|
1394
|
+
)
|
|
1395
|
+
|
|
1396
|
+
def get_label_by_id(
|
|
1397
|
+
self,
|
|
1398
|
+
label_id: int,
|
|
1399
|
+
*,
|
|
1400
|
+
instance_id: int | str | None = None,
|
|
1401
|
+
) -> Any:
|
|
1402
|
+
"""get label by id"""
|
|
1403
|
+
return self.action(
|
|
1404
|
+
"get-label-by-id",
|
|
1405
|
+
{
|
|
1406
|
+
"labelId": label_id,
|
|
1407
|
+
},
|
|
1408
|
+
instance_id=instance_id,
|
|
1409
|
+
)
|
|
1410
|
+
|
|
1411
|
+
def get_chat_labels(
|
|
1412
|
+
self,
|
|
1413
|
+
chat_id: str,
|
|
1414
|
+
*,
|
|
1415
|
+
instance_id: int | str | None = None,
|
|
1416
|
+
) -> Any:
|
|
1417
|
+
"""get chat labels"""
|
|
1418
|
+
return self.action(
|
|
1419
|
+
"get-chat-labels",
|
|
1420
|
+
{
|
|
1421
|
+
"chatId": chat_id,
|
|
1422
|
+
},
|
|
1423
|
+
instance_id=instance_id,
|
|
1424
|
+
)
|
|
1425
|
+
|
|
1426
|
+
def get_chats_by_label_id(
|
|
1427
|
+
self,
|
|
1428
|
+
label_id: int,
|
|
1429
|
+
*,
|
|
1430
|
+
instance_id: int | str | None = None,
|
|
1431
|
+
) -> Any:
|
|
1432
|
+
"""get chats by labelId"""
|
|
1433
|
+
return self.action(
|
|
1434
|
+
"get-chats-by-label-id",
|
|
1435
|
+
{
|
|
1436
|
+
"labelId": label_id,
|
|
1437
|
+
},
|
|
1438
|
+
instance_id=instance_id,
|
|
1439
|
+
)
|
|
1440
|
+
|
|
1441
|
+
def change_chat_labels(
|
|
1442
|
+
self,
|
|
1443
|
+
chat_id: str,
|
|
1444
|
+
label_ids: list[Any],
|
|
1445
|
+
*,
|
|
1446
|
+
instance_id: int | str | None = None,
|
|
1447
|
+
) -> Any:
|
|
1448
|
+
"""change chat labels"""
|
|
1449
|
+
return self.action(
|
|
1450
|
+
"change-chat-labels",
|
|
1451
|
+
{
|
|
1452
|
+
"chatId": chat_id,
|
|
1453
|
+
"labelIds": label_ids,
|
|
1454
|
+
},
|
|
1455
|
+
instance_id=instance_id,
|
|
1456
|
+
)
|
|
1457
|
+
|
|
1458
|
+
def logout(
|
|
1459
|
+
self,
|
|
1460
|
+
*,
|
|
1461
|
+
instance_id: int | str | None = None,
|
|
1462
|
+
) -> Any:
|
|
1463
|
+
"""logout"""
|
|
1464
|
+
return self.action(
|
|
1465
|
+
"logout",
|
|
1466
|
+
{},
|
|
1467
|
+
instance_id=instance_id,
|
|
1468
|
+
)
|
|
1469
|
+
|
|
1470
|
+
def reboot(
|
|
1471
|
+
self,
|
|
1472
|
+
*,
|
|
1473
|
+
instance_id: int | str | None = None,
|
|
1474
|
+
) -> Any:
|
|
1475
|
+
"""reboot instance"""
|
|
1476
|
+
return self.action(
|
|
1477
|
+
"reboot",
|
|
1478
|
+
{},
|
|
1479
|
+
instance_id=instance_id,
|
|
1480
|
+
)
|
|
1481
|
+
|
|
1482
|
+
def send_presence_available(
|
|
1483
|
+
self,
|
|
1484
|
+
*,
|
|
1485
|
+
instance_id: int | str | None = None,
|
|
1486
|
+
) -> Any:
|
|
1487
|
+
"""send presence available"""
|
|
1488
|
+
return self.action(
|
|
1489
|
+
"send-presence-available",
|
|
1490
|
+
{},
|
|
1491
|
+
instance_id=instance_id,
|
|
1492
|
+
)
|
|
1493
|
+
|
|
1494
|
+
def set_status(
|
|
1495
|
+
self,
|
|
1496
|
+
status: str,
|
|
1497
|
+
*,
|
|
1498
|
+
instance_id: int | str | None = None,
|
|
1499
|
+
) -> Any:
|
|
1500
|
+
"""set status"""
|
|
1501
|
+
return self.action(
|
|
1502
|
+
"set-status",
|
|
1503
|
+
{
|
|
1504
|
+
"status": status,
|
|
1505
|
+
},
|
|
1506
|
+
instance_id=instance_id,
|
|
1507
|
+
)
|
|
1508
|
+
|
|
1509
|
+
def set_display_name(
|
|
1510
|
+
self,
|
|
1511
|
+
display_name: str,
|
|
1512
|
+
*,
|
|
1513
|
+
instance_id: int | str | None = None,
|
|
1514
|
+
) -> Any:
|
|
1515
|
+
"""set display name"""
|
|
1516
|
+
return self.action(
|
|
1517
|
+
"set-display-name",
|
|
1518
|
+
{
|
|
1519
|
+
"displayName": display_name,
|
|
1520
|
+
},
|
|
1521
|
+
instance_id=instance_id,
|
|
1522
|
+
)
|
|
1523
|
+
|
|
1524
|
+
def request_pairing_code(
|
|
1525
|
+
self,
|
|
1526
|
+
phone_number: str,
|
|
1527
|
+
*,
|
|
1528
|
+
show_notification: bool | None = None,
|
|
1529
|
+
instance_id: int | str | None = None,
|
|
1530
|
+
) -> Any:
|
|
1531
|
+
"""request pairing code"""
|
|
1532
|
+
return self.action(
|
|
1533
|
+
"request-pairing-code",
|
|
1534
|
+
{
|
|
1535
|
+
"phoneNumber": phone_number,
|
|
1536
|
+
"showNotification": show_notification,
|
|
1537
|
+
},
|
|
1538
|
+
instance_id=instance_id,
|
|
1539
|
+
)
|
|
1540
|
+
|
|
1541
|
+
def send_typing(
|
|
1542
|
+
self,
|
|
1543
|
+
chat_id: str,
|
|
1544
|
+
*,
|
|
1545
|
+
instance_id: int | str | None = None,
|
|
1546
|
+
) -> Any:
|
|
1547
|
+
"""send typing state"""
|
|
1548
|
+
return self.action(
|
|
1549
|
+
"send-typing",
|
|
1550
|
+
{
|
|
1551
|
+
"chatId": chat_id,
|
|
1552
|
+
},
|
|
1553
|
+
instance_id=instance_id,
|
|
1554
|
+
)
|
|
1555
|
+
|
|
1556
|
+
def clear_chat_messages(
|
|
1557
|
+
self,
|
|
1558
|
+
chat_id: str,
|
|
1559
|
+
*,
|
|
1560
|
+
instance_id: int | str | None = None,
|
|
1561
|
+
) -> Any:
|
|
1562
|
+
"""clear chat messages"""
|
|
1563
|
+
return self.action(
|
|
1564
|
+
"clear-chat-messages",
|
|
1565
|
+
{
|
|
1566
|
+
"chatId": chat_id,
|
|
1567
|
+
},
|
|
1568
|
+
instance_id=instance_id,
|
|
1569
|
+
)
|
|
1570
|
+
|
|
1571
|
+
def sync_chat_history(
|
|
1572
|
+
self,
|
|
1573
|
+
chat_id: str,
|
|
1574
|
+
*,
|
|
1575
|
+
instance_id: int | str | None = None,
|
|
1576
|
+
) -> Any:
|
|
1577
|
+
"""sync chat history"""
|
|
1578
|
+
return self.action(
|
|
1579
|
+
"sync-chat-history",
|
|
1580
|
+
{
|
|
1581
|
+
"chatId": chat_id,
|
|
1582
|
+
},
|
|
1583
|
+
instance_id=instance_id,
|
|
1584
|
+
)
|
|
1585
|
+
|
|
1586
|
+
def send_stop_typing(
|
|
1587
|
+
self,
|
|
1588
|
+
*,
|
|
1589
|
+
chat_id: str | None = None,
|
|
1590
|
+
instance_id: int | str | None = None,
|
|
1591
|
+
) -> Any:
|
|
1592
|
+
"""stop typing indicator"""
|
|
1593
|
+
return self.action(
|
|
1594
|
+
"send-stop-typing",
|
|
1595
|
+
{
|
|
1596
|
+
"chatId": chat_id,
|
|
1597
|
+
},
|
|
1598
|
+
instance_id=instance_id,
|
|
1599
|
+
)
|
|
1600
|
+
|
|
1601
|
+
def send_presence_unavailable(
|
|
1602
|
+
self,
|
|
1603
|
+
*,
|
|
1604
|
+
instance_id: int | str | None = None,
|
|
1605
|
+
) -> Any:
|
|
1606
|
+
"""send presence unavailable"""
|
|
1607
|
+
return self.action(
|
|
1608
|
+
"send-presence-unavailable",
|
|
1609
|
+
{},
|
|
1610
|
+
instance_id=instance_id,
|
|
1611
|
+
)
|
|
1612
|
+
|
|
1613
|
+
def get_chat_presence(
|
|
1614
|
+
self,
|
|
1615
|
+
chat_id: str,
|
|
1616
|
+
*,
|
|
1617
|
+
wait_for_data: bool | None = None,
|
|
1618
|
+
timeout_ms: int | None = None,
|
|
1619
|
+
instance_id: int | str | None = None,
|
|
1620
|
+
) -> Any:
|
|
1621
|
+
"""[BETA] subscribe to and fetch current presence of a chat"""
|
|
1622
|
+
return self.action(
|
|
1623
|
+
"get-chat-presence",
|
|
1624
|
+
{
|
|
1625
|
+
"chatId": chat_id,
|
|
1626
|
+
"waitForData": wait_for_data,
|
|
1627
|
+
"timeoutMs": timeout_ms,
|
|
1628
|
+
},
|
|
1629
|
+
instance_id=instance_id,
|
|
1630
|
+
)
|
|
1631
|
+
|
|
1632
|
+
def get_chat_presence_snapshot(
|
|
1633
|
+
self,
|
|
1634
|
+
chat_id: str,
|
|
1635
|
+
*,
|
|
1636
|
+
instance_id: int | str | None = None,
|
|
1637
|
+
) -> Any:
|
|
1638
|
+
"""[BETA] read cached presence for a chat without subscribing"""
|
|
1639
|
+
return self.action(
|
|
1640
|
+
"get-chat-presence-snapshot",
|
|
1641
|
+
{
|
|
1642
|
+
"chatId": chat_id,
|
|
1643
|
+
},
|
|
1644
|
+
instance_id=instance_id,
|
|
1645
|
+
)
|
|
1646
|
+
|
|
1647
|
+
def send_event(
|
|
1648
|
+
self,
|
|
1649
|
+
chat_id: str,
|
|
1650
|
+
name: str,
|
|
1651
|
+
start_time: int | str,
|
|
1652
|
+
*,
|
|
1653
|
+
description: str | None = None,
|
|
1654
|
+
end_time: int | str | None = None,
|
|
1655
|
+
location: str | None = None,
|
|
1656
|
+
call_type: str | None = None,
|
|
1657
|
+
instance_id: int | str | None = None,
|
|
1658
|
+
) -> Any:
|
|
1659
|
+
"""send event message"""
|
|
1660
|
+
return self.action(
|
|
1661
|
+
"send-event",
|
|
1662
|
+
{
|
|
1663
|
+
"chatId": chat_id,
|
|
1664
|
+
"name": name,
|
|
1665
|
+
"startTime": start_time,
|
|
1666
|
+
"description": description,
|
|
1667
|
+
"endTime": end_time,
|
|
1668
|
+
"location": location,
|
|
1669
|
+
"callType": call_type,
|
|
1670
|
+
},
|
|
1671
|
+
instance_id=instance_id,
|
|
1672
|
+
)
|
|
1673
|
+
|
|
1674
|
+
def vote_on_poll(
|
|
1675
|
+
self,
|
|
1676
|
+
message_id: str,
|
|
1677
|
+
selected_options: list[Any],
|
|
1678
|
+
*,
|
|
1679
|
+
instance_id: int | str | None = None,
|
|
1680
|
+
) -> Any:
|
|
1681
|
+
"""vote on poll"""
|
|
1682
|
+
return self.action(
|
|
1683
|
+
"vote-on-poll",
|
|
1684
|
+
{
|
|
1685
|
+
"messageId": message_id,
|
|
1686
|
+
"selectedOptions": selected_options,
|
|
1687
|
+
},
|
|
1688
|
+
instance_id=instance_id,
|
|
1689
|
+
)
|
|
1690
|
+
|
|
1691
|
+
def edit_scheduled_event(
|
|
1692
|
+
self,
|
|
1693
|
+
message_id: str,
|
|
1694
|
+
*,
|
|
1695
|
+
name: str | None = None,
|
|
1696
|
+
start_time_ts: int | None = None,
|
|
1697
|
+
event_send_options: dict[str, Any] | None = None,
|
|
1698
|
+
instance_id: int | str | None = None,
|
|
1699
|
+
) -> Any:
|
|
1700
|
+
"""edit scheduled event"""
|
|
1701
|
+
return self.action(
|
|
1702
|
+
"edit-scheduled-event",
|
|
1703
|
+
{
|
|
1704
|
+
"messageId": message_id,
|
|
1705
|
+
"name": name,
|
|
1706
|
+
"startTimeTs": start_time_ts,
|
|
1707
|
+
"eventSendOptions": event_send_options,
|
|
1708
|
+
},
|
|
1709
|
+
instance_id=instance_id,
|
|
1710
|
+
)
|
|
1711
|
+
|
|
1712
|
+
def get_pinned_messages(
|
|
1713
|
+
self,
|
|
1714
|
+
chat_id: str,
|
|
1715
|
+
*,
|
|
1716
|
+
instance_id: int | str | None = None,
|
|
1717
|
+
) -> Any:
|
|
1718
|
+
"""get pinned messages"""
|
|
1719
|
+
return self.action(
|
|
1720
|
+
"get-pinned-messages",
|
|
1721
|
+
{
|
|
1722
|
+
"chatId": chat_id,
|
|
1723
|
+
},
|
|
1724
|
+
instance_id=instance_id,
|
|
1725
|
+
)
|
|
1726
|
+
|
|
1727
|
+
def set_device_name(
|
|
1728
|
+
self,
|
|
1729
|
+
*,
|
|
1730
|
+
device_name: str | None = None,
|
|
1731
|
+
browser_name: str | None = None,
|
|
1732
|
+
instance_id: int | str | None = None,
|
|
1733
|
+
) -> Any:
|
|
1734
|
+
"""set device name"""
|
|
1735
|
+
return self.action(
|
|
1736
|
+
"set-device-name",
|
|
1737
|
+
{
|
|
1738
|
+
"deviceName": device_name,
|
|
1739
|
+
"browserName": browser_name,
|
|
1740
|
+
},
|
|
1741
|
+
instance_id=instance_id,
|
|
1742
|
+
)
|
|
1743
|
+
|
|
1744
|
+
def create_call_link(
|
|
1745
|
+
self,
|
|
1746
|
+
start_time: int | str,
|
|
1747
|
+
call_type: str,
|
|
1748
|
+
*,
|
|
1749
|
+
instance_id: int | str | None = None,
|
|
1750
|
+
) -> Any:
|
|
1751
|
+
"""create call link"""
|
|
1752
|
+
return self.action(
|
|
1753
|
+
"create-call-link",
|
|
1754
|
+
{
|
|
1755
|
+
"startTime": start_time,
|
|
1756
|
+
"callType": call_type,
|
|
1757
|
+
},
|
|
1758
|
+
instance_id=instance_id,
|
|
1759
|
+
)
|
|
1760
|
+
|
|
1761
|
+
def send_event_response(
|
|
1762
|
+
self,
|
|
1763
|
+
event_response: int,
|
|
1764
|
+
event_message_id: str,
|
|
1765
|
+
*,
|
|
1766
|
+
instance_id: int | str | None = None,
|
|
1767
|
+
) -> Any:
|
|
1768
|
+
"""send event response"""
|
|
1769
|
+
return self.action(
|
|
1770
|
+
"send-event-response",
|
|
1771
|
+
{
|
|
1772
|
+
"eventResponse": event_response,
|
|
1773
|
+
"eventMessageId": event_message_id,
|
|
1774
|
+
},
|
|
1775
|
+
instance_id=instance_id,
|
|
1776
|
+
)
|
|
1777
|
+
|
|
1778
|
+
def revoke_status_message(
|
|
1779
|
+
self,
|
|
1780
|
+
message_id: str,
|
|
1781
|
+
*,
|
|
1782
|
+
instance_id: int | str | None = None,
|
|
1783
|
+
) -> Any:
|
|
1784
|
+
"""revoke status message"""
|
|
1785
|
+
return self.action(
|
|
1786
|
+
"revoke-status-message",
|
|
1787
|
+
{
|
|
1788
|
+
"messageId": message_id,
|
|
1789
|
+
},
|
|
1790
|
+
instance_id=instance_id,
|
|
1791
|
+
)
|
|
1792
|
+
|
|
1793
|
+
def add_customer_note(
|
|
1794
|
+
self,
|
|
1795
|
+
chat_id: str,
|
|
1796
|
+
note: str,
|
|
1797
|
+
*,
|
|
1798
|
+
instance_id: int | str | None = None,
|
|
1799
|
+
) -> Any:
|
|
1800
|
+
"""add customer note"""
|
|
1801
|
+
return self.action(
|
|
1802
|
+
"add-customer-note",
|
|
1803
|
+
{
|
|
1804
|
+
"chatId": chat_id,
|
|
1805
|
+
"note": note,
|
|
1806
|
+
},
|
|
1807
|
+
instance_id=instance_id,
|
|
1808
|
+
)
|
|
1809
|
+
|
|
1810
|
+
def get_customer_note(
|
|
1811
|
+
self,
|
|
1812
|
+
chat_id: str,
|
|
1813
|
+
*,
|
|
1814
|
+
instance_id: int | str | None = None,
|
|
1815
|
+
) -> Any:
|
|
1816
|
+
"""get customer note"""
|
|
1817
|
+
return self.action(
|
|
1818
|
+
"get-customer-note",
|
|
1819
|
+
{
|
|
1820
|
+
"chatId": chat_id,
|
|
1821
|
+
},
|
|
1822
|
+
instance_id=instance_id,
|
|
1823
|
+
)
|
|
1824
|
+
|
|
1825
|
+
def get_broadcast(
|
|
1826
|
+
self,
|
|
1827
|
+
contact_id: str,
|
|
1828
|
+
*,
|
|
1829
|
+
instance_id: int | str | None = None,
|
|
1830
|
+
) -> Any:
|
|
1831
|
+
"""get broadcast"""
|
|
1832
|
+
return self.action(
|
|
1833
|
+
"get-broadcast",
|
|
1834
|
+
{
|
|
1835
|
+
"contactId": contact_id,
|
|
1836
|
+
},
|
|
1837
|
+
instance_id=instance_id,
|
|
1838
|
+
)
|
|
1839
|
+
|
|
1840
|
+
def revoke_status(
|
|
1841
|
+
self,
|
|
1842
|
+
message_id: str,
|
|
1843
|
+
*,
|
|
1844
|
+
instance_id: int | str | None = None,
|
|
1845
|
+
) -> Any:
|
|
1846
|
+
"""revoke status"""
|
|
1847
|
+
return self.action(
|
|
1848
|
+
"revoke-status",
|
|
1849
|
+
{
|
|
1850
|
+
"messageId": message_id,
|
|
1851
|
+
},
|
|
1852
|
+
instance_id=instance_id,
|
|
1853
|
+
)
|
|
1854
|
+
|
|
1855
|
+
def get_privacy_settings(
|
|
1856
|
+
self,
|
|
1857
|
+
*,
|
|
1858
|
+
instance_id: int | str | None = None,
|
|
1859
|
+
) -> Any:
|
|
1860
|
+
"""[BETA] get privacy settings"""
|
|
1861
|
+
return self.action(
|
|
1862
|
+
"get-privacy-settings",
|
|
1863
|
+
{},
|
|
1864
|
+
instance_id=instance_id,
|
|
1865
|
+
)
|
|
1866
|
+
|
|
1867
|
+
def set_privacy_setting(
|
|
1868
|
+
self,
|
|
1869
|
+
category: str,
|
|
1870
|
+
value: str,
|
|
1871
|
+
*,
|
|
1872
|
+
disallowed_list: list[Any] | None = None,
|
|
1873
|
+
instance_id: int | str | None = None,
|
|
1874
|
+
) -> Any:
|
|
1875
|
+
"""[BETA] set privacy setting"""
|
|
1876
|
+
return self.action(
|
|
1877
|
+
"set-privacy-setting",
|
|
1878
|
+
{
|
|
1879
|
+
"category": category,
|
|
1880
|
+
"value": value,
|
|
1881
|
+
"disallowedList": disallowed_list,
|
|
1882
|
+
},
|
|
1883
|
+
instance_id=instance_id,
|
|
1884
|
+
)
|
|
1885
|
+
|
|
1886
|
+
def get_disappearing_messages(
|
|
1887
|
+
self,
|
|
1888
|
+
chat_id: str,
|
|
1889
|
+
*,
|
|
1890
|
+
instance_id: int | str | None = None,
|
|
1891
|
+
) -> Any:
|
|
1892
|
+
"""[BETA] get disappearing messages"""
|
|
1893
|
+
return self.action(
|
|
1894
|
+
"get-disappearing-messages",
|
|
1895
|
+
{
|
|
1896
|
+
"chatId": chat_id,
|
|
1897
|
+
},
|
|
1898
|
+
instance_id=instance_id,
|
|
1899
|
+
)
|
|
1900
|
+
|
|
1901
|
+
def set_disappearing_messages(
|
|
1902
|
+
self,
|
|
1903
|
+
chat_id: str,
|
|
1904
|
+
duration: int,
|
|
1905
|
+
*,
|
|
1906
|
+
instance_id: int | str | None = None,
|
|
1907
|
+
) -> Any:
|
|
1908
|
+
"""[BETA] set disappearing messages"""
|
|
1909
|
+
return self.action(
|
|
1910
|
+
"set-disappearing-messages",
|
|
1911
|
+
{
|
|
1912
|
+
"chatId": chat_id,
|
|
1913
|
+
"duration": duration,
|
|
1914
|
+
},
|
|
1915
|
+
instance_id=instance_id,
|
|
1916
|
+
)
|
|
1917
|
+
|
|
1918
|
+
def get_disappearing_durations(
|
|
1919
|
+
self,
|
|
1920
|
+
*,
|
|
1921
|
+
instance_id: int | str | None = None,
|
|
1922
|
+
) -> Any:
|
|
1923
|
+
"""[BETA] get disappearing durations"""
|
|
1924
|
+
return self.action(
|
|
1925
|
+
"get-disappearing-durations",
|
|
1926
|
+
{},
|
|
1927
|
+
instance_id=instance_id,
|
|
1928
|
+
)
|
|
1929
|
+
|
|
1930
|
+
def get_business_profile(
|
|
1931
|
+
self,
|
|
1932
|
+
*,
|
|
1933
|
+
user_id: str | None = None,
|
|
1934
|
+
with_compliance: bool | None = None,
|
|
1935
|
+
instance_id: int | str | None = None,
|
|
1936
|
+
) -> Any:
|
|
1937
|
+
"""[BETA] get business profile"""
|
|
1938
|
+
return self.action(
|
|
1939
|
+
"get-business-profile",
|
|
1940
|
+
{
|
|
1941
|
+
"userId": user_id,
|
|
1942
|
+
"withCompliance": with_compliance,
|
|
1943
|
+
},
|
|
1944
|
+
instance_id=instance_id,
|
|
1945
|
+
)
|
|
1946
|
+
|
|
1947
|
+
def get_business_categories(
|
|
1948
|
+
self,
|
|
1949
|
+
*,
|
|
1950
|
+
parent_id: str | None = None,
|
|
1951
|
+
instance_id: int | str | None = None,
|
|
1952
|
+
) -> Any:
|
|
1953
|
+
"""[BETA] get business categories"""
|
|
1954
|
+
return self.action(
|
|
1955
|
+
"get-business-categories",
|
|
1956
|
+
{
|
|
1957
|
+
"parentId": parent_id,
|
|
1958
|
+
},
|
|
1959
|
+
instance_id=instance_id,
|
|
1960
|
+
)
|
|
1961
|
+
|
|
1962
|
+
def set_business_profile(
|
|
1963
|
+
self,
|
|
1964
|
+
*,
|
|
1965
|
+
description: str | None = None,
|
|
1966
|
+
email: str | None = None,
|
|
1967
|
+
address: str | None = None,
|
|
1968
|
+
latitude: float | None = None,
|
|
1969
|
+
longitude: float | None = None,
|
|
1970
|
+
website: list[Any] | None = None,
|
|
1971
|
+
categories: list[Any] | None = None,
|
|
1972
|
+
business_hours: dict[str, Any] | None = None,
|
|
1973
|
+
price_tier: str | None = None,
|
|
1974
|
+
service_areas: list[Any] | None = None,
|
|
1975
|
+
instance_id: int | str | None = None,
|
|
1976
|
+
) -> Any:
|
|
1977
|
+
"""[BETA] set business profile"""
|
|
1978
|
+
return self.action(
|
|
1979
|
+
"set-business-profile",
|
|
1980
|
+
{
|
|
1981
|
+
"description": description,
|
|
1982
|
+
"email": email,
|
|
1983
|
+
"address": address,
|
|
1984
|
+
"latitude": latitude,
|
|
1985
|
+
"longitude": longitude,
|
|
1986
|
+
"website": website,
|
|
1987
|
+
"categories": categories,
|
|
1988
|
+
"businessHours": business_hours,
|
|
1989
|
+
"priceTier": price_tier,
|
|
1990
|
+
"serviceAreas": service_areas,
|
|
1991
|
+
},
|
|
1992
|
+
instance_id=instance_id,
|
|
1993
|
+
)
|
|
1994
|
+
|
|
1995
|
+
def get_quick_replies(
|
|
1996
|
+
self,
|
|
1997
|
+
*,
|
|
1998
|
+
instance_id: int | str | None = None,
|
|
1999
|
+
) -> Any:
|
|
2000
|
+
"""[BETA] get quick replies"""
|
|
2001
|
+
return self.action(
|
|
2002
|
+
"get-quick-replies",
|
|
2003
|
+
{},
|
|
2004
|
+
instance_id=instance_id,
|
|
2005
|
+
)
|
|
2006
|
+
|
|
2007
|
+
def create_quick_reply(
|
|
2008
|
+
self,
|
|
2009
|
+
shortcut: str,
|
|
2010
|
+
message: str,
|
|
2011
|
+
*,
|
|
2012
|
+
keywords: list[Any] | None = None,
|
|
2013
|
+
instance_id: int | str | None = None,
|
|
2014
|
+
) -> Any:
|
|
2015
|
+
"""[BETA] create quick reply"""
|
|
2016
|
+
return self.action(
|
|
2017
|
+
"create-quick-reply",
|
|
2018
|
+
{
|
|
2019
|
+
"shortcut": shortcut,
|
|
2020
|
+
"message": message,
|
|
2021
|
+
"keywords": keywords,
|
|
2022
|
+
},
|
|
2023
|
+
instance_id=instance_id,
|
|
2024
|
+
)
|
|
2025
|
+
|
|
2026
|
+
def update_quick_reply(
|
|
2027
|
+
self,
|
|
2028
|
+
id: str,
|
|
2029
|
+
*,
|
|
2030
|
+
shortcut: str | None = None,
|
|
2031
|
+
message: str | None = None,
|
|
2032
|
+
keywords: list[Any] | None = None,
|
|
2033
|
+
instance_id: int | str | None = None,
|
|
2034
|
+
) -> Any:
|
|
2035
|
+
"""[BETA] update quick reply"""
|
|
2036
|
+
return self.action(
|
|
2037
|
+
"update-quick-reply",
|
|
2038
|
+
{
|
|
2039
|
+
"id": id,
|
|
2040
|
+
"shortcut": shortcut,
|
|
2041
|
+
"message": message,
|
|
2042
|
+
"keywords": keywords,
|
|
2043
|
+
},
|
|
2044
|
+
instance_id=instance_id,
|
|
2045
|
+
)
|
|
2046
|
+
|
|
2047
|
+
def delete_quick_reply(
|
|
2048
|
+
self,
|
|
2049
|
+
id: str,
|
|
2050
|
+
*,
|
|
2051
|
+
instance_id: int | str | None = None,
|
|
2052
|
+
) -> Any:
|
|
2053
|
+
"""[BETA] delete quick reply"""
|
|
2054
|
+
return self.action(
|
|
2055
|
+
"delete-quick-reply",
|
|
2056
|
+
{
|
|
2057
|
+
"id": id,
|
|
2058
|
+
},
|
|
2059
|
+
instance_id=instance_id,
|
|
2060
|
+
)
|
|
2061
|
+
|
|
2062
|
+
|
|
2063
|
+
class GeneratedAsyncActions(_Calls):
|
|
2064
|
+
"""Every client action, awaited."""
|
|
2065
|
+
|
|
2066
|
+
async def send_message(
|
|
2067
|
+
self,
|
|
2068
|
+
chat_id: str,
|
|
2069
|
+
message: str,
|
|
2070
|
+
*,
|
|
2071
|
+
mentions: list[Any] | None = None,
|
|
2072
|
+
reply_to_message_id: str | None = None,
|
|
2073
|
+
preview_link: bool | None = None,
|
|
2074
|
+
firedandforget: bool | None = None,
|
|
2075
|
+
instance_id: int | str | None = None,
|
|
2076
|
+
) -> Any:
|
|
2077
|
+
"""send a text message to a chat"""
|
|
2078
|
+
return await self.action(
|
|
2079
|
+
"send-message",
|
|
2080
|
+
{
|
|
2081
|
+
"chatId": chat_id,
|
|
2082
|
+
"message": message,
|
|
2083
|
+
"mentions": mentions,
|
|
2084
|
+
"replyToMessageId": reply_to_message_id,
|
|
2085
|
+
"previewLink": preview_link,
|
|
2086
|
+
"firedandforget": firedandforget,
|
|
2087
|
+
},
|
|
2088
|
+
instance_id=instance_id,
|
|
2089
|
+
)
|
|
2090
|
+
|
|
2091
|
+
async def send_media(
|
|
2092
|
+
self,
|
|
2093
|
+
chat_id: str,
|
|
2094
|
+
*,
|
|
2095
|
+
media_url: str | None = None,
|
|
2096
|
+
media_base64: str | None = None,
|
|
2097
|
+
media_caption: str | None = None,
|
|
2098
|
+
media_name: str | None = None,
|
|
2099
|
+
reply_to_message_id: str | None = None,
|
|
2100
|
+
preview_link: bool | None = None,
|
|
2101
|
+
as_sticker: bool | None = None,
|
|
2102
|
+
as_voice: bool | None = None,
|
|
2103
|
+
as_document: bool | None = None,
|
|
2104
|
+
firedandforget: bool | None = None,
|
|
2105
|
+
instance_id: int | str | None = None,
|
|
2106
|
+
) -> Any:
|
|
2107
|
+
"""send a media message (image, video, audio, document)"""
|
|
2108
|
+
return await self.action(
|
|
2109
|
+
"send-media",
|
|
2110
|
+
{
|
|
2111
|
+
"chatId": chat_id,
|
|
2112
|
+
"mediaUrl": media_url,
|
|
2113
|
+
"mediaBase64": media_base64,
|
|
2114
|
+
"mediaCaption": media_caption,
|
|
2115
|
+
"mediaName": media_name,
|
|
2116
|
+
"replyToMessageId": reply_to_message_id,
|
|
2117
|
+
"previewLink": preview_link,
|
|
2118
|
+
"asSticker": as_sticker,
|
|
2119
|
+
"asVoice": as_voice,
|
|
2120
|
+
"asDocument": as_document,
|
|
2121
|
+
"firedandforget": firedandforget,
|
|
2122
|
+
},
|
|
2123
|
+
instance_id=instance_id,
|
|
2124
|
+
)
|
|
2125
|
+
|
|
2126
|
+
async def send_seen(
|
|
2127
|
+
self,
|
|
2128
|
+
chat_id: str,
|
|
2129
|
+
*,
|
|
2130
|
+
instance_id: int | str | None = None,
|
|
2131
|
+
) -> Any:
|
|
2132
|
+
"""mark chat messages as seen (blue ticks)"""
|
|
2133
|
+
return await self.action(
|
|
2134
|
+
"send-seen",
|
|
2135
|
+
{
|
|
2136
|
+
"chatId": chat_id,
|
|
2137
|
+
},
|
|
2138
|
+
instance_id=instance_id,
|
|
2139
|
+
)
|
|
2140
|
+
|
|
2141
|
+
async def send_vcard(
|
|
2142
|
+
self,
|
|
2143
|
+
chat_id: str,
|
|
2144
|
+
v_card: dict[str, Any],
|
|
2145
|
+
*,
|
|
2146
|
+
firedandforget: bool | None = None,
|
|
2147
|
+
instance_id: int | str | None = None,
|
|
2148
|
+
) -> Any:
|
|
2149
|
+
"""send vCard"""
|
|
2150
|
+
return await self.action(
|
|
2151
|
+
"send-vcard",
|
|
2152
|
+
{
|
|
2153
|
+
"chatId": chat_id,
|
|
2154
|
+
"vCard": v_card,
|
|
2155
|
+
"firedandforget": firedandforget,
|
|
2156
|
+
},
|
|
2157
|
+
instance_id=instance_id,
|
|
2158
|
+
)
|
|
2159
|
+
|
|
2160
|
+
async def send_location(
|
|
2161
|
+
self,
|
|
2162
|
+
chat_id: str,
|
|
2163
|
+
latitude: float,
|
|
2164
|
+
longitude: float,
|
|
2165
|
+
*,
|
|
2166
|
+
options: dict[str, Any] | None = None,
|
|
2167
|
+
firedandforget: bool | None = None,
|
|
2168
|
+
instance_id: int | str | None = None,
|
|
2169
|
+
) -> Any:
|
|
2170
|
+
"""send location"""
|
|
2171
|
+
return await self.action(
|
|
2172
|
+
"send-location",
|
|
2173
|
+
{
|
|
2174
|
+
"chatId": chat_id,
|
|
2175
|
+
"latitude": latitude,
|
|
2176
|
+
"longitude": longitude,
|
|
2177
|
+
"options": options,
|
|
2178
|
+
"firedandforget": firedandforget,
|
|
2179
|
+
},
|
|
2180
|
+
instance_id=instance_id,
|
|
2181
|
+
)
|
|
2182
|
+
|
|
2183
|
+
async def get_chats(
|
|
2184
|
+
self,
|
|
2185
|
+
*,
|
|
2186
|
+
offset: int | None = None,
|
|
2187
|
+
limit: int | None = None,
|
|
2188
|
+
instance_id: int | str | None = None,
|
|
2189
|
+
) -> Any:
|
|
2190
|
+
"""get all chats"""
|
|
2191
|
+
return await self.action(
|
|
2192
|
+
"get-chats",
|
|
2193
|
+
{
|
|
2194
|
+
"offset": offset,
|
|
2195
|
+
"limit": limit,
|
|
2196
|
+
},
|
|
2197
|
+
instance_id=instance_id,
|
|
2198
|
+
)
|
|
2199
|
+
|
|
2200
|
+
async def mark_chat_unread(
|
|
2201
|
+
self,
|
|
2202
|
+
chat_id: str,
|
|
2203
|
+
*,
|
|
2204
|
+
instance_id: int | str | None = None,
|
|
2205
|
+
) -> Any:
|
|
2206
|
+
"""mark chat as unread"""
|
|
2207
|
+
return await self.action(
|
|
2208
|
+
"mark-chat-unread",
|
|
2209
|
+
{
|
|
2210
|
+
"chatId": chat_id,
|
|
2211
|
+
},
|
|
2212
|
+
instance_id=instance_id,
|
|
2213
|
+
)
|
|
2214
|
+
|
|
2215
|
+
async def mute_chat(
|
|
2216
|
+
self,
|
|
2217
|
+
chat_id: str,
|
|
2218
|
+
*,
|
|
2219
|
+
unmute_date: str | None = None,
|
|
2220
|
+
instance_id: int | str | None = None,
|
|
2221
|
+
) -> Any:
|
|
2222
|
+
"""mute chat"""
|
|
2223
|
+
return await self.action(
|
|
2224
|
+
"mute-chat",
|
|
2225
|
+
{
|
|
2226
|
+
"chatId": chat_id,
|
|
2227
|
+
"unmuteDate": unmute_date,
|
|
2228
|
+
},
|
|
2229
|
+
instance_id=instance_id,
|
|
2230
|
+
)
|
|
2231
|
+
|
|
2232
|
+
async def unmute_chat(
|
|
2233
|
+
self,
|
|
2234
|
+
chat_id: str,
|
|
2235
|
+
*,
|
|
2236
|
+
instance_id: int | str | None = None,
|
|
2237
|
+
) -> Any:
|
|
2238
|
+
"""unmute chat"""
|
|
2239
|
+
return await self.action(
|
|
2240
|
+
"unmute-chat",
|
|
2241
|
+
{
|
|
2242
|
+
"chatId": chat_id,
|
|
2243
|
+
},
|
|
2244
|
+
instance_id=instance_id,
|
|
2245
|
+
)
|
|
2246
|
+
|
|
2247
|
+
async def pin_chat(
|
|
2248
|
+
self,
|
|
2249
|
+
chat_id: str,
|
|
2250
|
+
*,
|
|
2251
|
+
instance_id: int | str | None = None,
|
|
2252
|
+
) -> Any:
|
|
2253
|
+
"""pin chat"""
|
|
2254
|
+
return await self.action(
|
|
2255
|
+
"pin-chat",
|
|
2256
|
+
{
|
|
2257
|
+
"chatId": chat_id,
|
|
2258
|
+
},
|
|
2259
|
+
instance_id=instance_id,
|
|
2260
|
+
)
|
|
2261
|
+
|
|
2262
|
+
async def unpin_chat(
|
|
2263
|
+
self,
|
|
2264
|
+
chat_id: str,
|
|
2265
|
+
*,
|
|
2266
|
+
instance_id: int | str | None = None,
|
|
2267
|
+
) -> Any:
|
|
2268
|
+
"""unpin chat"""
|
|
2269
|
+
return await self.action(
|
|
2270
|
+
"unpin-chat",
|
|
2271
|
+
{
|
|
2272
|
+
"chatId": chat_id,
|
|
2273
|
+
},
|
|
2274
|
+
instance_id=instance_id,
|
|
2275
|
+
)
|
|
2276
|
+
|
|
2277
|
+
async def fetch_messages(
|
|
2278
|
+
self,
|
|
2279
|
+
chat_id: str,
|
|
2280
|
+
*,
|
|
2281
|
+
limit: int | None = None,
|
|
2282
|
+
offset: int | None = None,
|
|
2283
|
+
from_me: bool | None = None,
|
|
2284
|
+
include_media: bool | None = None,
|
|
2285
|
+
instance_id: int | str | None = None,
|
|
2286
|
+
) -> Any:
|
|
2287
|
+
"""fetch messages from a chat"""
|
|
2288
|
+
return await self.action(
|
|
2289
|
+
"fetch-messages",
|
|
2290
|
+
{
|
|
2291
|
+
"chatId": chat_id,
|
|
2292
|
+
"limit": limit,
|
|
2293
|
+
"offset": offset,
|
|
2294
|
+
"fromMe": from_me,
|
|
2295
|
+
"includeMedia": include_media,
|
|
2296
|
+
},
|
|
2297
|
+
instance_id=instance_id,
|
|
2298
|
+
)
|
|
2299
|
+
|
|
2300
|
+
async def get_message_by_id(
|
|
2301
|
+
self,
|
|
2302
|
+
message_id: str,
|
|
2303
|
+
*,
|
|
2304
|
+
include_media: bool | None = None,
|
|
2305
|
+
instance_id: int | str | None = None,
|
|
2306
|
+
) -> Any:
|
|
2307
|
+
"""get message by ID"""
|
|
2308
|
+
return await self.action(
|
|
2309
|
+
"get-message-by-id",
|
|
2310
|
+
{
|
|
2311
|
+
"messageId": message_id,
|
|
2312
|
+
"includeMedia": include_media,
|
|
2313
|
+
},
|
|
2314
|
+
instance_id=instance_id,
|
|
2315
|
+
)
|
|
2316
|
+
|
|
2317
|
+
async def download_media(
|
|
2318
|
+
self,
|
|
2319
|
+
message_id: str,
|
|
2320
|
+
*,
|
|
2321
|
+
instance_id: int | str | None = None,
|
|
2322
|
+
) -> Any:
|
|
2323
|
+
"""download media from message"""
|
|
2324
|
+
return await self.action(
|
|
2325
|
+
"download-media",
|
|
2326
|
+
{
|
|
2327
|
+
"messageId": message_id,
|
|
2328
|
+
},
|
|
2329
|
+
instance_id=instance_id,
|
|
2330
|
+
)
|
|
2331
|
+
|
|
2332
|
+
async def get_message_info_by_id(
|
|
2333
|
+
self,
|
|
2334
|
+
message_id: str,
|
|
2335
|
+
*,
|
|
2336
|
+
instance_id: int | str | None = None,
|
|
2337
|
+
) -> Any:
|
|
2338
|
+
"""get message info by id"""
|
|
2339
|
+
return await self.action(
|
|
2340
|
+
"get-message-info-by-id",
|
|
2341
|
+
{
|
|
2342
|
+
"messageId": message_id,
|
|
2343
|
+
},
|
|
2344
|
+
instance_id=instance_id,
|
|
2345
|
+
)
|
|
2346
|
+
|
|
2347
|
+
async def delete_message_by_id(
|
|
2348
|
+
self,
|
|
2349
|
+
message_id: str,
|
|
2350
|
+
*,
|
|
2351
|
+
for_everyone: bool | None = None,
|
|
2352
|
+
instance_id: int | str | None = None,
|
|
2353
|
+
) -> Any:
|
|
2354
|
+
"""delete message by id"""
|
|
2355
|
+
return await self.action(
|
|
2356
|
+
"delete-message-by-id",
|
|
2357
|
+
{
|
|
2358
|
+
"messageId": message_id,
|
|
2359
|
+
"forEveryone": for_everyone,
|
|
2360
|
+
},
|
|
2361
|
+
instance_id=instance_id,
|
|
2362
|
+
)
|
|
2363
|
+
|
|
2364
|
+
async def edit_message(
|
|
2365
|
+
self,
|
|
2366
|
+
message_id: str,
|
|
2367
|
+
message: str,
|
|
2368
|
+
*,
|
|
2369
|
+
instance_id: int | str | None = None,
|
|
2370
|
+
) -> Any:
|
|
2371
|
+
"""edit a message"""
|
|
2372
|
+
return await self.action(
|
|
2373
|
+
"edit-message",
|
|
2374
|
+
{
|
|
2375
|
+
"messageId": message_id,
|
|
2376
|
+
"message": message,
|
|
2377
|
+
},
|
|
2378
|
+
instance_id=instance_id,
|
|
2379
|
+
)
|
|
2380
|
+
|
|
2381
|
+
async def forward_message(
|
|
2382
|
+
self,
|
|
2383
|
+
message_id: str,
|
|
2384
|
+
chat_id: str,
|
|
2385
|
+
*,
|
|
2386
|
+
instance_id: int | str | None = None,
|
|
2387
|
+
) -> Any:
|
|
2388
|
+
"""forward a message"""
|
|
2389
|
+
return await self.action(
|
|
2390
|
+
"forward-message",
|
|
2391
|
+
{
|
|
2392
|
+
"messageId": message_id,
|
|
2393
|
+
"chatId": chat_id,
|
|
2394
|
+
},
|
|
2395
|
+
instance_id=instance_id,
|
|
2396
|
+
)
|
|
2397
|
+
|
|
2398
|
+
async def search_messages(
|
|
2399
|
+
self,
|
|
2400
|
+
query: str,
|
|
2401
|
+
*,
|
|
2402
|
+
options: dict[str, Any] | None = None,
|
|
2403
|
+
instance_id: int | str | None = None,
|
|
2404
|
+
) -> Any:
|
|
2405
|
+
"""search messages"""
|
|
2406
|
+
return await self.action(
|
|
2407
|
+
"search-messages",
|
|
2408
|
+
{
|
|
2409
|
+
"query": query,
|
|
2410
|
+
"options": options,
|
|
2411
|
+
},
|
|
2412
|
+
instance_id=instance_id,
|
|
2413
|
+
)
|
|
2414
|
+
|
|
2415
|
+
async def get_contacts(
|
|
2416
|
+
self,
|
|
2417
|
+
*,
|
|
2418
|
+
instance_id: int | str | None = None,
|
|
2419
|
+
) -> Any:
|
|
2420
|
+
"""get all contacts"""
|
|
2421
|
+
return await self.action(
|
|
2422
|
+
"get-contacts",
|
|
2423
|
+
{},
|
|
2424
|
+
instance_id=instance_id,
|
|
2425
|
+
)
|
|
2426
|
+
|
|
2427
|
+
async def get_number_id(
|
|
2428
|
+
self,
|
|
2429
|
+
number: str,
|
|
2430
|
+
*,
|
|
2431
|
+
instance_id: int | str | None = None,
|
|
2432
|
+
) -> Any:
|
|
2433
|
+
"""get chat ID from phone number"""
|
|
2434
|
+
return await self.action(
|
|
2435
|
+
"get-number-id",
|
|
2436
|
+
{
|
|
2437
|
+
"number": number,
|
|
2438
|
+
},
|
|
2439
|
+
instance_id=instance_id,
|
|
2440
|
+
)
|
|
2441
|
+
|
|
2442
|
+
async def get_country_code(
|
|
2443
|
+
self,
|
|
2444
|
+
number: str,
|
|
2445
|
+
*,
|
|
2446
|
+
instance_id: int | str | None = None,
|
|
2447
|
+
) -> Any:
|
|
2448
|
+
"""get country code"""
|
|
2449
|
+
return await self.action(
|
|
2450
|
+
"get-country-code",
|
|
2451
|
+
{
|
|
2452
|
+
"number": number,
|
|
2453
|
+
},
|
|
2454
|
+
instance_id=instance_id,
|
|
2455
|
+
)
|
|
2456
|
+
|
|
2457
|
+
async def get_formatted_number(
|
|
2458
|
+
self,
|
|
2459
|
+
number: str,
|
|
2460
|
+
*,
|
|
2461
|
+
instance_id: int | str | None = None,
|
|
2462
|
+
) -> Any:
|
|
2463
|
+
"""get formatted number"""
|
|
2464
|
+
return await self.action(
|
|
2465
|
+
"get-formatted-number",
|
|
2466
|
+
{
|
|
2467
|
+
"number": number,
|
|
2468
|
+
},
|
|
2469
|
+
instance_id=instance_id,
|
|
2470
|
+
)
|
|
2471
|
+
|
|
2472
|
+
async def is_registered_user(
|
|
2473
|
+
self,
|
|
2474
|
+
contact_id: str,
|
|
2475
|
+
*,
|
|
2476
|
+
instance_id: int | str | None = None,
|
|
2477
|
+
) -> Any:
|
|
2478
|
+
"""is registered user"""
|
|
2479
|
+
return await self.action(
|
|
2480
|
+
"is-registered-user",
|
|
2481
|
+
{
|
|
2482
|
+
"contactId": contact_id,
|
|
2483
|
+
},
|
|
2484
|
+
instance_id=instance_id,
|
|
2485
|
+
)
|
|
2486
|
+
|
|
2487
|
+
async def create_poll(
|
|
2488
|
+
self,
|
|
2489
|
+
chat_id: str,
|
|
2490
|
+
caption: str,
|
|
2491
|
+
options: list[Any],
|
|
2492
|
+
*,
|
|
2493
|
+
multiple_answers: bool | None = None,
|
|
2494
|
+
instance_id: int | str | None = None,
|
|
2495
|
+
) -> Any:
|
|
2496
|
+
"""create poll message"""
|
|
2497
|
+
return await self.action(
|
|
2498
|
+
"create-poll",
|
|
2499
|
+
{
|
|
2500
|
+
"chatId": chat_id,
|
|
2501
|
+
"caption": caption,
|
|
2502
|
+
"options": options,
|
|
2503
|
+
"multipleAnswers": multiple_answers,
|
|
2504
|
+
},
|
|
2505
|
+
instance_id=instance_id,
|
|
2506
|
+
)
|
|
2507
|
+
|
|
2508
|
+
async def get_poll_votes(
|
|
2509
|
+
self,
|
|
2510
|
+
message_id: str,
|
|
2511
|
+
*,
|
|
2512
|
+
instance_id: int | str | None = None,
|
|
2513
|
+
) -> Any:
|
|
2514
|
+
"""get poll votes"""
|
|
2515
|
+
return await self.action(
|
|
2516
|
+
"get-poll-votes",
|
|
2517
|
+
{
|
|
2518
|
+
"messageId": message_id,
|
|
2519
|
+
},
|
|
2520
|
+
instance_id=instance_id,
|
|
2521
|
+
)
|
|
2522
|
+
|
|
2523
|
+
async def get_stories(
|
|
2524
|
+
self,
|
|
2525
|
+
*,
|
|
2526
|
+
instance_id: int | str | None = None,
|
|
2527
|
+
) -> Any:
|
|
2528
|
+
"""[BETA] get stories"""
|
|
2529
|
+
return await self.action(
|
|
2530
|
+
"get-stories",
|
|
2531
|
+
{},
|
|
2532
|
+
instance_id=instance_id,
|
|
2533
|
+
)
|
|
2534
|
+
|
|
2535
|
+
async def post_status(
|
|
2536
|
+
self,
|
|
2537
|
+
*,
|
|
2538
|
+
content: str | None = None,
|
|
2539
|
+
media_url: str | None = None,
|
|
2540
|
+
media_caption: str | None = None,
|
|
2541
|
+
media_name: str | None = None,
|
|
2542
|
+
background_color: int | None = None,
|
|
2543
|
+
font_style: int | None = None,
|
|
2544
|
+
send_video_as_gif: bool | None = None,
|
|
2545
|
+
send_audio_as_voice: bool | None = None,
|
|
2546
|
+
audience: dict[str, Any] | None = None,
|
|
2547
|
+
instance_id: int | str | None = None,
|
|
2548
|
+
) -> Any:
|
|
2549
|
+
"""[BETA] post a text or media status/story"""
|
|
2550
|
+
return await self.action(
|
|
2551
|
+
"post-status",
|
|
2552
|
+
{
|
|
2553
|
+
"content": content,
|
|
2554
|
+
"mediaUrl": media_url,
|
|
2555
|
+
"mediaCaption": media_caption,
|
|
2556
|
+
"mediaName": media_name,
|
|
2557
|
+
"backgroundColor": background_color,
|
|
2558
|
+
"fontStyle": font_style,
|
|
2559
|
+
"sendVideoAsGif": send_video_as_gif,
|
|
2560
|
+
"sendAudioAsVoice": send_audio_as_voice,
|
|
2561
|
+
"audience": audience,
|
|
2562
|
+
},
|
|
2563
|
+
instance_id=instance_id,
|
|
2564
|
+
)
|
|
2565
|
+
|
|
2566
|
+
async def set_status_privacy(
|
|
2567
|
+
self,
|
|
2568
|
+
type: str,
|
|
2569
|
+
*,
|
|
2570
|
+
contacts: list[Any] | None = None,
|
|
2571
|
+
instance_id: int | str | None = None,
|
|
2572
|
+
) -> Any:
|
|
2573
|
+
"""[BETA] set the Status privacy"""
|
|
2574
|
+
return await self.action(
|
|
2575
|
+
"set-status-privacy",
|
|
2576
|
+
{
|
|
2577
|
+
"type": type,
|
|
2578
|
+
"contacts": contacts,
|
|
2579
|
+
},
|
|
2580
|
+
instance_id=instance_id,
|
|
2581
|
+
)
|
|
2582
|
+
|
|
2583
|
+
async def get_status_privacy(
|
|
2584
|
+
self,
|
|
2585
|
+
*,
|
|
2586
|
+
instance_id: int | str | None = None,
|
|
2587
|
+
) -> Any:
|
|
2588
|
+
"""[BETA] get the current Status privacy"""
|
|
2589
|
+
return await self.action(
|
|
2590
|
+
"get-status-privacy",
|
|
2591
|
+
{},
|
|
2592
|
+
instance_id=instance_id,
|
|
2593
|
+
)
|
|
2594
|
+
|
|
2595
|
+
async def get_profile_pic_url(
|
|
2596
|
+
self,
|
|
2597
|
+
contact_id: str,
|
|
2598
|
+
*,
|
|
2599
|
+
instance_id: int | str | None = None,
|
|
2600
|
+
) -> Any:
|
|
2601
|
+
"""get profile picture URL"""
|
|
2602
|
+
return await self.action(
|
|
2603
|
+
"get-profile-pic-url",
|
|
2604
|
+
{
|
|
2605
|
+
"contactId": contact_id,
|
|
2606
|
+
},
|
|
2607
|
+
instance_id=instance_id,
|
|
2608
|
+
)
|
|
2609
|
+
|
|
2610
|
+
async def get_contact_by_id(
|
|
2611
|
+
self,
|
|
2612
|
+
contact_id: str,
|
|
2613
|
+
*,
|
|
2614
|
+
instance_id: int | str | None = None,
|
|
2615
|
+
) -> Any:
|
|
2616
|
+
"""get contact details by ID"""
|
|
2617
|
+
return await self.action(
|
|
2618
|
+
"get-contact-by-id",
|
|
2619
|
+
{
|
|
2620
|
+
"contactId": contact_id,
|
|
2621
|
+
},
|
|
2622
|
+
instance_id=instance_id,
|
|
2623
|
+
)
|
|
2624
|
+
|
|
2625
|
+
async def get_lid(
|
|
2626
|
+
self,
|
|
2627
|
+
contact_ids: list[Any],
|
|
2628
|
+
*,
|
|
2629
|
+
instance_id: int | str | None = None,
|
|
2630
|
+
) -> Any:
|
|
2631
|
+
"""get contact LID and phone"""
|
|
2632
|
+
return await self.action(
|
|
2633
|
+
"get-lid",
|
|
2634
|
+
{
|
|
2635
|
+
"contactIds": contact_ids,
|
|
2636
|
+
},
|
|
2637
|
+
instance_id=instance_id,
|
|
2638
|
+
)
|
|
2639
|
+
|
|
2640
|
+
async def upsert_contact(
|
|
2641
|
+
self,
|
|
2642
|
+
phone_number: str,
|
|
2643
|
+
first_name: str,
|
|
2644
|
+
last_name: str,
|
|
2645
|
+
*,
|
|
2646
|
+
sync_to_addressbook: bool | None = None,
|
|
2647
|
+
instance_id: int | str | None = None,
|
|
2648
|
+
) -> Any:
|
|
2649
|
+
"""[BETA] add and update contact"""
|
|
2650
|
+
return await self.action(
|
|
2651
|
+
"upsert-contact",
|
|
2652
|
+
{
|
|
2653
|
+
"phoneNumber": phone_number,
|
|
2654
|
+
"firstName": first_name,
|
|
2655
|
+
"lastName": last_name,
|
|
2656
|
+
"syncToAddressbook": sync_to_addressbook,
|
|
2657
|
+
},
|
|
2658
|
+
instance_id=instance_id,
|
|
2659
|
+
)
|
|
2660
|
+
|
|
2661
|
+
async def delete_contact(
|
|
2662
|
+
self,
|
|
2663
|
+
phone_number: str,
|
|
2664
|
+
*,
|
|
2665
|
+
instance_id: int | str | None = None,
|
|
2666
|
+
) -> Any:
|
|
2667
|
+
"""delete contact"""
|
|
2668
|
+
return await self.action(
|
|
2669
|
+
"delete-contact",
|
|
2670
|
+
{
|
|
2671
|
+
"phoneNumber": phone_number,
|
|
2672
|
+
},
|
|
2673
|
+
instance_id=instance_id,
|
|
2674
|
+
)
|
|
2675
|
+
|
|
2676
|
+
async def block_contact(
|
|
2677
|
+
self,
|
|
2678
|
+
contact_id: str,
|
|
2679
|
+
*,
|
|
2680
|
+
instance_id: int | str | None = None,
|
|
2681
|
+
) -> Any:
|
|
2682
|
+
"""block a contact"""
|
|
2683
|
+
return await self.action(
|
|
2684
|
+
"block-contact",
|
|
2685
|
+
{
|
|
2686
|
+
"contactId": contact_id,
|
|
2687
|
+
},
|
|
2688
|
+
instance_id=instance_id,
|
|
2689
|
+
)
|
|
2690
|
+
|
|
2691
|
+
async def unblock_contact(
|
|
2692
|
+
self,
|
|
2693
|
+
contact_id: str,
|
|
2694
|
+
*,
|
|
2695
|
+
instance_id: int | str | None = None,
|
|
2696
|
+
) -> Any:
|
|
2697
|
+
"""unblock a contact"""
|
|
2698
|
+
return await self.action(
|
|
2699
|
+
"unblock-contact",
|
|
2700
|
+
{
|
|
2701
|
+
"contactId": contact_id,
|
|
2702
|
+
},
|
|
2703
|
+
instance_id=instance_id,
|
|
2704
|
+
)
|
|
2705
|
+
|
|
2706
|
+
async def get_blocked_contacts(
|
|
2707
|
+
self,
|
|
2708
|
+
*,
|
|
2709
|
+
instance_id: int | str | None = None,
|
|
2710
|
+
) -> Any:
|
|
2711
|
+
"""get blocked contacts"""
|
|
2712
|
+
return await self.action(
|
|
2713
|
+
"get-blocked-contacts",
|
|
2714
|
+
{},
|
|
2715
|
+
instance_id=instance_id,
|
|
2716
|
+
)
|
|
2717
|
+
|
|
2718
|
+
async def get_common_groups(
|
|
2719
|
+
self,
|
|
2720
|
+
contact_id: str,
|
|
2721
|
+
*,
|
|
2722
|
+
instance_id: int | str | None = None,
|
|
2723
|
+
) -> Any:
|
|
2724
|
+
"""get common groups with contact"""
|
|
2725
|
+
return await self.action(
|
|
2726
|
+
"get-common-groups",
|
|
2727
|
+
{
|
|
2728
|
+
"contactId": contact_id,
|
|
2729
|
+
},
|
|
2730
|
+
instance_id=instance_id,
|
|
2731
|
+
)
|
|
2732
|
+
|
|
2733
|
+
async def get_contact_about_info(
|
|
2734
|
+
self,
|
|
2735
|
+
contact_id: str,
|
|
2736
|
+
*,
|
|
2737
|
+
instance_id: int | str | None = None,
|
|
2738
|
+
) -> Any:
|
|
2739
|
+
"""get contact about info"""
|
|
2740
|
+
return await self.action(
|
|
2741
|
+
"get-contact-about-info",
|
|
2742
|
+
{
|
|
2743
|
+
"contactId": contact_id,
|
|
2744
|
+
},
|
|
2745
|
+
instance_id=instance_id,
|
|
2746
|
+
)
|
|
2747
|
+
|
|
2748
|
+
async def get_chat_by_id(
|
|
2749
|
+
self,
|
|
2750
|
+
chat_id: str,
|
|
2751
|
+
*,
|
|
2752
|
+
instance_id: int | str | None = None,
|
|
2753
|
+
) -> Any:
|
|
2754
|
+
"""get chat by id"""
|
|
2755
|
+
return await self.action(
|
|
2756
|
+
"get-chat-by-id",
|
|
2757
|
+
{
|
|
2758
|
+
"chatId": chat_id,
|
|
2759
|
+
},
|
|
2760
|
+
instance_id=instance_id,
|
|
2761
|
+
)
|
|
2762
|
+
|
|
2763
|
+
async def delete_chat_by_id(
|
|
2764
|
+
self,
|
|
2765
|
+
chat_id: str,
|
|
2766
|
+
*,
|
|
2767
|
+
instance_id: int | str | None = None,
|
|
2768
|
+
) -> Any:
|
|
2769
|
+
"""delete chat by id"""
|
|
2770
|
+
return await self.action(
|
|
2771
|
+
"delete-chat-by-id",
|
|
2772
|
+
{
|
|
2773
|
+
"chatId": chat_id,
|
|
2774
|
+
},
|
|
2775
|
+
instance_id=instance_id,
|
|
2776
|
+
)
|
|
2777
|
+
|
|
2778
|
+
async def create_group(
|
|
2779
|
+
self,
|
|
2780
|
+
group_name: str,
|
|
2781
|
+
group_participants: list[Any],
|
|
2782
|
+
*,
|
|
2783
|
+
instance_id: int | str | None = None,
|
|
2784
|
+
) -> Any:
|
|
2785
|
+
"""create group"""
|
|
2786
|
+
return await self.action(
|
|
2787
|
+
"create-group",
|
|
2788
|
+
{
|
|
2789
|
+
"groupName": group_name,
|
|
2790
|
+
"groupParticipants": group_participants,
|
|
2791
|
+
},
|
|
2792
|
+
instance_id=instance_id,
|
|
2793
|
+
)
|
|
2794
|
+
|
|
2795
|
+
async def get_group_participants(
|
|
2796
|
+
self,
|
|
2797
|
+
chat_id: str,
|
|
2798
|
+
*,
|
|
2799
|
+
instance_id: int | str | None = None,
|
|
2800
|
+
) -> Any:
|
|
2801
|
+
"""get group participants"""
|
|
2802
|
+
return await self.action(
|
|
2803
|
+
"get-group-participants",
|
|
2804
|
+
{
|
|
2805
|
+
"chatId": chat_id,
|
|
2806
|
+
},
|
|
2807
|
+
instance_id=instance_id,
|
|
2808
|
+
)
|
|
2809
|
+
|
|
2810
|
+
async def get_group_info(
|
|
2811
|
+
self,
|
|
2812
|
+
chat_id: str,
|
|
2813
|
+
*,
|
|
2814
|
+
instance_id: int | str | None = None,
|
|
2815
|
+
) -> Any:
|
|
2816
|
+
"""get group info"""
|
|
2817
|
+
return await self.action(
|
|
2818
|
+
"get-group-info",
|
|
2819
|
+
{
|
|
2820
|
+
"chatId": chat_id,
|
|
2821
|
+
},
|
|
2822
|
+
instance_id=instance_id,
|
|
2823
|
+
)
|
|
2824
|
+
|
|
2825
|
+
async def get_reactions(
|
|
2826
|
+
self,
|
|
2827
|
+
*,
|
|
2828
|
+
message_id: str | None = None,
|
|
2829
|
+
instance_id: int | str | None = None,
|
|
2830
|
+
) -> Any:
|
|
2831
|
+
"""get message reactions"""
|
|
2832
|
+
return await self.action(
|
|
2833
|
+
"get-reactions",
|
|
2834
|
+
{
|
|
2835
|
+
"messageId": message_id,
|
|
2836
|
+
},
|
|
2837
|
+
instance_id=instance_id,
|
|
2838
|
+
)
|
|
2839
|
+
|
|
2840
|
+
async def react_to_message(
|
|
2841
|
+
self,
|
|
2842
|
+
message_id: str,
|
|
2843
|
+
reaction: str,
|
|
2844
|
+
*,
|
|
2845
|
+
instance_id: int | str | None = None,
|
|
2846
|
+
) -> Any:
|
|
2847
|
+
"""react to message"""
|
|
2848
|
+
return await self.action(
|
|
2849
|
+
"react-to-message",
|
|
2850
|
+
{
|
|
2851
|
+
"messageId": message_id,
|
|
2852
|
+
"reaction": reaction,
|
|
2853
|
+
},
|
|
2854
|
+
instance_id=instance_id,
|
|
2855
|
+
)
|
|
2856
|
+
|
|
2857
|
+
async def update_group_info(
|
|
2858
|
+
self,
|
|
2859
|
+
chat_id: str,
|
|
2860
|
+
*,
|
|
2861
|
+
subject: str | None = None,
|
|
2862
|
+
description: str | None = None,
|
|
2863
|
+
picture_url: str | None = None,
|
|
2864
|
+
instance_id: int | str | None = None,
|
|
2865
|
+
) -> Any:
|
|
2866
|
+
"""update group info"""
|
|
2867
|
+
return await self.action(
|
|
2868
|
+
"update-group-info",
|
|
2869
|
+
{
|
|
2870
|
+
"chatId": chat_id,
|
|
2871
|
+
"subject": subject,
|
|
2872
|
+
"description": description,
|
|
2873
|
+
"pictureUrl": picture_url,
|
|
2874
|
+
},
|
|
2875
|
+
instance_id=instance_id,
|
|
2876
|
+
)
|
|
2877
|
+
|
|
2878
|
+
async def get_message_mentions(
|
|
2879
|
+
self,
|
|
2880
|
+
message_id: str,
|
|
2881
|
+
*,
|
|
2882
|
+
instance_id: int | str | None = None,
|
|
2883
|
+
) -> Any:
|
|
2884
|
+
"""get message mentions"""
|
|
2885
|
+
return await self.action(
|
|
2886
|
+
"get-message-mentions",
|
|
2887
|
+
{
|
|
2888
|
+
"messageId": message_id,
|
|
2889
|
+
},
|
|
2890
|
+
instance_id=instance_id,
|
|
2891
|
+
)
|
|
2892
|
+
|
|
2893
|
+
async def pin_message(
|
|
2894
|
+
self,
|
|
2895
|
+
message_id: str,
|
|
2896
|
+
*,
|
|
2897
|
+
duration: int | None = None,
|
|
2898
|
+
instance_id: int | str | None = None,
|
|
2899
|
+
) -> Any:
|
|
2900
|
+
"""pin message"""
|
|
2901
|
+
return await self.action(
|
|
2902
|
+
"pin-message",
|
|
2903
|
+
{
|
|
2904
|
+
"messageId": message_id,
|
|
2905
|
+
"duration": duration,
|
|
2906
|
+
},
|
|
2907
|
+
instance_id=instance_id,
|
|
2908
|
+
)
|
|
2909
|
+
|
|
2910
|
+
async def unpin_message(
|
|
2911
|
+
self,
|
|
2912
|
+
message_id: str,
|
|
2913
|
+
*,
|
|
2914
|
+
instance_id: int | str | None = None,
|
|
2915
|
+
) -> Any:
|
|
2916
|
+
"""unpin message"""
|
|
2917
|
+
return await self.action(
|
|
2918
|
+
"unpin-message",
|
|
2919
|
+
{
|
|
2920
|
+
"messageId": message_id,
|
|
2921
|
+
},
|
|
2922
|
+
instance_id=instance_id,
|
|
2923
|
+
)
|
|
2924
|
+
|
|
2925
|
+
async def star_message(
|
|
2926
|
+
self,
|
|
2927
|
+
message_id: str,
|
|
2928
|
+
*,
|
|
2929
|
+
instance_id: int | str | None = None,
|
|
2930
|
+
) -> Any:
|
|
2931
|
+
"""star message"""
|
|
2932
|
+
return await self.action(
|
|
2933
|
+
"star-message",
|
|
2934
|
+
{
|
|
2935
|
+
"messageId": message_id,
|
|
2936
|
+
},
|
|
2937
|
+
instance_id=instance_id,
|
|
2938
|
+
)
|
|
2939
|
+
|
|
2940
|
+
async def unstar_message(
|
|
2941
|
+
self,
|
|
2942
|
+
message_id: str,
|
|
2943
|
+
*,
|
|
2944
|
+
instance_id: int | str | None = None,
|
|
2945
|
+
) -> Any:
|
|
2946
|
+
"""unstar message"""
|
|
2947
|
+
return await self.action(
|
|
2948
|
+
"unstar-message",
|
|
2949
|
+
{
|
|
2950
|
+
"messageId": message_id,
|
|
2951
|
+
},
|
|
2952
|
+
instance_id=instance_id,
|
|
2953
|
+
)
|
|
2954
|
+
|
|
2955
|
+
async def update_group_settings(
|
|
2956
|
+
self,
|
|
2957
|
+
chat_id: str,
|
|
2958
|
+
*,
|
|
2959
|
+
message_admin_only: bool | None = None,
|
|
2960
|
+
instance_id: int | str | None = None,
|
|
2961
|
+
) -> Any:
|
|
2962
|
+
"""update group settings"""
|
|
2963
|
+
return await self.action(
|
|
2964
|
+
"update-group-settings",
|
|
2965
|
+
{
|
|
2966
|
+
"chatId": chat_id,
|
|
2967
|
+
"messageAdminOnly": message_admin_only,
|
|
2968
|
+
},
|
|
2969
|
+
instance_id=instance_id,
|
|
2970
|
+
)
|
|
2971
|
+
|
|
2972
|
+
async def add_group_participant(
|
|
2973
|
+
self,
|
|
2974
|
+
chat_id: str,
|
|
2975
|
+
participant: str,
|
|
2976
|
+
*,
|
|
2977
|
+
instance_id: int | str | None = None,
|
|
2978
|
+
) -> Any:
|
|
2979
|
+
"""add group participant"""
|
|
2980
|
+
return await self.action(
|
|
2981
|
+
"add-group-participant",
|
|
2982
|
+
{
|
|
2983
|
+
"chatId": chat_id,
|
|
2984
|
+
"participant": participant,
|
|
2985
|
+
},
|
|
2986
|
+
instance_id=instance_id,
|
|
2987
|
+
)
|
|
2988
|
+
|
|
2989
|
+
async def remove_group_participant(
|
|
2990
|
+
self,
|
|
2991
|
+
chat_id: str,
|
|
2992
|
+
participant: str,
|
|
2993
|
+
*,
|
|
2994
|
+
instance_id: int | str | None = None,
|
|
2995
|
+
) -> Any:
|
|
2996
|
+
"""remove group participant"""
|
|
2997
|
+
return await self.action(
|
|
2998
|
+
"remove-group-participant",
|
|
2999
|
+
{
|
|
3000
|
+
"chatId": chat_id,
|
|
3001
|
+
"participant": participant,
|
|
3002
|
+
},
|
|
3003
|
+
instance_id=instance_id,
|
|
3004
|
+
)
|
|
3005
|
+
|
|
3006
|
+
async def promote_group_participant(
|
|
3007
|
+
self,
|
|
3008
|
+
chat_id: str,
|
|
3009
|
+
participant: str,
|
|
3010
|
+
*,
|
|
3011
|
+
instance_id: int | str | None = None,
|
|
3012
|
+
) -> Any:
|
|
3013
|
+
"""promote group participant"""
|
|
3014
|
+
return await self.action(
|
|
3015
|
+
"promote-group-participant",
|
|
3016
|
+
{
|
|
3017
|
+
"chatId": chat_id,
|
|
3018
|
+
"participant": participant,
|
|
3019
|
+
},
|
|
3020
|
+
instance_id=instance_id,
|
|
3021
|
+
)
|
|
3022
|
+
|
|
3023
|
+
async def demote_group_participant(
|
|
3024
|
+
self,
|
|
3025
|
+
chat_id: str,
|
|
3026
|
+
participant: str,
|
|
3027
|
+
*,
|
|
3028
|
+
instance_id: int | str | None = None,
|
|
3029
|
+
) -> Any:
|
|
3030
|
+
"""demote group participant"""
|
|
3031
|
+
return await self.action(
|
|
3032
|
+
"demote-group-participant",
|
|
3033
|
+
{
|
|
3034
|
+
"chatId": chat_id,
|
|
3035
|
+
"participant": participant,
|
|
3036
|
+
},
|
|
3037
|
+
instance_id=instance_id,
|
|
3038
|
+
)
|
|
3039
|
+
|
|
3040
|
+
async def accept_group_member_requests(
|
|
3041
|
+
self,
|
|
3042
|
+
chat_id: str,
|
|
3043
|
+
*,
|
|
3044
|
+
requester_ids: list[Any] | str | None = None,
|
|
3045
|
+
instance_id: int | str | None = None,
|
|
3046
|
+
) -> Any:
|
|
3047
|
+
"""approve group membership requests"""
|
|
3048
|
+
return await self.action(
|
|
3049
|
+
"accept-group-member-requests",
|
|
3050
|
+
{
|
|
3051
|
+
"chatId": chat_id,
|
|
3052
|
+
"requesterIds": requester_ids,
|
|
3053
|
+
},
|
|
3054
|
+
instance_id=instance_id,
|
|
3055
|
+
)
|
|
3056
|
+
|
|
3057
|
+
async def deny_group_member_requests(
|
|
3058
|
+
self,
|
|
3059
|
+
chat_id: str,
|
|
3060
|
+
*,
|
|
3061
|
+
requester_ids: list[Any] | str | None = None,
|
|
3062
|
+
instance_id: int | str | None = None,
|
|
3063
|
+
) -> Any:
|
|
3064
|
+
"""deny group membership requests"""
|
|
3065
|
+
return await self.action(
|
|
3066
|
+
"deny-group-member-requests",
|
|
3067
|
+
{
|
|
3068
|
+
"chatId": chat_id,
|
|
3069
|
+
"requesterIds": requester_ids,
|
|
3070
|
+
},
|
|
3071
|
+
instance_id=instance_id,
|
|
3072
|
+
)
|
|
3073
|
+
|
|
3074
|
+
async def get_group_member_requests(
|
|
3075
|
+
self,
|
|
3076
|
+
chat_id: str,
|
|
3077
|
+
*,
|
|
3078
|
+
instance_id: int | str | None = None,
|
|
3079
|
+
) -> Any:
|
|
3080
|
+
"""get group membership requests"""
|
|
3081
|
+
return await self.action(
|
|
3082
|
+
"get-group-member-requests",
|
|
3083
|
+
{
|
|
3084
|
+
"chatId": chat_id,
|
|
3085
|
+
},
|
|
3086
|
+
instance_id=instance_id,
|
|
3087
|
+
)
|
|
3088
|
+
|
|
3089
|
+
async def accept_invite(
|
|
3090
|
+
self,
|
|
3091
|
+
invite_code: str,
|
|
3092
|
+
*,
|
|
3093
|
+
instance_id: int | str | None = None,
|
|
3094
|
+
) -> Any:
|
|
3095
|
+
"""accept group invite"""
|
|
3096
|
+
return await self.action(
|
|
3097
|
+
"accept-invite",
|
|
3098
|
+
{
|
|
3099
|
+
"inviteCode": invite_code,
|
|
3100
|
+
},
|
|
3101
|
+
instance_id=instance_id,
|
|
3102
|
+
)
|
|
3103
|
+
|
|
3104
|
+
async def accept_group_invite(
|
|
3105
|
+
self,
|
|
3106
|
+
*,
|
|
3107
|
+
invite_code: str | None = None,
|
|
3108
|
+
invite_data: dict[str, Any] | None = None,
|
|
3109
|
+
instance_id: int | str | None = None,
|
|
3110
|
+
) -> Any:
|
|
3111
|
+
"""accept group invite"""
|
|
3112
|
+
return await self.action(
|
|
3113
|
+
"accept-group-invite",
|
|
3114
|
+
{
|
|
3115
|
+
"inviteCode": invite_code,
|
|
3116
|
+
"inviteData": invite_data,
|
|
3117
|
+
},
|
|
3118
|
+
instance_id=instance_id,
|
|
3119
|
+
)
|
|
3120
|
+
|
|
3121
|
+
async def get_invite_info(
|
|
3122
|
+
self,
|
|
3123
|
+
invite_code: str,
|
|
3124
|
+
*,
|
|
3125
|
+
instance_id: int | str | None = None,
|
|
3126
|
+
) -> Any:
|
|
3127
|
+
"""get group invite info"""
|
|
3128
|
+
return await self.action(
|
|
3129
|
+
"get-invite-info",
|
|
3130
|
+
{
|
|
3131
|
+
"inviteCode": invite_code,
|
|
3132
|
+
},
|
|
3133
|
+
instance_id=instance_id,
|
|
3134
|
+
)
|
|
3135
|
+
|
|
3136
|
+
async def create_channel(
|
|
3137
|
+
self,
|
|
3138
|
+
name: str,
|
|
3139
|
+
*,
|
|
3140
|
+
description: str | None = None,
|
|
3141
|
+
picture_url: str | None = None,
|
|
3142
|
+
instance_id: int | str | None = None,
|
|
3143
|
+
) -> Any:
|
|
3144
|
+
"""create a channel"""
|
|
3145
|
+
return await self.action(
|
|
3146
|
+
"create-channel",
|
|
3147
|
+
{
|
|
3148
|
+
"name": name,
|
|
3149
|
+
"description": description,
|
|
3150
|
+
"pictureUrl": picture_url,
|
|
3151
|
+
},
|
|
3152
|
+
instance_id=instance_id,
|
|
3153
|
+
)
|
|
3154
|
+
|
|
3155
|
+
async def get_channels(
|
|
3156
|
+
self,
|
|
3157
|
+
*,
|
|
3158
|
+
instance_id: int | str | None = None,
|
|
3159
|
+
) -> Any:
|
|
3160
|
+
"""get channels"""
|
|
3161
|
+
return await self.action(
|
|
3162
|
+
"get-channels",
|
|
3163
|
+
{},
|
|
3164
|
+
instance_id=instance_id,
|
|
3165
|
+
)
|
|
3166
|
+
|
|
3167
|
+
async def get_channel_by_id(
|
|
3168
|
+
self,
|
|
3169
|
+
*,
|
|
3170
|
+
channel_id: str | None = None,
|
|
3171
|
+
instance_id: int | str | None = None,
|
|
3172
|
+
) -> Any:
|
|
3173
|
+
"""get channel by id"""
|
|
3174
|
+
return await self.action(
|
|
3175
|
+
"get-channel-by-id",
|
|
3176
|
+
{
|
|
3177
|
+
"channelId": channel_id,
|
|
3178
|
+
},
|
|
3179
|
+
instance_id=instance_id,
|
|
3180
|
+
)
|
|
3181
|
+
|
|
3182
|
+
async def subscribe_to_channel(
|
|
3183
|
+
self,
|
|
3184
|
+
*,
|
|
3185
|
+
channel_id: str | None = None,
|
|
3186
|
+
instance_id: int | str | None = None,
|
|
3187
|
+
) -> Any:
|
|
3188
|
+
"""subscribe to channel"""
|
|
3189
|
+
return await self.action(
|
|
3190
|
+
"subscribe-to-channel",
|
|
3191
|
+
{
|
|
3192
|
+
"channelId": channel_id,
|
|
3193
|
+
},
|
|
3194
|
+
instance_id=instance_id,
|
|
3195
|
+
)
|
|
3196
|
+
|
|
3197
|
+
async def unsubscribe_from_channel(
|
|
3198
|
+
self,
|
|
3199
|
+
*,
|
|
3200
|
+
channel_id: str | None = None,
|
|
3201
|
+
delete_channel_data: bool | None = None,
|
|
3202
|
+
instance_id: int | str | None = None,
|
|
3203
|
+
) -> Any:
|
|
3204
|
+
"""unsubscribe from channel"""
|
|
3205
|
+
return await self.action(
|
|
3206
|
+
"unsubscribe-from-channel",
|
|
3207
|
+
{
|
|
3208
|
+
"channelId": channel_id,
|
|
3209
|
+
"deleteChannelData": delete_channel_data,
|
|
3210
|
+
},
|
|
3211
|
+
instance_id=instance_id,
|
|
3212
|
+
)
|
|
3213
|
+
|
|
3214
|
+
async def search_channels(
|
|
3215
|
+
self,
|
|
3216
|
+
*,
|
|
3217
|
+
country_codes: list[Any] | None = None,
|
|
3218
|
+
search_text: str | None = None,
|
|
3219
|
+
view: str | None = None,
|
|
3220
|
+
limit: int | None = None,
|
|
3221
|
+
skip_subscribed_newsletters: bool | None = None,
|
|
3222
|
+
instance_id: int | str | None = None,
|
|
3223
|
+
) -> Any:
|
|
3224
|
+
"""search channels"""
|
|
3225
|
+
return await self.action(
|
|
3226
|
+
"search-channels",
|
|
3227
|
+
{
|
|
3228
|
+
"countryCodes": country_codes,
|
|
3229
|
+
"searchText": search_text,
|
|
3230
|
+
"view": view,
|
|
3231
|
+
"limit": limit,
|
|
3232
|
+
"skipSubscribedNewsletters": skip_subscribed_newsletters,
|
|
3233
|
+
},
|
|
3234
|
+
instance_id=instance_id,
|
|
3235
|
+
)
|
|
3236
|
+
|
|
3237
|
+
async def create_community(
|
|
3238
|
+
self,
|
|
3239
|
+
title: str,
|
|
3240
|
+
*,
|
|
3241
|
+
description: str | None = None,
|
|
3242
|
+
closed: bool | None = None,
|
|
3243
|
+
allow_non_admin_sub_group_creation: bool | None = None,
|
|
3244
|
+
create_general_chat: bool | None = None,
|
|
3245
|
+
existing_group_ids: list[Any] | None = None,
|
|
3246
|
+
instance_id: int | str | None = None,
|
|
3247
|
+
) -> Any:
|
|
3248
|
+
"""[BETA] create a community"""
|
|
3249
|
+
return await self.action(
|
|
3250
|
+
"create-community",
|
|
3251
|
+
{
|
|
3252
|
+
"title": title,
|
|
3253
|
+
"description": description,
|
|
3254
|
+
"closed": closed,
|
|
3255
|
+
"allowNonAdminSubGroupCreation": allow_non_admin_sub_group_creation,
|
|
3256
|
+
"createGeneralChat": create_general_chat,
|
|
3257
|
+
"existingGroupIds": existing_group_ids,
|
|
3258
|
+
},
|
|
3259
|
+
instance_id=instance_id,
|
|
3260
|
+
)
|
|
3261
|
+
|
|
3262
|
+
async def get_communities(
|
|
3263
|
+
self,
|
|
3264
|
+
*,
|
|
3265
|
+
instance_id: int | str | None = None,
|
|
3266
|
+
) -> Any:
|
|
3267
|
+
"""[BETA] get communities"""
|
|
3268
|
+
return await self.action(
|
|
3269
|
+
"get-communities",
|
|
3270
|
+
{},
|
|
3271
|
+
instance_id=instance_id,
|
|
3272
|
+
)
|
|
3273
|
+
|
|
3274
|
+
async def get_community_by_id(
|
|
3275
|
+
self,
|
|
3276
|
+
community_id: str,
|
|
3277
|
+
*,
|
|
3278
|
+
instance_id: int | str | None = None,
|
|
3279
|
+
) -> Any:
|
|
3280
|
+
"""[BETA] get community by id"""
|
|
3281
|
+
return await self.action(
|
|
3282
|
+
"get-community-by-id",
|
|
3283
|
+
{
|
|
3284
|
+
"communityId": community_id,
|
|
3285
|
+
},
|
|
3286
|
+
instance_id=instance_id,
|
|
3287
|
+
)
|
|
3288
|
+
|
|
3289
|
+
async def get_community_subgroups(
|
|
3290
|
+
self,
|
|
3291
|
+
community_id: str,
|
|
3292
|
+
*,
|
|
3293
|
+
instance_id: int | str | None = None,
|
|
3294
|
+
) -> Any:
|
|
3295
|
+
"""[BETA] get community subgroups"""
|
|
3296
|
+
return await self.action(
|
|
3297
|
+
"get-community-subgroups",
|
|
3298
|
+
{
|
|
3299
|
+
"communityId": community_id,
|
|
3300
|
+
},
|
|
3301
|
+
instance_id=instance_id,
|
|
3302
|
+
)
|
|
3303
|
+
|
|
3304
|
+
async def send_community_announcement(
|
|
3305
|
+
self,
|
|
3306
|
+
community_id: str,
|
|
3307
|
+
*,
|
|
3308
|
+
target: str | None = None,
|
|
3309
|
+
message: str | None = None,
|
|
3310
|
+
media_url: str | None = None,
|
|
3311
|
+
media_caption: str | None = None,
|
|
3312
|
+
media_name: str | None = None,
|
|
3313
|
+
preview_link: bool | None = None,
|
|
3314
|
+
as_sticker: bool | None = None,
|
|
3315
|
+
as_voice: bool | None = None,
|
|
3316
|
+
as_document: bool | None = None,
|
|
3317
|
+
instance_id: int | str | None = None,
|
|
3318
|
+
) -> Any:
|
|
3319
|
+
"""[BETA] send community announcement"""
|
|
3320
|
+
return await self.action(
|
|
3321
|
+
"send-community-announcement",
|
|
3322
|
+
{
|
|
3323
|
+
"communityId": community_id,
|
|
3324
|
+
"target": target,
|
|
3325
|
+
"message": message,
|
|
3326
|
+
"mediaUrl": media_url,
|
|
3327
|
+
"mediaCaption": media_caption,
|
|
3328
|
+
"mediaName": media_name,
|
|
3329
|
+
"previewLink": preview_link,
|
|
3330
|
+
"asSticker": as_sticker,
|
|
3331
|
+
"asVoice": as_voice,
|
|
3332
|
+
"asDocument": as_document,
|
|
3333
|
+
},
|
|
3334
|
+
instance_id=instance_id,
|
|
3335
|
+
)
|
|
3336
|
+
|
|
3337
|
+
async def link_community_subgroup(
|
|
3338
|
+
self,
|
|
3339
|
+
community_id: str,
|
|
3340
|
+
group_ids: list[Any],
|
|
3341
|
+
*,
|
|
3342
|
+
instance_id: int | str | None = None,
|
|
3343
|
+
) -> Any:
|
|
3344
|
+
"""[BETA] link community subgroup"""
|
|
3345
|
+
return await self.action(
|
|
3346
|
+
"link-community-subgroup",
|
|
3347
|
+
{
|
|
3348
|
+
"communityId": community_id,
|
|
3349
|
+
"groupIds": group_ids,
|
|
3350
|
+
},
|
|
3351
|
+
instance_id=instance_id,
|
|
3352
|
+
)
|
|
3353
|
+
|
|
3354
|
+
async def unlink_community_subgroup(
|
|
3355
|
+
self,
|
|
3356
|
+
community_id: str,
|
|
3357
|
+
group_ids: list[Any],
|
|
3358
|
+
*,
|
|
3359
|
+
remove_orphan_members: bool | None = None,
|
|
3360
|
+
instance_id: int | str | None = None,
|
|
3361
|
+
) -> Any:
|
|
3362
|
+
"""[BETA] unlink community subgroup"""
|
|
3363
|
+
return await self.action(
|
|
3364
|
+
"unlink-community-subgroup",
|
|
3365
|
+
{
|
|
3366
|
+
"communityId": community_id,
|
|
3367
|
+
"groupIds": group_ids,
|
|
3368
|
+
"removeOrphanMembers": remove_orphan_members,
|
|
3369
|
+
},
|
|
3370
|
+
instance_id=instance_id,
|
|
3371
|
+
)
|
|
3372
|
+
|
|
3373
|
+
async def leave_community(
|
|
3374
|
+
self,
|
|
3375
|
+
community_id: str,
|
|
3376
|
+
*,
|
|
3377
|
+
instance_id: int | str | None = None,
|
|
3378
|
+
) -> Any:
|
|
3379
|
+
"""[BETA] leave community"""
|
|
3380
|
+
return await self.action(
|
|
3381
|
+
"leave-community",
|
|
3382
|
+
{
|
|
3383
|
+
"communityId": community_id,
|
|
3384
|
+
},
|
|
3385
|
+
instance_id=instance_id,
|
|
3386
|
+
)
|
|
3387
|
+
|
|
3388
|
+
async def archive_chat(
|
|
3389
|
+
self,
|
|
3390
|
+
chat_id: str,
|
|
3391
|
+
*,
|
|
3392
|
+
instance_id: int | str | None = None,
|
|
3393
|
+
) -> Any:
|
|
3394
|
+
"""archive chat"""
|
|
3395
|
+
return await self.action(
|
|
3396
|
+
"archive-chat",
|
|
3397
|
+
{
|
|
3398
|
+
"chatId": chat_id,
|
|
3399
|
+
},
|
|
3400
|
+
instance_id=instance_id,
|
|
3401
|
+
)
|
|
3402
|
+
|
|
3403
|
+
async def unarchive_chat(
|
|
3404
|
+
self,
|
|
3405
|
+
chat_id: str,
|
|
3406
|
+
*,
|
|
3407
|
+
instance_id: int | str | None = None,
|
|
3408
|
+
) -> Any:
|
|
3409
|
+
"""unarchive chat"""
|
|
3410
|
+
return await self.action(
|
|
3411
|
+
"unarchive-chat",
|
|
3412
|
+
{
|
|
3413
|
+
"chatId": chat_id,
|
|
3414
|
+
},
|
|
3415
|
+
instance_id=instance_id,
|
|
3416
|
+
)
|
|
3417
|
+
|
|
3418
|
+
async def get_labels(
|
|
3419
|
+
self,
|
|
3420
|
+
*,
|
|
3421
|
+
instance_id: int | str | None = None,
|
|
3422
|
+
) -> Any:
|
|
3423
|
+
"""get all labels"""
|
|
3424
|
+
return await self.action(
|
|
3425
|
+
"get-labels",
|
|
3426
|
+
{},
|
|
3427
|
+
instance_id=instance_id,
|
|
3428
|
+
)
|
|
3429
|
+
|
|
3430
|
+
async def get_label_by_id(
|
|
3431
|
+
self,
|
|
3432
|
+
label_id: int,
|
|
3433
|
+
*,
|
|
3434
|
+
instance_id: int | str | None = None,
|
|
3435
|
+
) -> Any:
|
|
3436
|
+
"""get label by id"""
|
|
3437
|
+
return await self.action(
|
|
3438
|
+
"get-label-by-id",
|
|
3439
|
+
{
|
|
3440
|
+
"labelId": label_id,
|
|
3441
|
+
},
|
|
3442
|
+
instance_id=instance_id,
|
|
3443
|
+
)
|
|
3444
|
+
|
|
3445
|
+
async def get_chat_labels(
|
|
3446
|
+
self,
|
|
3447
|
+
chat_id: str,
|
|
3448
|
+
*,
|
|
3449
|
+
instance_id: int | str | None = None,
|
|
3450
|
+
) -> Any:
|
|
3451
|
+
"""get chat labels"""
|
|
3452
|
+
return await self.action(
|
|
3453
|
+
"get-chat-labels",
|
|
3454
|
+
{
|
|
3455
|
+
"chatId": chat_id,
|
|
3456
|
+
},
|
|
3457
|
+
instance_id=instance_id,
|
|
3458
|
+
)
|
|
3459
|
+
|
|
3460
|
+
async def get_chats_by_label_id(
|
|
3461
|
+
self,
|
|
3462
|
+
label_id: int,
|
|
3463
|
+
*,
|
|
3464
|
+
instance_id: int | str | None = None,
|
|
3465
|
+
) -> Any:
|
|
3466
|
+
"""get chats by labelId"""
|
|
3467
|
+
return await self.action(
|
|
3468
|
+
"get-chats-by-label-id",
|
|
3469
|
+
{
|
|
3470
|
+
"labelId": label_id,
|
|
3471
|
+
},
|
|
3472
|
+
instance_id=instance_id,
|
|
3473
|
+
)
|
|
3474
|
+
|
|
3475
|
+
async def change_chat_labels(
|
|
3476
|
+
self,
|
|
3477
|
+
chat_id: str,
|
|
3478
|
+
label_ids: list[Any],
|
|
3479
|
+
*,
|
|
3480
|
+
instance_id: int | str | None = None,
|
|
3481
|
+
) -> Any:
|
|
3482
|
+
"""change chat labels"""
|
|
3483
|
+
return await self.action(
|
|
3484
|
+
"change-chat-labels",
|
|
3485
|
+
{
|
|
3486
|
+
"chatId": chat_id,
|
|
3487
|
+
"labelIds": label_ids,
|
|
3488
|
+
},
|
|
3489
|
+
instance_id=instance_id,
|
|
3490
|
+
)
|
|
3491
|
+
|
|
3492
|
+
async def logout(
|
|
3493
|
+
self,
|
|
3494
|
+
*,
|
|
3495
|
+
instance_id: int | str | None = None,
|
|
3496
|
+
) -> Any:
|
|
3497
|
+
"""logout"""
|
|
3498
|
+
return await self.action(
|
|
3499
|
+
"logout",
|
|
3500
|
+
{},
|
|
3501
|
+
instance_id=instance_id,
|
|
3502
|
+
)
|
|
3503
|
+
|
|
3504
|
+
async def reboot(
|
|
3505
|
+
self,
|
|
3506
|
+
*,
|
|
3507
|
+
instance_id: int | str | None = None,
|
|
3508
|
+
) -> Any:
|
|
3509
|
+
"""reboot instance"""
|
|
3510
|
+
return await self.action(
|
|
3511
|
+
"reboot",
|
|
3512
|
+
{},
|
|
3513
|
+
instance_id=instance_id,
|
|
3514
|
+
)
|
|
3515
|
+
|
|
3516
|
+
async def send_presence_available(
|
|
3517
|
+
self,
|
|
3518
|
+
*,
|
|
3519
|
+
instance_id: int | str | None = None,
|
|
3520
|
+
) -> Any:
|
|
3521
|
+
"""send presence available"""
|
|
3522
|
+
return await self.action(
|
|
3523
|
+
"send-presence-available",
|
|
3524
|
+
{},
|
|
3525
|
+
instance_id=instance_id,
|
|
3526
|
+
)
|
|
3527
|
+
|
|
3528
|
+
async def set_status(
|
|
3529
|
+
self,
|
|
3530
|
+
status: str,
|
|
3531
|
+
*,
|
|
3532
|
+
instance_id: int | str | None = None,
|
|
3533
|
+
) -> Any:
|
|
3534
|
+
"""set status"""
|
|
3535
|
+
return await self.action(
|
|
3536
|
+
"set-status",
|
|
3537
|
+
{
|
|
3538
|
+
"status": status,
|
|
3539
|
+
},
|
|
3540
|
+
instance_id=instance_id,
|
|
3541
|
+
)
|
|
3542
|
+
|
|
3543
|
+
async def set_display_name(
|
|
3544
|
+
self,
|
|
3545
|
+
display_name: str,
|
|
3546
|
+
*,
|
|
3547
|
+
instance_id: int | str | None = None,
|
|
3548
|
+
) -> Any:
|
|
3549
|
+
"""set display name"""
|
|
3550
|
+
return await self.action(
|
|
3551
|
+
"set-display-name",
|
|
3552
|
+
{
|
|
3553
|
+
"displayName": display_name,
|
|
3554
|
+
},
|
|
3555
|
+
instance_id=instance_id,
|
|
3556
|
+
)
|
|
3557
|
+
|
|
3558
|
+
async def request_pairing_code(
|
|
3559
|
+
self,
|
|
3560
|
+
phone_number: str,
|
|
3561
|
+
*,
|
|
3562
|
+
show_notification: bool | None = None,
|
|
3563
|
+
instance_id: int | str | None = None,
|
|
3564
|
+
) -> Any:
|
|
3565
|
+
"""request pairing code"""
|
|
3566
|
+
return await self.action(
|
|
3567
|
+
"request-pairing-code",
|
|
3568
|
+
{
|
|
3569
|
+
"phoneNumber": phone_number,
|
|
3570
|
+
"showNotification": show_notification,
|
|
3571
|
+
},
|
|
3572
|
+
instance_id=instance_id,
|
|
3573
|
+
)
|
|
3574
|
+
|
|
3575
|
+
async def send_typing(
|
|
3576
|
+
self,
|
|
3577
|
+
chat_id: str,
|
|
3578
|
+
*,
|
|
3579
|
+
instance_id: int | str | None = None,
|
|
3580
|
+
) -> Any:
|
|
3581
|
+
"""send typing state"""
|
|
3582
|
+
return await self.action(
|
|
3583
|
+
"send-typing",
|
|
3584
|
+
{
|
|
3585
|
+
"chatId": chat_id,
|
|
3586
|
+
},
|
|
3587
|
+
instance_id=instance_id,
|
|
3588
|
+
)
|
|
3589
|
+
|
|
3590
|
+
async def clear_chat_messages(
|
|
3591
|
+
self,
|
|
3592
|
+
chat_id: str,
|
|
3593
|
+
*,
|
|
3594
|
+
instance_id: int | str | None = None,
|
|
3595
|
+
) -> Any:
|
|
3596
|
+
"""clear chat messages"""
|
|
3597
|
+
return await self.action(
|
|
3598
|
+
"clear-chat-messages",
|
|
3599
|
+
{
|
|
3600
|
+
"chatId": chat_id,
|
|
3601
|
+
},
|
|
3602
|
+
instance_id=instance_id,
|
|
3603
|
+
)
|
|
3604
|
+
|
|
3605
|
+
async def sync_chat_history(
|
|
3606
|
+
self,
|
|
3607
|
+
chat_id: str,
|
|
3608
|
+
*,
|
|
3609
|
+
instance_id: int | str | None = None,
|
|
3610
|
+
) -> Any:
|
|
3611
|
+
"""sync chat history"""
|
|
3612
|
+
return await self.action(
|
|
3613
|
+
"sync-chat-history",
|
|
3614
|
+
{
|
|
3615
|
+
"chatId": chat_id,
|
|
3616
|
+
},
|
|
3617
|
+
instance_id=instance_id,
|
|
3618
|
+
)
|
|
3619
|
+
|
|
3620
|
+
async def send_stop_typing(
|
|
3621
|
+
self,
|
|
3622
|
+
*,
|
|
3623
|
+
chat_id: str | None = None,
|
|
3624
|
+
instance_id: int | str | None = None,
|
|
3625
|
+
) -> Any:
|
|
3626
|
+
"""stop typing indicator"""
|
|
3627
|
+
return await self.action(
|
|
3628
|
+
"send-stop-typing",
|
|
3629
|
+
{
|
|
3630
|
+
"chatId": chat_id,
|
|
3631
|
+
},
|
|
3632
|
+
instance_id=instance_id,
|
|
3633
|
+
)
|
|
3634
|
+
|
|
3635
|
+
async def send_presence_unavailable(
|
|
3636
|
+
self,
|
|
3637
|
+
*,
|
|
3638
|
+
instance_id: int | str | None = None,
|
|
3639
|
+
) -> Any:
|
|
3640
|
+
"""send presence unavailable"""
|
|
3641
|
+
return await self.action(
|
|
3642
|
+
"send-presence-unavailable",
|
|
3643
|
+
{},
|
|
3644
|
+
instance_id=instance_id,
|
|
3645
|
+
)
|
|
3646
|
+
|
|
3647
|
+
async def get_chat_presence(
|
|
3648
|
+
self,
|
|
3649
|
+
chat_id: str,
|
|
3650
|
+
*,
|
|
3651
|
+
wait_for_data: bool | None = None,
|
|
3652
|
+
timeout_ms: int | None = None,
|
|
3653
|
+
instance_id: int | str | None = None,
|
|
3654
|
+
) -> Any:
|
|
3655
|
+
"""[BETA] subscribe to and fetch current presence of a chat"""
|
|
3656
|
+
return await self.action(
|
|
3657
|
+
"get-chat-presence",
|
|
3658
|
+
{
|
|
3659
|
+
"chatId": chat_id,
|
|
3660
|
+
"waitForData": wait_for_data,
|
|
3661
|
+
"timeoutMs": timeout_ms,
|
|
3662
|
+
},
|
|
3663
|
+
instance_id=instance_id,
|
|
3664
|
+
)
|
|
3665
|
+
|
|
3666
|
+
async def get_chat_presence_snapshot(
|
|
3667
|
+
self,
|
|
3668
|
+
chat_id: str,
|
|
3669
|
+
*,
|
|
3670
|
+
instance_id: int | str | None = None,
|
|
3671
|
+
) -> Any:
|
|
3672
|
+
"""[BETA] read cached presence for a chat without subscribing"""
|
|
3673
|
+
return await self.action(
|
|
3674
|
+
"get-chat-presence-snapshot",
|
|
3675
|
+
{
|
|
3676
|
+
"chatId": chat_id,
|
|
3677
|
+
},
|
|
3678
|
+
instance_id=instance_id,
|
|
3679
|
+
)
|
|
3680
|
+
|
|
3681
|
+
async def send_event(
|
|
3682
|
+
self,
|
|
3683
|
+
chat_id: str,
|
|
3684
|
+
name: str,
|
|
3685
|
+
start_time: int | str,
|
|
3686
|
+
*,
|
|
3687
|
+
description: str | None = None,
|
|
3688
|
+
end_time: int | str | None = None,
|
|
3689
|
+
location: str | None = None,
|
|
3690
|
+
call_type: str | None = None,
|
|
3691
|
+
instance_id: int | str | None = None,
|
|
3692
|
+
) -> Any:
|
|
3693
|
+
"""send event message"""
|
|
3694
|
+
return await self.action(
|
|
3695
|
+
"send-event",
|
|
3696
|
+
{
|
|
3697
|
+
"chatId": chat_id,
|
|
3698
|
+
"name": name,
|
|
3699
|
+
"startTime": start_time,
|
|
3700
|
+
"description": description,
|
|
3701
|
+
"endTime": end_time,
|
|
3702
|
+
"location": location,
|
|
3703
|
+
"callType": call_type,
|
|
3704
|
+
},
|
|
3705
|
+
instance_id=instance_id,
|
|
3706
|
+
)
|
|
3707
|
+
|
|
3708
|
+
async def vote_on_poll(
|
|
3709
|
+
self,
|
|
3710
|
+
message_id: str,
|
|
3711
|
+
selected_options: list[Any],
|
|
3712
|
+
*,
|
|
3713
|
+
instance_id: int | str | None = None,
|
|
3714
|
+
) -> Any:
|
|
3715
|
+
"""vote on poll"""
|
|
3716
|
+
return await self.action(
|
|
3717
|
+
"vote-on-poll",
|
|
3718
|
+
{
|
|
3719
|
+
"messageId": message_id,
|
|
3720
|
+
"selectedOptions": selected_options,
|
|
3721
|
+
},
|
|
3722
|
+
instance_id=instance_id,
|
|
3723
|
+
)
|
|
3724
|
+
|
|
3725
|
+
async def edit_scheduled_event(
|
|
3726
|
+
self,
|
|
3727
|
+
message_id: str,
|
|
3728
|
+
*,
|
|
3729
|
+
name: str | None = None,
|
|
3730
|
+
start_time_ts: int | None = None,
|
|
3731
|
+
event_send_options: dict[str, Any] | None = None,
|
|
3732
|
+
instance_id: int | str | None = None,
|
|
3733
|
+
) -> Any:
|
|
3734
|
+
"""edit scheduled event"""
|
|
3735
|
+
return await self.action(
|
|
3736
|
+
"edit-scheduled-event",
|
|
3737
|
+
{
|
|
3738
|
+
"messageId": message_id,
|
|
3739
|
+
"name": name,
|
|
3740
|
+
"startTimeTs": start_time_ts,
|
|
3741
|
+
"eventSendOptions": event_send_options,
|
|
3742
|
+
},
|
|
3743
|
+
instance_id=instance_id,
|
|
3744
|
+
)
|
|
3745
|
+
|
|
3746
|
+
async def get_pinned_messages(
|
|
3747
|
+
self,
|
|
3748
|
+
chat_id: str,
|
|
3749
|
+
*,
|
|
3750
|
+
instance_id: int | str | None = None,
|
|
3751
|
+
) -> Any:
|
|
3752
|
+
"""get pinned messages"""
|
|
3753
|
+
return await self.action(
|
|
3754
|
+
"get-pinned-messages",
|
|
3755
|
+
{
|
|
3756
|
+
"chatId": chat_id,
|
|
3757
|
+
},
|
|
3758
|
+
instance_id=instance_id,
|
|
3759
|
+
)
|
|
3760
|
+
|
|
3761
|
+
async def set_device_name(
|
|
3762
|
+
self,
|
|
3763
|
+
*,
|
|
3764
|
+
device_name: str | None = None,
|
|
3765
|
+
browser_name: str | None = None,
|
|
3766
|
+
instance_id: int | str | None = None,
|
|
3767
|
+
) -> Any:
|
|
3768
|
+
"""set device name"""
|
|
3769
|
+
return await self.action(
|
|
3770
|
+
"set-device-name",
|
|
3771
|
+
{
|
|
3772
|
+
"deviceName": device_name,
|
|
3773
|
+
"browserName": browser_name,
|
|
3774
|
+
},
|
|
3775
|
+
instance_id=instance_id,
|
|
3776
|
+
)
|
|
3777
|
+
|
|
3778
|
+
async def create_call_link(
|
|
3779
|
+
self,
|
|
3780
|
+
start_time: int | str,
|
|
3781
|
+
call_type: str,
|
|
3782
|
+
*,
|
|
3783
|
+
instance_id: int | str | None = None,
|
|
3784
|
+
) -> Any:
|
|
3785
|
+
"""create call link"""
|
|
3786
|
+
return await self.action(
|
|
3787
|
+
"create-call-link",
|
|
3788
|
+
{
|
|
3789
|
+
"startTime": start_time,
|
|
3790
|
+
"callType": call_type,
|
|
3791
|
+
},
|
|
3792
|
+
instance_id=instance_id,
|
|
3793
|
+
)
|
|
3794
|
+
|
|
3795
|
+
async def send_event_response(
|
|
3796
|
+
self,
|
|
3797
|
+
event_response: int,
|
|
3798
|
+
event_message_id: str,
|
|
3799
|
+
*,
|
|
3800
|
+
instance_id: int | str | None = None,
|
|
3801
|
+
) -> Any:
|
|
3802
|
+
"""send event response"""
|
|
3803
|
+
return await self.action(
|
|
3804
|
+
"send-event-response",
|
|
3805
|
+
{
|
|
3806
|
+
"eventResponse": event_response,
|
|
3807
|
+
"eventMessageId": event_message_id,
|
|
3808
|
+
},
|
|
3809
|
+
instance_id=instance_id,
|
|
3810
|
+
)
|
|
3811
|
+
|
|
3812
|
+
async def revoke_status_message(
|
|
3813
|
+
self,
|
|
3814
|
+
message_id: str,
|
|
3815
|
+
*,
|
|
3816
|
+
instance_id: int | str | None = None,
|
|
3817
|
+
) -> Any:
|
|
3818
|
+
"""revoke status message"""
|
|
3819
|
+
return await self.action(
|
|
3820
|
+
"revoke-status-message",
|
|
3821
|
+
{
|
|
3822
|
+
"messageId": message_id,
|
|
3823
|
+
},
|
|
3824
|
+
instance_id=instance_id,
|
|
3825
|
+
)
|
|
3826
|
+
|
|
3827
|
+
async def add_customer_note(
|
|
3828
|
+
self,
|
|
3829
|
+
chat_id: str,
|
|
3830
|
+
note: str,
|
|
3831
|
+
*,
|
|
3832
|
+
instance_id: int | str | None = None,
|
|
3833
|
+
) -> Any:
|
|
3834
|
+
"""add customer note"""
|
|
3835
|
+
return await self.action(
|
|
3836
|
+
"add-customer-note",
|
|
3837
|
+
{
|
|
3838
|
+
"chatId": chat_id,
|
|
3839
|
+
"note": note,
|
|
3840
|
+
},
|
|
3841
|
+
instance_id=instance_id,
|
|
3842
|
+
)
|
|
3843
|
+
|
|
3844
|
+
async def get_customer_note(
|
|
3845
|
+
self,
|
|
3846
|
+
chat_id: str,
|
|
3847
|
+
*,
|
|
3848
|
+
instance_id: int | str | None = None,
|
|
3849
|
+
) -> Any:
|
|
3850
|
+
"""get customer note"""
|
|
3851
|
+
return await self.action(
|
|
3852
|
+
"get-customer-note",
|
|
3853
|
+
{
|
|
3854
|
+
"chatId": chat_id,
|
|
3855
|
+
},
|
|
3856
|
+
instance_id=instance_id,
|
|
3857
|
+
)
|
|
3858
|
+
|
|
3859
|
+
async def get_broadcast(
|
|
3860
|
+
self,
|
|
3861
|
+
contact_id: str,
|
|
3862
|
+
*,
|
|
3863
|
+
instance_id: int | str | None = None,
|
|
3864
|
+
) -> Any:
|
|
3865
|
+
"""get broadcast"""
|
|
3866
|
+
return await self.action(
|
|
3867
|
+
"get-broadcast",
|
|
3868
|
+
{
|
|
3869
|
+
"contactId": contact_id,
|
|
3870
|
+
},
|
|
3871
|
+
instance_id=instance_id,
|
|
3872
|
+
)
|
|
3873
|
+
|
|
3874
|
+
async def revoke_status(
|
|
3875
|
+
self,
|
|
3876
|
+
message_id: str,
|
|
3877
|
+
*,
|
|
3878
|
+
instance_id: int | str | None = None,
|
|
3879
|
+
) -> Any:
|
|
3880
|
+
"""revoke status"""
|
|
3881
|
+
return await self.action(
|
|
3882
|
+
"revoke-status",
|
|
3883
|
+
{
|
|
3884
|
+
"messageId": message_id,
|
|
3885
|
+
},
|
|
3886
|
+
instance_id=instance_id,
|
|
3887
|
+
)
|
|
3888
|
+
|
|
3889
|
+
async def get_privacy_settings(
|
|
3890
|
+
self,
|
|
3891
|
+
*,
|
|
3892
|
+
instance_id: int | str | None = None,
|
|
3893
|
+
) -> Any:
|
|
3894
|
+
"""[BETA] get privacy settings"""
|
|
3895
|
+
return await self.action(
|
|
3896
|
+
"get-privacy-settings",
|
|
3897
|
+
{},
|
|
3898
|
+
instance_id=instance_id,
|
|
3899
|
+
)
|
|
3900
|
+
|
|
3901
|
+
async def set_privacy_setting(
|
|
3902
|
+
self,
|
|
3903
|
+
category: str,
|
|
3904
|
+
value: str,
|
|
3905
|
+
*,
|
|
3906
|
+
disallowed_list: list[Any] | None = None,
|
|
3907
|
+
instance_id: int | str | None = None,
|
|
3908
|
+
) -> Any:
|
|
3909
|
+
"""[BETA] set privacy setting"""
|
|
3910
|
+
return await self.action(
|
|
3911
|
+
"set-privacy-setting",
|
|
3912
|
+
{
|
|
3913
|
+
"category": category,
|
|
3914
|
+
"value": value,
|
|
3915
|
+
"disallowedList": disallowed_list,
|
|
3916
|
+
},
|
|
3917
|
+
instance_id=instance_id,
|
|
3918
|
+
)
|
|
3919
|
+
|
|
3920
|
+
async def get_disappearing_messages(
|
|
3921
|
+
self,
|
|
3922
|
+
chat_id: str,
|
|
3923
|
+
*,
|
|
3924
|
+
instance_id: int | str | None = None,
|
|
3925
|
+
) -> Any:
|
|
3926
|
+
"""[BETA] get disappearing messages"""
|
|
3927
|
+
return await self.action(
|
|
3928
|
+
"get-disappearing-messages",
|
|
3929
|
+
{
|
|
3930
|
+
"chatId": chat_id,
|
|
3931
|
+
},
|
|
3932
|
+
instance_id=instance_id,
|
|
3933
|
+
)
|
|
3934
|
+
|
|
3935
|
+
async def set_disappearing_messages(
|
|
3936
|
+
self,
|
|
3937
|
+
chat_id: str,
|
|
3938
|
+
duration: int,
|
|
3939
|
+
*,
|
|
3940
|
+
instance_id: int | str | None = None,
|
|
3941
|
+
) -> Any:
|
|
3942
|
+
"""[BETA] set disappearing messages"""
|
|
3943
|
+
return await self.action(
|
|
3944
|
+
"set-disappearing-messages",
|
|
3945
|
+
{
|
|
3946
|
+
"chatId": chat_id,
|
|
3947
|
+
"duration": duration,
|
|
3948
|
+
},
|
|
3949
|
+
instance_id=instance_id,
|
|
3950
|
+
)
|
|
3951
|
+
|
|
3952
|
+
async def get_disappearing_durations(
|
|
3953
|
+
self,
|
|
3954
|
+
*,
|
|
3955
|
+
instance_id: int | str | None = None,
|
|
3956
|
+
) -> Any:
|
|
3957
|
+
"""[BETA] get disappearing durations"""
|
|
3958
|
+
return await self.action(
|
|
3959
|
+
"get-disappearing-durations",
|
|
3960
|
+
{},
|
|
3961
|
+
instance_id=instance_id,
|
|
3962
|
+
)
|
|
3963
|
+
|
|
3964
|
+
async def get_business_profile(
|
|
3965
|
+
self,
|
|
3966
|
+
*,
|
|
3967
|
+
user_id: str | None = None,
|
|
3968
|
+
with_compliance: bool | None = None,
|
|
3969
|
+
instance_id: int | str | None = None,
|
|
3970
|
+
) -> Any:
|
|
3971
|
+
"""[BETA] get business profile"""
|
|
3972
|
+
return await self.action(
|
|
3973
|
+
"get-business-profile",
|
|
3974
|
+
{
|
|
3975
|
+
"userId": user_id,
|
|
3976
|
+
"withCompliance": with_compliance,
|
|
3977
|
+
},
|
|
3978
|
+
instance_id=instance_id,
|
|
3979
|
+
)
|
|
3980
|
+
|
|
3981
|
+
async def get_business_categories(
|
|
3982
|
+
self,
|
|
3983
|
+
*,
|
|
3984
|
+
parent_id: str | None = None,
|
|
3985
|
+
instance_id: int | str | None = None,
|
|
3986
|
+
) -> Any:
|
|
3987
|
+
"""[BETA] get business categories"""
|
|
3988
|
+
return await self.action(
|
|
3989
|
+
"get-business-categories",
|
|
3990
|
+
{
|
|
3991
|
+
"parentId": parent_id,
|
|
3992
|
+
},
|
|
3993
|
+
instance_id=instance_id,
|
|
3994
|
+
)
|
|
3995
|
+
|
|
3996
|
+
async def set_business_profile(
|
|
3997
|
+
self,
|
|
3998
|
+
*,
|
|
3999
|
+
description: str | None = None,
|
|
4000
|
+
email: str | None = None,
|
|
4001
|
+
address: str | None = None,
|
|
4002
|
+
latitude: float | None = None,
|
|
4003
|
+
longitude: float | None = None,
|
|
4004
|
+
website: list[Any] | None = None,
|
|
4005
|
+
categories: list[Any] | None = None,
|
|
4006
|
+
business_hours: dict[str, Any] | None = None,
|
|
4007
|
+
price_tier: str | None = None,
|
|
4008
|
+
service_areas: list[Any] | None = None,
|
|
4009
|
+
instance_id: int | str | None = None,
|
|
4010
|
+
) -> Any:
|
|
4011
|
+
"""[BETA] set business profile"""
|
|
4012
|
+
return await self.action(
|
|
4013
|
+
"set-business-profile",
|
|
4014
|
+
{
|
|
4015
|
+
"description": description,
|
|
4016
|
+
"email": email,
|
|
4017
|
+
"address": address,
|
|
4018
|
+
"latitude": latitude,
|
|
4019
|
+
"longitude": longitude,
|
|
4020
|
+
"website": website,
|
|
4021
|
+
"categories": categories,
|
|
4022
|
+
"businessHours": business_hours,
|
|
4023
|
+
"priceTier": price_tier,
|
|
4024
|
+
"serviceAreas": service_areas,
|
|
4025
|
+
},
|
|
4026
|
+
instance_id=instance_id,
|
|
4027
|
+
)
|
|
4028
|
+
|
|
4029
|
+
async def get_quick_replies(
|
|
4030
|
+
self,
|
|
4031
|
+
*,
|
|
4032
|
+
instance_id: int | str | None = None,
|
|
4033
|
+
) -> Any:
|
|
4034
|
+
"""[BETA] get quick replies"""
|
|
4035
|
+
return await self.action(
|
|
4036
|
+
"get-quick-replies",
|
|
4037
|
+
{},
|
|
4038
|
+
instance_id=instance_id,
|
|
4039
|
+
)
|
|
4040
|
+
|
|
4041
|
+
async def create_quick_reply(
|
|
4042
|
+
self,
|
|
4043
|
+
shortcut: str,
|
|
4044
|
+
message: str,
|
|
4045
|
+
*,
|
|
4046
|
+
keywords: list[Any] | None = None,
|
|
4047
|
+
instance_id: int | str | None = None,
|
|
4048
|
+
) -> Any:
|
|
4049
|
+
"""[BETA] create quick reply"""
|
|
4050
|
+
return await self.action(
|
|
4051
|
+
"create-quick-reply",
|
|
4052
|
+
{
|
|
4053
|
+
"shortcut": shortcut,
|
|
4054
|
+
"message": message,
|
|
4055
|
+
"keywords": keywords,
|
|
4056
|
+
},
|
|
4057
|
+
instance_id=instance_id,
|
|
4058
|
+
)
|
|
4059
|
+
|
|
4060
|
+
async def update_quick_reply(
|
|
4061
|
+
self,
|
|
4062
|
+
id: str,
|
|
4063
|
+
*,
|
|
4064
|
+
shortcut: str | None = None,
|
|
4065
|
+
message: str | None = None,
|
|
4066
|
+
keywords: list[Any] | None = None,
|
|
4067
|
+
instance_id: int | str | None = None,
|
|
4068
|
+
) -> Any:
|
|
4069
|
+
"""[BETA] update quick reply"""
|
|
4070
|
+
return await self.action(
|
|
4071
|
+
"update-quick-reply",
|
|
4072
|
+
{
|
|
4073
|
+
"id": id,
|
|
4074
|
+
"shortcut": shortcut,
|
|
4075
|
+
"message": message,
|
|
4076
|
+
"keywords": keywords,
|
|
4077
|
+
},
|
|
4078
|
+
instance_id=instance_id,
|
|
4079
|
+
)
|
|
4080
|
+
|
|
4081
|
+
async def delete_quick_reply(
|
|
4082
|
+
self,
|
|
4083
|
+
id: str,
|
|
4084
|
+
*,
|
|
4085
|
+
instance_id: int | str | None = None,
|
|
4086
|
+
) -> Any:
|
|
4087
|
+
"""[BETA] delete quick reply"""
|
|
4088
|
+
return await self.action(
|
|
4089
|
+
"delete-quick-reply",
|
|
4090
|
+
{
|
|
4091
|
+
"id": id,
|
|
4092
|
+
},
|
|
4093
|
+
instance_id=instance_id,
|
|
4094
|
+
)
|