From a240ec79558ac4d0319dc974a1cd07143c6122eb Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Wed, 22 Mar 2017 19:13:11 +0100 Subject: [PATCH] Added some spaces? --- telegram.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/telegram.py b/telegram.py index 358100c4..5a5a641c 100644 --- a/telegram.py +++ b/telegram.py @@ -141,15 +141,15 @@ class Bot: async with session.request("GET", f"https://api.telegram.org/bot{token}/{endpoint}", params=params) as response: # Check for errors in the request if response.status != 200: - raise TelegramAPIError(f"Request returned {response.status} {response.reason}\n{response.text}") + raise TelegramAPIError(f"Request returned {response.status} {response.reason}\n{response.text()}") # Parse the json data as soon it's ready data = await response.json() - # Check for errors in the response - if not data["ok"]: - error = data["description"] - raise TelegramAPIError(f"Response returned an error: {error}") - # Return a dictionary containing the data - return data["result"] + # Check for errors in the response + if not data["ok"]: + error = data["description"] + raise TelegramAPIError(f"Response returned an error: {error}") + # Return a dictionary containing the data + return data["result"] class Update: