Skip to content

Commit

Permalink
fixed utf8 bug
Browse files Browse the repository at this point in the history
  • Loading branch information
daanbeverdam committed Sep 4, 2017
1 parent ca6fd1d commit 7734419
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pybot/core/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def check_for_updates(self):
parameters = {'timeout': 30, 'limit': 100, 'offset': offset}
update_url = self.base_url + 'getUpdates'
request = urllib.request.urlopen(update_url + '?' + urllib.parse.urlencode(parameters))
update = json.loads(request.read())
update = json.loads(request.read().decode('utf-8'))
if update['ok'] and update['result']:
self.helper.set_offset(int(update['result'][-1]['update_id'] + 1))
for result in update['result']:
Expand Down Expand Up @@ -178,7 +178,7 @@ def reply(self, response):
def get_me(self):
update_url = self.base_url + 'getMe'
request = urllib.request.urlopen(update_url)
update = json.loads(request.read())
update = json.loads(request.read().decode('utf-8'))
if update['ok'] and update['result']:
result = update['result']
return User(id=result['id'], first_name=result['first_name'], username=result['username'])
Expand Down

0 comments on commit 7734419

Please sign in to comment.