@@ -14,7 +14,7 @@ def __init__(self, client, channel_type, channel_id=None, custom_data=None):
1414 def url (self ):
1515 if self .id is None :
1616 raise StreamChannelException ("channel does not have an id" )
17- return f "channels/{ self . channel_type } /{ self .id } "
17+ return "channels/{}/{}" . format ( self .channel_type , self . id )
1818
1919 def send_message (self , message , user_id ):
2020 """
@@ -25,7 +25,7 @@ def send_message(self, message, user_id):
2525 :return: the Server Response
2626 """
2727 payload = {"message" : add_user_id (message , user_id )}
28- return self .client .post (f" { self . url } /message" , data = payload )
28+ return self .client .post ("{ }/message". format ( self . url ) , data = payload )
2929
3030 def send_event (self , event , user_id ):
3131 """
@@ -36,7 +36,7 @@ def send_event(self, event, user_id):
3636 :return: the Server Response
3737 """
3838 payload = {"event" : add_user_id (event , user_id )}
39- return self .client .post (f" { self . url } /event" , data = payload )
39+ return self .client .post ("{ }/event". format ( self . url ) , data = payload )
4040
4141 def send_reaction (self , message_id , reaction , user_id ):
4242 """
@@ -48,7 +48,7 @@ def send_reaction(self, message_id, reaction, user_id):
4848 :return: the Server Response
4949 """
5050 payload = {"reaction" : add_user_id (reaction , user_id )}
51- return self .client .post (f "messages/{ message_id } /reaction" , data = payload )
51+ return self .client .post ("messages/{}/reaction" . format ( message_id ) , data = payload )
5252
5353 def delete_reaction (self , message_id , reaction_type , user_id ):
5454 """
@@ -60,7 +60,7 @@ def delete_reaction(self, message_id, reaction_type, user_id):
6060 :return: the Server Response
6161 """
6262 return self .client .delete (
63- f "messages/{ message_id } /reaction/{ reaction_type } " ,
63+ "messages/{}/reaction/{}" . format ( message_id , reaction_type ) ,
6464 params = {"user_id" : user_id },
6565 )
6666
@@ -84,11 +84,11 @@ def query(self, **options):
8484 payload = {"state" : True , "data" : self .custom_data }
8585 payload .update (options )
8686
87- url = f "channels/{ self .channel_type } "
87+ url = "channels/{}" . format ( self .channel_type )
8888 if self .id is not None :
89- url = f" { url } /{ self .id } "
89+ url = "{ }/{}" . format ( url , self .id )
9090
91- state = self .client .post (f" { url } /query" , data = payload )
91+ state = self .client .post ("{ }/query". format ( url ) , data = payload )
9292
9393 if self .id is None :
9494 self .id = state ["channel" ]["id" ]
@@ -120,7 +120,7 @@ def truncate(self):
120120
121121 :return: The server response
122122 """
123- return self .client .post (f" { self . url } /truncate" )
123+ return self .client .post ("{ }/truncate". format ( self . url ) )
124124
125125 def add_members (self , user_ids ):
126126 """
@@ -167,7 +167,7 @@ def mark_read(self, user_id, **data):
167167 :return: The server response
168168 """
169169 payload = add_user_id (data , user_id )
170- return self .client .post (f" { self . url } /read" , data = payload )
170+ return self .client .post ("{ }/read". format ( self . url ) , data = payload )
171171
172172 def get_replies (self , parent_id , ** options ):
173173 """
@@ -177,17 +177,17 @@ def get_replies(self, parent_id, **options):
177177 :param options: Pagination params, ie {limit:10, idlte: 10}
178178 :return: A response with a list of messages
179179 """
180- return self .client .get (f "messages/{ parent_id } /replies" , params = options )
180+ return self .client .get ("messages/{}/replies" . format ( parent_id ) , params = options )
181181
182182 def get_reactions (self , message_id , ** options ):
183183 """
184184 List the reactions, supports pagination
185185
186- :param message_id: Tthe message id
186+ :param message_id: The message id
187187 :param options: Pagination params, ie {"limit":10, "idlte": 10}
188188 :return: A response with a list of reactions
189189 """
190- return self .client .get (f "messages/{ message_id } /reactions" , params = options )
190+ return self .client .get ("messages/{}/reactions" . format ( message_id ) , params = options )
191191
192192 def ban_user (self , user_id , ** options ):
193193 """
0 commit comments