Added an exception in case no option was passed
This commit is contained in:
parent
e8e33c46f0
commit
2c55799379
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue