From 69d58eede2e9bf83aa1ed1d8fcf956efde494726 Mon Sep 17 00:00:00 2001 From: jesopo Date: Wed, 3 Oct 2018 13:22:37 +0100 Subject: Move src/Utils.py in to src/utils/, splitting functionality out in to modules of related functionality --- modules/spotify.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'modules/spotify.py') diff --git a/modules/spotify.py b/modules/spotify.py index 4c2d3c57..b26a66de 100644 --- a/modules/spotify.py +++ b/modules/spotify.py @@ -1,17 +1,18 @@ import json -from src import ModuleManager, Utils +from src import ModuleManager, utils URL_SPOTIFY = "https://api.spotify.com/v1/search" class Module(ModuleManager.BaseModule): - @Utils.hook("received.command.spotify", min_args=1) + @utils.hook("received.command.spotify", min_args=1) def spotify(self, event): """ :help: Search for a track on spotify :usage: """ - page = Utils.get_url(URL_SPOTIFY, get_params={"type": "track", - "limit": 1, "q": event["args"]}, json=True) + page = utils.http.get_url(URL_SPOTIFY, get_params= + {"type": "track", "limit": 1, "q": event["args"]}, + json=True) if page: if len(page["tracks"]["items"]): item = page["tracks"]["items"][0] -- cgit v1.3.1-10-gc9f91