Added an exception in case no option was passed
This commit is contained in:
parent
e8e33c46f0
commit
2c55799379
1 changed files with 25 additions and 21 deletions
|
@ -105,6 +105,8 @@ class Steam:
|
||||||
await self.bot.say("Sorry, but I don't have that user's steam account saved!")
|
await self.bot.say("Sorry, but I don't have that user's steam account saved!")
|
||||||
return
|
return
|
||||||
# Set the url based on which option is provided
|
# 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":
|
if option[0] == "info":
|
||||||
url = "{}/ISteamUser/GetPlayerSummaries/v0002/?key={}&steamids={}".format(base_url, self.key, steam_id)
|
url = "{}/ISteamUser/GetPlayerSummaries/v0002/?key={}&steamids={}".format(base_url, self.key, steam_id)
|
||||||
elif option[0] == "achievements":
|
elif option[0] == "achievements":
|
||||||
|
@ -127,6 +129,8 @@ class Steam:
|
||||||
elif option[0] == "games":
|
elif option[0] == "games":
|
||||||
await self.bot.say("Currently disabled, only achievements and info are available as options")
|
await self.bot.say("Currently disabled, only achievements and info are available as options")
|
||||||
return
|
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
|
# Make the request and get the data in json response, all url's we're using will give a json response
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in a new issue