aboutsummaryrefslogtreecommitdiff
path: root/modules/lastfm.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/lastfm.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/lastfm.py')
-rw-r--r--modules/lastfm.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/lastfm.py b/modules/lastfm.py
index d46bc50b..ddeefc6b 100644
--- a/modules/lastfm.py
+++ b/modules/lastfm.py
@@ -14,11 +14,11 @@ class Module(object):
exports.add("set", {"setting": "lastfm",
"help": "Set username on last.fm"})
- events.on("received.command").on("np", "listening", "nowplaying"
- ).hook(self.np, help="Get the last listened to track from a user",
- usage="[username]")
-
+ @Utils.hook("received.command.np|listening|nowplaying", usage="[username]")
def np(self, event):
+ """
+ Get the last listened to track from a user
+ """
if event["args_split"]:
lastfm_username = event["args_split"][0]
shown_username = lastfm_username