diff options
Diffstat (limited to 'modules/spotify.py')
| -rw-r--r-- | modules/spotify.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/modules/spotify.py b/modules/spotify.py index eef89b15..6816cd50 100644 --- a/modules/spotify.py +++ b/modules/spotify.py @@ -1,14 +1,14 @@ import json -from src import Utils +from src import ModuleManager, Utils URL_SPOTIFY = "https://api.spotify.com/v1/search" -class Module(object): - def __init__(self, bot, events, exports): - events.on("received.command.spotify").hook(self.spotify, min_args=1, - help="Search for a track on spotify") - +class Module(ModuleManager.BaseModule): + @Utils.hook("received.command.spotify", min_args=1) def spotify(self, event): + """ + Search for a track on spotify + """ page = Utils.get_url(URL_SPOTIFY, get_params={"type": "track", "limit": 1, "q": event["args"]}, json=True) if page: |
