@@ -34,16 +34,14 @@ <h1 class="title">Module <code>livechat.agent.rtm.client</code></h1>
34
34
35
35
import typing
36
36
from abc import ABCMeta
37
- from configparser import ConfigParser
38
37
38
+ from livechat.config import CONFIG
39
39
from livechat.utils.helpers import prepare_payload
40
40
from livechat.utils.structures import RtmResponse
41
41
from livechat.utils.ws_client import WebsocketClient
42
42
43
- config = ConfigParser()
44
- config.read('configs/main.ini')
45
- stable_version = config.get('api', 'stable')
46
- api_url = config.get('api', 'url')
43
+ stable_version = CONFIG.get('stable')
44
+ api_url = CONFIG.get('url')
47
45
48
46
49
47
class AgentRTM:
@@ -273,7 +271,9 @@ <h1 class="title">Module <code>livechat.agent.rtm.client</code></h1>
273
271
payload = prepare_payload(locals())
274
272
return self.ws.send({'action': 'follow_chat', 'payload': payload})
275
273
276
- def unfollow_chat(self, id: str = None, payload: dict = None) -> RtmResponse:
274
+ def unfollow_chat(self,
275
+ id: str = None,
276
+ payload: dict = None) -> RtmResponse:
277
277
''' Removes the requester from the chat followers.
278
278
279
279
Args:
@@ -630,7 +630,9 @@ <h1 class="title">Module <code>livechat.agent.rtm.client</code></h1>
630
630
631
631
# Customers
632
632
633
- def get_customer(self, id: str = None, payload: dict = None) -> RtmResponse:
633
+ def get_customer(self,
634
+ id: str = None,
635
+ payload: dict = None) -> RtmResponse:
634
636
''' Returns the info about the Customer with a given ID.
635
637
636
638
Args:
@@ -747,7 +749,9 @@ <h1 class="title">Module <code>livechat.agent.rtm.client</code></h1>
747
749
payload = prepare_payload(locals())
748
750
return self.ws.send({'action': 'ban_customer', 'payload': payload})
749
751
750
- def follow_customer(self, id: str = None, payload: dict = None) -> RtmResponse:
752
+ def follow_customer(self,
753
+ id: str = None,
754
+ payload: dict = None) -> RtmResponse:
751
755
''' Marks a customer as followed.
752
756
753
757
Args:
@@ -763,7 +767,9 @@ <h1 class="title">Module <code>livechat.agent.rtm.client</code></h1>
763
767
payload = prepare_payload(locals())
764
768
return self.ws.send({'action': 'follow_customer', 'payload': payload})
765
769
766
- def unfollow_customer(self, id: str = None, payload: dict = None) -> RtmResponse:
770
+ def unfollow_customer(self,
771
+ id: str = None,
772
+ payload: dict = None) -> RtmResponse:
767
773
''' Removes the agent from the list of customer's followers.
768
774
769
775
Args:
@@ -871,7 +877,9 @@ <h1 class="title">Module <code>livechat.agent.rtm.client</code></h1>
871
877
'payload': payload
872
878
})
873
879
874
- def set_away_status(self, away: bool = None, payload: dict = None) -> RtmResponse:
880
+ def set_away_status(self,
881
+ away: bool = None,
882
+ payload: dict = None) -> RtmResponse:
875
883
''' Sets an Agent's connection to the away state.
876
884
877
885
Args:
@@ -1024,7 +1032,9 @@ <h1 class="title">Module <code>livechat.agent.rtm.client</code></h1>
1024
1032
1025
1033
# Chats
1026
1034
1027
- def deactivate_chat(self, id: str = None, payload: dict = None) -> RtmResponse:
1035
+ def deactivate_chat(self,
1036
+ id: str = None,
1037
+ payload: dict = None) -> RtmResponse:
1028
1038
''' Deactivates a chat by closing the currently open thread.
1029
1039
1030
1040
Args:
@@ -1316,7 +1326,9 @@ <h2 id="raises">Raises</h2>
1316
1326
1317
1327
# Chats
1318
1328
1319
- def deactivate_chat(self, id: str = None, payload: dict = None) -> RtmResponse:
1329
+ def deactivate_chat(self,
1330
+ id: str = None,
1331
+ payload: dict = None) -> RtmResponse:
1320
1332
''' Deactivates a chat by closing the currently open thread.
1321
1333
1322
1334
Args:
@@ -1572,7 +1584,9 @@ <h2 id="returns">Returns</h2>
1572
1584
< summary >
1573
1585
< span > Expand source code</ span >
1574
1586
</ summary >
1575
- < pre > < code class ="python "> def deactivate_chat(self, id: str = None, payload: dict = None) -> RtmResponse:
1587
+ < pre > < code class ="python "> def deactivate_chat(self,
1588
+ id: str = None,
1589
+ payload: dict = None) -> RtmResponse:
1576
1590
''' Deactivates a chat by closing the currently open thread.
1577
1591
1578
1592
Args:
@@ -2236,7 +2250,9 @@ <h3>Inherited members</h3>
2236
2250
payload = prepare_payload(locals())
2237
2251
return self.ws.send({'action': 'follow_chat', 'payload': payload})
2238
2252
2239
- def unfollow_chat(self, id: str = None, payload: dict = None) -> RtmResponse:
2253
+ def unfollow_chat(self,
2254
+ id: str = None,
2255
+ payload: dict = None) -> RtmResponse:
2240
2256
''' Removes the requester from the chat followers.
2241
2257
2242
2258
Args:
@@ -2593,7 +2609,9 @@ <h3>Inherited members</h3>
2593
2609
2594
2610
# Customers
2595
2611
2596
- def get_customer(self, id: str = None, payload: dict = None) -> RtmResponse:
2612
+ def get_customer(self,
2613
+ id: str = None,
2614
+ payload: dict = None) -> RtmResponse:
2597
2615
''' Returns the info about the Customer with a given ID.
2598
2616
2599
2617
Args:
@@ -2710,7 +2728,9 @@ <h3>Inherited members</h3>
2710
2728
payload = prepare_payload(locals())
2711
2729
return self.ws.send({'action': 'ban_customer', 'payload': payload})
2712
2730
2713
- def follow_customer(self, id: str = None, payload: dict = None) -> RtmResponse:
2731
+ def follow_customer(self,
2732
+ id: str = None,
2733
+ payload: dict = None) -> RtmResponse:
2714
2734
''' Marks a customer as followed.
2715
2735
2716
2736
Args:
@@ -2726,7 +2746,9 @@ <h3>Inherited members</h3>
2726
2746
payload = prepare_payload(locals())
2727
2747
return self.ws.send({'action': 'follow_customer', 'payload': payload})
2728
2748
2729
- def unfollow_customer(self, id: str = None, payload: dict = None) -> RtmResponse:
2749
+ def unfollow_customer(self,
2750
+ id: str = None,
2751
+ payload: dict = None) -> RtmResponse:
2730
2752
''' Removes the agent from the list of customer's followers.
2731
2753
2732
2754
Args:
@@ -2834,7 +2856,9 @@ <h3>Inherited members</h3>
2834
2856
'payload': payload
2835
2857
})
2836
2858
2837
- def set_away_status(self, away: bool = None, payload: dict = None) -> RtmResponse:
2859
+ def set_away_status(self,
2860
+ away: bool = None,
2861
+ payload: dict = None) -> RtmResponse:
2838
2862
''' Sets an Agent's connection to the away state.
2839
2863
2840
2864
Args:
@@ -3496,7 +3520,9 @@ <h2 id="returns">Returns</h2>
3496
3520
< summary >
3497
3521
< span > Expand source code</ span >
3498
3522
</ summary >
3499
- < pre > < code class ="python "> def follow_customer(self, id: str = None, payload: dict = None) -> RtmResponse:
3523
+ < pre > < code class ="python "> def follow_customer(self,
3524
+ id: str = None,
3525
+ payload: dict = None) -> RtmResponse:
3500
3526
''' Marks a customer as followed.
3501
3527
3502
3528
Args:
@@ -3582,7 +3608,9 @@ <h2 id="returns">Returns</h2>
3582
3608
< summary >
3583
3609
< span > Expand source code</ span >
3584
3610
</ summary >
3585
- < pre > < code class ="python "> def get_customer(self, id: str = None, payload: dict = None) -> RtmResponse:
3611
+ < pre > < code class ="python "> def get_customer(self,
3612
+ id: str = None,
3613
+ payload: dict = None) -> RtmResponse:
3586
3614
''' Returns the info about the Customer with a given ID.
3587
3615
3588
3616
Args:
@@ -4464,7 +4492,9 @@ <h2 id="returns">Returns</h2>
4464
4492
< summary >
4465
4493
< span > Expand source code</ span >
4466
4494
</ summary >
4467
- < pre > < code class ="python "> def set_away_status(self, away: bool = None, payload: dict = None) -> RtmResponse:
4495
+ < pre > < code class ="python "> def set_away_status(self,
4496
+ away: bool = None,
4497
+ payload: dict = None) -> RtmResponse:
4468
4498
''' Sets an Agent's connection to the away state.
4469
4499
4470
4500
Args:
@@ -4715,7 +4745,9 @@ <h2 id="returns">Returns</h2>
4715
4745
< summary >
4716
4746
< span > Expand source code</ span >
4717
4747
</ summary >
4718
- < pre > < code class ="python "> def unfollow_chat(self, id: str = None, payload: dict = None) -> RtmResponse:
4748
+ < pre > < code class ="python "> def unfollow_chat(self,
4749
+ id: str = None,
4750
+ payload: dict = None) -> RtmResponse:
4719
4751
''' Removes the requester from the chat followers.
4720
4752
4721
4753
Args:
@@ -4755,7 +4787,9 @@ <h2 id="returns">Returns</h2>
4755
4787
< summary >
4756
4788
< span > Expand source code</ span >
4757
4789
</ summary >
4758
- < pre > < code class ="python "> def unfollow_customer(self, id: str = None, payload: dict = None) -> RtmResponse:
4790
+ < pre > < code class ="python "> def unfollow_customer(self,
4791
+ id: str = None,
4792
+ payload: dict = None) -> RtmResponse:
4759
4793
''' Removes the agent from the list of customer's followers.
4760
4794
4761
4795
Args:
0 commit comments