From b7cf524e9869828ff85954cb731f7fee98bee8d9 Mon Sep 17 00:00:00 2001 From: jesopo Date: Fri, 31 Aug 2018 12:55:52 +0100 Subject: Give modules event objects with "context"s, to facilitate purging all the event hooks for a module --- modules/lastfm.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'modules/lastfm.py') diff --git a/modules/lastfm.py b/modules/lastfm.py index e8a2545e..328a79a6 100644 --- a/modules/lastfm.py +++ b/modules/lastfm.py @@ -5,14 +5,14 @@ import Utils URL_SCROBBLER = "http://ws.audioscrobbler.com/2.0/" class Module(object): - def __init__(self, bot): + def __init__(self, bot, events): self.bot = bot - bot.events.on("postboot").on("configure").on( + events.on("postboot").on("configure").on( "set").assure_call(setting="lastfm", help="Set username on last.fm") - bot.events.on("received").on("command").on("np", + events.on("received").on("command").on("np", "listening", "nowplaying").hook(self.np, help="Get the last listened to track from a user", usage="[username]") -- cgit v1.3.1-10-gc9f91