removed code to get user from nick
This commit is contained in:
parent
7eb9ff1c7f
commit
472cc39e7b
1 changed files with 2 additions and 8 deletions
|
@ -9,10 +9,7 @@ def lastfm(inp, nick='', say=None, db=None, bot=None):
|
||||||
if not api_key:
|
if not api_key:
|
||||||
return "error: no api key set"
|
return "error: no api key set"
|
||||||
|
|
||||||
if inp:
|
user = inp
|
||||||
user = inp
|
|
||||||
else:
|
|
||||||
user = nick
|
|
||||||
|
|
||||||
api_url = "http://ws.audioscrobbler.com/2.0/?format=json"
|
api_url = "http://ws.audioscrobbler.com/2.0/?format=json"
|
||||||
|
|
||||||
|
@ -34,10 +31,7 @@ def lastfm(inp, nick='', say=None, db=None, bot=None):
|
||||||
api_key=api_key, user=user, limit=1)
|
api_key=api_key, user=user, limit=1)
|
||||||
|
|
||||||
if 'error' in response:
|
if 'error' in response:
|
||||||
if inp: # specified a user name
|
return "Error: %s." % response["message"]
|
||||||
return "Error: %s." % response["message"]
|
|
||||||
else:
|
|
||||||
return "Your nick is not a LastFM account. Try '.lastfm [user]'"
|
|
||||||
|
|
||||||
if not "track" in response["recenttracks"] or len(response["recenttracks"]["track"]) == 0:
|
if not "track" in response["recenttracks"] or len(response["recenttracks"]["track"]) == 0:
|
||||||
return 'No recent tracks for user "%s" found.' % user
|
return 'No recent tracks for user "%s" found.' % user
|
||||||
|
|
Reference in a new issue