From abed9cf4ea71dcbad2dd2c049683b8d14b942e09 Mon Sep 17 00:00:00 2001 From: dngfx Date: Fri, 31 Aug 2018 10:50:37 +0100 Subject: Reformat --- modules/spotify.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'modules/spotify.py') diff --git a/modules/spotify.py b/modules/spotify.py index 64ba2c2f..9b69523d 100644 --- a/modules/spotify.py +++ b/modules/spotify.py @@ -3,6 +3,7 @@ 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( @@ -11,7 +12,9 @@ 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] @@ -19,7 +22,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: -- cgit v1.3.1-10-gc9f91