5
5
6
6
import typing
7
7
from abc import ABCMeta
8
- from configparser import ConfigParser
9
8
9
+ from livechat .config import CONFIG
10
10
from livechat .utils .helpers import prepare_payload
11
11
from livechat .utils .structures import RtmResponse
12
12
from livechat .utils .ws_client import WebsocketClient
13
13
14
- config = ConfigParser ()
15
- config .read ('configs/main.ini' )
16
- stable_version = config .get ('api' , 'stable' )
17
- api_url = config .get ('api' , 'url' )
14
+ stable_version = CONFIG .get ('stable' )
15
+ api_url = CONFIG .get ('url' )
18
16
19
17
20
18
class AgentRTM :
@@ -244,7 +242,9 @@ def follow_chat(self, id: str = None, payload: dict = None) -> RtmResponse:
244
242
payload = prepare_payload (locals ())
245
243
return self .ws .send ({'action' : 'follow_chat' , 'payload' : payload })
246
244
247
- def unfollow_chat (self , id : str = None , payload : dict = None ) -> RtmResponse :
245
+ def unfollow_chat (self ,
246
+ id : str = None ,
247
+ payload : dict = None ) -> RtmResponse :
248
248
''' Removes the requester from the chat followers.
249
249
250
250
Args:
@@ -601,7 +601,9 @@ def untag_thread(self,
601
601
602
602
# Customers
603
603
604
- def get_customer (self , id : str = None , payload : dict = None ) -> RtmResponse :
604
+ def get_customer (self ,
605
+ id : str = None ,
606
+ payload : dict = None ) -> RtmResponse :
605
607
''' Returns the info about the Customer with a given ID.
606
608
607
609
Args:
@@ -718,7 +720,9 @@ def ban_customer(self,
718
720
payload = prepare_payload (locals ())
719
721
return self .ws .send ({'action' : 'ban_customer' , 'payload' : payload })
720
722
721
- def follow_customer (self , id : str = None , payload : dict = None ) -> RtmResponse :
723
+ def follow_customer (self ,
724
+ id : str = None ,
725
+ payload : dict = None ) -> RtmResponse :
722
726
''' Marks a customer as followed.
723
727
724
728
Args:
@@ -734,7 +738,9 @@ def follow_customer(self, id: str = None, payload: dict = None) -> RtmResponse:
734
738
payload = prepare_payload (locals ())
735
739
return self .ws .send ({'action' : 'follow_customer' , 'payload' : payload })
736
740
737
- def unfollow_customer (self , id : str = None , payload : dict = None ) -> RtmResponse :
741
+ def unfollow_customer (self ,
742
+ id : str = None ,
743
+ payload : dict = None ) -> RtmResponse :
738
744
''' Removes the agent from the list of customer's followers.
739
745
740
746
Args:
@@ -842,7 +848,9 @@ def set_routing_status(self,
842
848
'payload' : payload
843
849
})
844
850
845
- def set_away_status (self , away : bool = None , payload : dict = None ) -> RtmResponse :
851
+ def set_away_status (self ,
852
+ away : bool = None ,
853
+ payload : dict = None ) -> RtmResponse :
846
854
''' Sets an Agent's connection to the away state.
847
855
848
856
Args:
@@ -995,7 +1003,9 @@ class AgentRTM33(AgentRTMInterface):
995
1003
996
1004
# Chats
997
1005
998
- def deactivate_chat (self , id : str = None , payload : dict = None ) -> RtmResponse :
1006
+ def deactivate_chat (self ,
1007
+ id : str = None ,
1008
+ payload : dict = None ) -> RtmResponse :
999
1009
''' Deactivates a chat by closing the currently open thread.
1000
1010
1001
1011
Args:
0 commit comments