@@ -29,7 +29,7 @@ <h1 class="title">Module <code>livechat.agent.rtm.api.v33</code></h1>
2929</ summary >
3030< pre > < code class ="python "> ''' Module containing Agent RTM API client implementation for v3.3. '''
3131
32- from typing import Any
32+ from typing import Any, Optional
3333
3434from livechat.utils.helpers import prepare_payload
3535from livechat.utils.structures import RtmResponse
@@ -385,6 +385,7 @@ <h1 class="title">Module <code>livechat.agent.rtm.api.v33</code></h1>
385385 chat_id: str = None,
386386 event: dict = None,
387387 attach_to_last_thread: bool = None,
388+ author_id: Optional[str] = None,
388389 payload: dict = None) -> RtmResponse:
389390 ''' Sends an Event object.
390391
@@ -393,16 +394,20 @@ <h1 class="title">Module <code>livechat.agent.rtm.api.v33</code></h1>
393394 event (dict): Event object.
394395 attach_to_last_thread (bool): Flag which states if event object should be added to last thread.
395396 The flag is ignored for active chats.
397+ author_id (optional str): Provide if the event should be sent on behalf of a bot.
396398 payload (dict): Custom payload to be used as request's data.
397399 It overrides all other parameters provided for the method.
398400
399401 Returns:
400402 RtmResponse: RTM response structure (`request_id`, `action`,
401403 `type`, `success` and `payload` properties)
402404 '''
405+ opts = {}
406+ if author_id:
407+ opts['author_id'] = author_id
403408 if payload is None:
404409 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 })
406411
407412 def send_rich_message_postback(self,
408413 chat_id: str = None,
@@ -1394,6 +1399,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
13941399 chat_id: str = None,
13951400 event: dict = None,
13961401 attach_to_last_thread: bool = None,
1402+ author_id: Optional[str] = None,
13971403 payload: dict = None) -> RtmResponse:
13981404 ''' Sends an Event object.
13991405
@@ -1402,16 +1408,20 @@ <h2 class="section-title" id="header-classes">Classes</h2>
14021408 event (dict): Event object.
14031409 attach_to_last_thread (bool): Flag which states if event object should be added to last thread.
14041410 The flag is ignored for active chats.
1411+ author_id (optional str): Provide if the event should be sent on behalf of a bot.
14051412 payload (dict): Custom payload to be used as request's data.
14061413 It overrides all other parameters provided for the method.
14071414
14081415 Returns:
14091416 RtmResponse: RTM response structure (`request_id`, `action`,
14101417 `type`, `success` and `payload` properties)
14111418 '''
1419+ opts = {}
1420+ if author_id:
1421+ opts['author_id'] = author_id
14121422 if payload is None:
14131423 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 })
14151425
14161426 def send_rich_message_postback(self,
14171427 chat_id: str = None,
@@ -3411,7 +3421,7 @@ <h2 id="returns">Returns</h2>
34113421</ details >
34123422</ dd >
34133423< 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 >
34153425</ code > </ dt >
34163426< dd >
34173427< div class ="desc "> < p > Sends an Event object.</ p >
@@ -3424,6 +3434,8 @@ <h2 id="args">Args</h2>
34243434< dt > < strong > < code > attach_to_last_thread</ code > </ strong > : < code > bool</ code > </ dt >
34253435< dd > Flag which states if event object should be added to last thread.
34263436The 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 >
34273439< dt > < strong > < code > payload</ code > </ strong > : < code > dict</ code > </ dt >
34283440< dd > Custom payload to be used as request's data.
34293441It overrides all other parameters provided for the method.</ dd >
@@ -3442,6 +3454,7 @@ <h2 id="returns">Returns</h2>
34423454 chat_id: str = None,
34433455 event: dict = None,
34443456 attach_to_last_thread: bool = None,
3457+ author_id: Optional[str] = None,
34453458 payload: dict = None) -> RtmResponse:
34463459 ''' Sends an Event object.
34473460
@@ -3450,16 +3463,20 @@ <h2 id="returns">Returns</h2>
34503463 event (dict): Event object.
34513464 attach_to_last_thread (bool): Flag which states if event object should be added to last thread.
34523465 The flag is ignored for active chats.
3466+ author_id (optional str): Provide if the event should be sent on behalf of a bot.
34533467 payload (dict): Custom payload to be used as request's data.
34543468 It overrides all other parameters provided for the method.
34553469
34563470 Returns:
34573471 RtmResponse: RTM response structure (`request_id`, `action`,
34583472 `type`, `success` and `payload` properties)
34593473 '''
3474+ opts = {}
3475+ if author_id:
3476+ opts['author_id'] = author_id
34603477 if payload is None:
34613478 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 >
34633480</ details >
34643481</ dd >
34653482< 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
42524269< p > Generated by < a href ="https://pdoc3.github.io/pdoc " title ="pdoc: Python API documentation generator "> < cite > pdoc</ cite > 0.10.0</ a > .</ p >
42534270</ footer >
42544271</ body >
4255- </ html >
4272+ </ html >
0 commit comments