1
0
Fork 0
mirror of synced 2024-06-28 19:20:34 +12:00

Corrected error where .text() wasn't being awaited)

This commit is contained in:
phxntxm 2016-08-19 01:59:33 -05:00
parent 9fda5f3bad
commit 04e08ec177

View file

@ -20,7 +20,7 @@ class Steam:
# Get the profile link based on the user provided, and request the xml data for it
url = 'http://steamcommunity.com/id/{}/?xml=1'.format(user)
async with self.session.get(url, headers=self.headers) as response:
data = response.text()
data = await response.text()
# Remove the xml version content, it breaks etree.fromstring
data = re.sub('<\?xml.*\?>', '', data)
tree = etree.fromstring(data)
@ -51,6 +51,8 @@ class Steam:
except ValueError:
steam_id = await self.find_id(user)
await self.bot.say("User given was: {}\nFound steam_id")
if steam_id is None:
await self.bot.say("Sorry, couldn't find that Steam user!")
return