Corrected error where .text() wasn't being awaited)
This commit is contained in:
parent
9fda5f3bad
commit
04e08ec177
1 changed files with 3 additions and 1 deletions
|
@ -20,7 +20,7 @@ class Steam:
|
||||||
# Get the profile link based on the user provided, and request the xml data for it
|
# 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)
|
url = 'http://steamcommunity.com/id/{}/?xml=1'.format(user)
|
||||||
async with self.session.get(url, headers=self.headers) as response:
|
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
|
# Remove the xml version content, it breaks etree.fromstring
|
||||||
data = re.sub('<\?xml.*\?>', '', data)
|
data = re.sub('<\?xml.*\?>', '', data)
|
||||||
tree = etree.fromstring(data)
|
tree = etree.fromstring(data)
|
||||||
|
@ -51,6 +51,8 @@ class Steam:
|
||||||
except ValueError:
|
except ValueError:
|
||||||
steam_id = await self.find_id(user)
|
steam_id = await self.find_id(user)
|
||||||
|
|
||||||
|
await self.bot.say("User given was: {}\nFound steam_id")
|
||||||
|
|
||||||
if steam_id is None:
|
if steam_id is None:
|
||||||
await self.bot.say("Sorry, couldn't find that Steam user!")
|
await self.bot.say("Sorry, couldn't find that Steam user!")
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in a new issue