@@ -29,7 +29,7 @@ <h1 class="title">Module <code>livechat.agent.rtm.api.v33</code></h1>
29
29
</ summary >
30
30
< pre > < code class ="python "> ''' Module containing Agent RTM API client implementation for v3.3. '''
31
31
32
- from typing import Any
32
+ from typing import Any, Optional
33
33
34
34
from livechat.utils.helpers import prepare_payload
35
35
from livechat.utils.structures import RtmResponse
@@ -385,6 +385,7 @@ <h1 class="title">Module <code>livechat.agent.rtm.api.v33</code></h1>
385
385
chat_id: str = None,
386
386
event: dict = None,
387
387
attach_to_last_thread: bool = None,
388
+ author_id: Optional[str] = None,
388
389
payload: dict = None) -> RtmResponse:
389
390
''' Sends an Event object.
390
391
@@ -393,16 +394,20 @@ <h1 class="title">Module <code>livechat.agent.rtm.api.v33</code></h1>
393
394
event (dict): Event object.
394
395
attach_to_last_thread (bool): Flag which states if event object should be added to last thread.
395
396
The flag is ignored for active chats.
397
+ author_id (optional str): Provide if the event should be sent on behalf of a bot.
396
398
payload (dict): Custom payload to be used as request's data.
397
399
It overrides all other parameters provided for the method.
398
400
399
401
Returns:
400
402
RtmResponse: RTM response structure (`request_id`, `action`,
401
403
`type`, `success` and `payload` properties)
402
404
'''
405
+ opts = {}
406
+ if author_id:
407
+ opts['author_id'] = author_id
403
408
if payload is None:
404
409
payload = prepare_payload(locals())
405
- return self.ws.send({'action': 'send_event', 'payload': payload})
410
+ return self.ws.send({'action': 'send_event', 'payload': payload, **opts })
406
411
407
412
def send_rich_message_postback(self,
408
413
chat_id: str = None,
@@ -1394,6 +1399,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
1394
1399
chat_id: str = None,
1395
1400
event: dict = None,
1396
1401
attach_to_last_thread: bool = None,
1402
+ author_id: Optional[str] = None,
1397
1403
payload: dict = None) -> RtmResponse:
1398
1404
''' Sends an Event object.
1399
1405
@@ -1402,16 +1408,20 @@ <h2 class="section-title" id="header-classes">Classes</h2>
1402
1408
event (dict): Event object.
1403
1409
attach_to_last_thread (bool): Flag which states if event object should be added to last thread.
1404
1410
The flag is ignored for active chats.
1411
+ author_id (optional str): Provide if the event should be sent on behalf of a bot.
1405
1412
payload (dict): Custom payload to be used as request's data.
1406
1413
It overrides all other parameters provided for the method.
1407
1414
1408
1415
Returns:
1409
1416
RtmResponse: RTM response structure (`request_id`, `action`,
1410
1417
`type`, `success` and `payload` properties)
1411
1418
'''
1419
+ opts = {}
1420
+ if author_id:
1421
+ opts['author_id'] = author_id
1412
1422
if payload is None:
1413
1423
payload = prepare_payload(locals())
1414
- return self.ws.send({'action': 'send_event', 'payload': payload})
1424
+ return self.ws.send({'action': 'send_event', 'payload': payload, **opts })
1415
1425
1416
1426
def send_rich_message_postback(self,
1417
1427
chat_id: str = None,
@@ -3411,7 +3421,7 @@ <h2 id="returns">Returns</h2>
3411
3421
</ details >
3412
3422
</ dd >
3413
3423
< dt id ="livechat.agent.rtm.api.v33.AgentRtmV33.send_event "> < code class ="name flex ">
3414
- < span > def < span class ="ident "> send_event</ span > </ span > (< span > self, chat_id: str = None, event: dict = None, attach_to_last_thread: bool = None, payload: dict = None) ‑> livechat.utils.structures.RtmResponse</ span >
3424
+ < span > def < span class ="ident "> send_event</ span > </ span > (< span > self, chat_id: str = None, event: dict = None, attach_to_last_thread: bool = None, author_id: Optional[str] = None, payload: dict = None) ‑> livechat.utils.structures.RtmResponse</ span >
3415
3425
</ code > </ dt >
3416
3426
< dd >
3417
3427
< div class ="desc "> < p > Sends an Event object.</ p >
@@ -3424,6 +3434,8 @@ <h2 id="args">Args</h2>
3424
3434
< dt > < strong > < code > attach_to_last_thread</ code > </ strong > : < code > bool</ code > </ dt >
3425
3435
< dd > Flag which states if event object should be added to last thread.
3426
3436
The flag is ignored for active chats.</ dd >
3437
+ < dt > < strong > < code > author_id</ code > </ strong > : < code > optional str</ code > </ dt >
3438
+ < dd > Provide if the event should be sent on behalf of a bot.</ dd >
3427
3439
< dt > < strong > < code > payload</ code > </ strong > : < code > dict</ code > </ dt >
3428
3440
< dd > Custom payload to be used as request's data.
3429
3441
It overrides all other parameters provided for the method.</ dd >
@@ -3442,6 +3454,7 @@ <h2 id="returns">Returns</h2>
3442
3454
chat_id: str = None,
3443
3455
event: dict = None,
3444
3456
attach_to_last_thread: bool = None,
3457
+ author_id: Optional[str] = None,
3445
3458
payload: dict = None) -> RtmResponse:
3446
3459
''' Sends an Event object.
3447
3460
@@ -3450,16 +3463,20 @@ <h2 id="returns">Returns</h2>
3450
3463
event (dict): Event object.
3451
3464
attach_to_last_thread (bool): Flag which states if event object should be added to last thread.
3452
3465
The flag is ignored for active chats.
3466
+ author_id (optional str): Provide if the event should be sent on behalf of a bot.
3453
3467
payload (dict): Custom payload to be used as request's data.
3454
3468
It overrides all other parameters provided for the method.
3455
3469
3456
3470
Returns:
3457
3471
RtmResponse: RTM response structure (`request_id`, `action`,
3458
3472
`type`, `success` and `payload` properties)
3459
3473
'''
3474
+ opts = {}
3475
+ if author_id:
3476
+ opts['author_id'] = author_id
3460
3477
if payload is None:
3461
3478
payload = prepare_payload(locals())
3462
- return self.ws.send({'action': 'send_event', 'payload': payload})</ code > </ pre >
3479
+ return self.ws.send({'action': 'send_event', 'payload': payload, **opts })</ code > </ pre >
3463
3480
</ details >
3464
3481
</ dd >
3465
3482
< dt id ="livechat.agent.rtm.api.v33.AgentRtmV33.send_rich_message_postback "> < code class ="name flex ">
@@ -4252,4 +4269,4 @@ <h4><code><a title="livechat.agent.rtm.api.v33.AgentRtmV33" href="#livechat.agen
4252
4269
< p > Generated by < a href ="https://pdoc3.github.io/pdoc " title ="pdoc: Python API documentation generator "> < cite > pdoc</ cite > 0.10.0</ a > .</ p >
4253
4270
</ footer >
4254
4271
</ body >
4255
- </ html >
4272
+ </ html >
0 commit comments