Skip to content

Commit da51d9f

Browse files
committed
spotify_url will now show the URI in addition to the URL
1 parent e645932 commit da51d9f

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

plugins/spotify.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,14 +112,15 @@ def spotify_url(bot, match):
112112
artist = data["artists"][0]["name"]
113113
album = data["album"]["name"]
114114
url = data['external_urls']['spotify']
115+
uri = data['uri']
115116

116-
return "Spotify Track: \x02{}\x02 by \x02{}\x02 from the album \x02{}\x02 {}".format(
117-
name, artist, album, url)
117+
return "Spotify Track: \x02{}\x02 by \x02{}\x02 from the album \x02{}\x02 {} [{}]".format(
118+
name, artist, album, url, uri)
118119
elif _type == "artist":
119120
return "Spotify Artist: \x02{}\x02, followers: \x02{}\x02, genres: \x02{}\x02".format(
120121
data["name"], data["followers"]["total"],
121122
', '.join(data["genres"]))
122123
elif _type == "album":
123-
return "Spotify Album: \x02{}\x02 - \x02{}\x02 {}".format(
124+
return "Spotify Album: \x02{}\x02 - \x02{}\x02 {} [{}]".format(
124125
data["artists"][0]["name"], data["name"],
125-
data['external_urls']['spotify'])
126+
data['external_urls']['spotify'], data['uri'])

0 commit comments

Comments
 (0)