diff options
| author | 2018-09-02 19:54:45 +0100 | |
|---|---|---|
| committer | 2018-09-02 19:54:45 +0100 | |
| commit | 8c6ab17e579cf8f4e510ec324fc98b010ff01cb0 (patch) | |
| tree | c0437f76bbe9dea31f5f4599450ed5b492eedcd6 /modules/karma.py | |
| parent | IRCLogging -> Logging (diff) | |
| signature | ||
give an Exports object (actually, ExportsContex object) to each module, to
facilitate things like !set and !channelset without using the events system
Diffstat (limited to 'modules/karma.py')
| -rw-r--r-- | modules/karma.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/modules/karma.py b/modules/karma.py index 40911e1b..5f6e5178 100644 --- a/modules/karma.py +++ b/modules/karma.py @@ -5,7 +5,7 @@ REGEX_KARMA = re.compile("(.*)(\+{2,}|\-{2,})$") KARMA_DELAY_SECONDS = 3 class Module(object): - def __init__(self, bot, events): + def __init__(self, bot, events, exports): self.bot = bot self.events = events events.on("new").on("user").hook(self.new_user) @@ -19,10 +19,9 @@ class Module(object): min_args=1, help="Reset a specified karma to 0", usage="<target>") - events.on("postboot").on("configure").on( - "channelset").assure_call(setting="karma-verbose", - help="Disable/Enable automatically responding to karma changes", - validate=Utils.bool_or_none) + exports.add("channelset", {"setting": "karma-verbose", + "help": "Disable/Enable automatically responding to " + "karma changes", "validate": Utils.bool_or_none}) def new_user(self, event): event["user"].last_karma = None |
