From 8c6ab17e579cf8f4e510ec324fc98b010ff01cb0 Mon Sep 17 00:00:00 2001 From: jesopo Date: Sun, 2 Sep 2018 19:54:45 +0100 Subject: give an Exports object (actually, ExportsContex object) to each module, to facilitate things like !set and !channelset without using the events system --- modules/lastfm.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'modules/lastfm.py') diff --git a/modules/lastfm.py b/modules/lastfm.py index 328a79a6..80204a3f 100644 --- a/modules/lastfm.py +++ b/modules/lastfm.py @@ -5,12 +5,11 @@ import Utils URL_SCROBBLER = "http://ws.audioscrobbler.com/2.0/" class Module(object): - def __init__(self, bot, events): + def __init__(self, bot, events, exports): self.bot = bot - events.on("postboot").on("configure").on( - "set").assure_call(setting="lastfm", - help="Set username on last.fm") + exports.add("set", {"setting": "lastfm", + "help": "Set username on last.fm"}) events.on("received").on("command").on("np", "listening", "nowplaying").hook(self.np, -- cgit v1.3.1-10-gc9f91