1
0
Fork 0
mirror of synced 2024-07-01 04:30:51 +12:00

Added an exception in case no option was passed

This commit is contained in:
Phxntxm 2016-08-19 18:55:51 -05:00
parent e8e33c46f0
commit 2c55799379

View file

@ -105,6 +105,8 @@ class Steam:
await self.bot.say("Sorry, but I don't have that user's steam account saved!")
return
# Set the url based on which option is provided
# If no option is provided, we'll hit the IndexError, assume info for that
try:
if option[0] == "info":
url = "{}/ISteamUser/GetPlayerSummaries/v0002/?key={}&steamids={}".format(base_url, self.key, steam_id)
elif option[0] == "achievements":
@ -127,6 +129,8 @@ class Steam:
elif option[0] == "games":
await self.bot.say("Currently disabled, only achievements and info are available as options")
return
except IndexError:
url = "{}/ISteamUser/GetPlayerSummaries/v0002/?key={}&steamids={}".format(base_url, self.key, steam_id)
# Make the request and get the data in json response, all url's we're using will give a json response
try: