aboutsummaryrefslogtreecommitdiff
path: root/modules/spotify.py
diff options
context:
space:
mode:
authorGravatar jesopo2018-09-26 18:27:17 +0100
committerGravatar jesopo2018-09-26 18:27:17 +0100
commit51a52e2b0e54031cce5876f54d1d48c268b5441c (patch)
treea4c0e8e86c55aa701b06297d5b5a2ceebeaab60d /modules/spotify.py
parentAlso use docstrings to check if a command has help available, allow one-string (diff)
signature
Switch to using @Utils.hook and docstrings for event hooks
Diffstat (limited to 'modules/spotify.py')
-rw-r--r--modules/spotify.py12
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: