aboutsummaryrefslogtreecommitdiff
path: root/modules/lastfm.py
diff options
context:
space:
mode:
authorGravatar jesopo2017-12-26 10:32:36 +0000
committerGravatar jesopo2017-12-26 10:32:36 +0000
commit0cc72d5d66bc3a6abf7757c7202905bd656ddf1d (patch)
treea2591a46c4e25f359b7ed6990f31d91be22d4d1d /modules/lastfm.py
parentNR: Indicate interesting activity at locations (diff)
Added a "replay" system to EventManager hooks, to replay missed .calls
Diffstat (limited to 'modules/lastfm.py')
-rw-r--r--modules/lastfm.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/modules/lastfm.py b/modules/lastfm.py
index 77f693c1..7a607dd0 100644
--- a/modules/lastfm.py
+++ b/modules/lastfm.py
@@ -7,17 +7,16 @@ URL_SCROBBLER = "http://ws.audioscrobbler.com/2.0/"
class Module(object):
def __init__(self, bot):
self.bot = bot
- bot.events.on("boot").on("done").hook(self.boot_done)
+
+ bot.events.on("postboot").on("configure").on(
+ "set").call(setting="lastfm",
+ help="Set username on last.fm")
+
bot.events.on("received").on("command").on("np",
"listening", "nowplaying").hook(self.np,
help="Get the last listen to track from a user",
usage="[username]")
- def boot_done(self, event):
- self.bot.events.on("postboot").on("configure").on(
- "set").call(setting="lastfm",
- help="Set username on last.fm")
-
def np(self, event):
if event["args_split"]:
username = event["args_split"][0]