From 333124072eccff89cebf5b61bb73fc04974f8df2 Mon Sep 17 00:00:00 2001 From: hadware Date: Tue, 29 May 2018 00:27:33 +0200 Subject: [PATCH] =?UTF-8?q?Corrections=20dans=20les=20requ=C3=AAtes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tools/coco/requests.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/coco/requests.py b/tools/coco/requests.py index b17bdef..f3ce30b 100644 --- a/tools/coco/requests.py +++ b/tools/coco/requests.py @@ -62,9 +62,9 @@ class PostLoginRequest(LoggedInRequest): def _get_url(self): return self.host + '52' + self.token + coco_cipher(self.client_id_str, self.password) - def _parse_response(self, response): + def _parse_response(self, response : str): """Checks if the post-login was successful""" - return response[:5] == "99556" + return response.startswith("99556") class PulseRequest(LoggedInRequest): @@ -104,10 +104,10 @@ class SendMsgRequest(PulseRequest): def _get_url(self): return self.host + "99" + self.token + self.conv_id + str(randint(0, 6)) + encode_msg(self.msg) - def _parse_response(self, response): + def _parse_response(self, response: str): """Response to a send message request can either just be #97x or an actual message (like in pulse request)""" - if response[:2] == "97": + if response.startswith("97"): return [] else: return super()._parse_response(response) \ No newline at end of file