fixed TypeError when run with Python 3.5

Signed-off-by: klux2 <k.lux.gm@gmail.com>
This commit is contained in:
klux2 2019-07-04 14:29:32 +02:00
parent 439ae9f17e
commit 596dd035bf

View file

@ -236,7 +236,7 @@ def get_bot_id() -> int:
if botID == -1: if botID == -1:
api_url = "https://api.telegram.org/bot" + telegram_bot_token + "/getMe" api_url = "https://api.telegram.org/bot" + telegram_bot_token + "/getMe"
with urllib.request.urlopen(api_url) as response: with urllib.request.urlopen(api_url) as response:
data = json.load(response) data = json.loads(response.read().decode('utf-8'))
botID = data["result"]["id"] botID = data["result"]["id"]
return botID return botID