diff options
| author | 2018-08-31 10:51:47 +0100 | |
|---|---|---|
| committer | 2018-08-31 10:51:47 +0100 | |
| commit | 90ce92dc39395444862edfc7946ef7a1195f2464 (patch) | |
| tree | 6832c146a15879df292d265083bfe5795cbdfa69 /modules/spotify.py | |
| parent | Reformat (diff) | |
Revert "Reformat"
This reverts commit abed9cf
Diffstat (limited to 'modules/spotify.py')
| -rw-r--r-- | modules/spotify.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/modules/spotify.py b/modules/spotify.py index 9b69523d..64ba2c2f 100644 --- a/modules/spotify.py +++ b/modules/spotify.py @@ -3,7 +3,6 @@ import Utils URL_SPOTIFY = "https://api.spotify.com/v1/search" - class Module(object): def __init__(self, bot): bot.events.on("received").on("command").on("spotify").hook( @@ -12,9 +11,7 @@ class Module(object): def spotify(self, event): page = Utils.get_url(URL_SPOTIFY, get_params={"type": "track", - "limit": 1, - "q": event["args"]}, - json=True) + "limit": 1, "q": event["args"]}, json=True) if page: if len(page["tracks"]["items"]): item = page["tracks"]["items"][0] @@ -22,7 +19,7 @@ class Module(object): artist_name = item["artists"][0]["name"] url = item["external_urls"]["spotify"] event["stdout"].write("%s (by %s) %s" % (title, artist_name, - url)) + url)) else: event["stderr"].write("No results found") else: |
