aboutsummaryrefslogtreecommitdiff
path: root/modules/sed.py
diff options
context:
space:
mode:
Diffstat (limited to 'modules/sed.py')
-rw-r--r--modules/sed.py16
1 files changed, 7 insertions, 9 deletions
diff --git a/modules/sed.py b/modules/sed.py
index c276d4d1..74441c4d 100644
--- a/modules/sed.py
+++ b/modules/sed.py
@@ -5,20 +5,18 @@ REGEX_SPLIT = re.compile("(?<!\\\\)/")
REGEX_SED = re.compile("^s/")
class Module(object):
- def __init__(self, bot, events):
+ def __init__(self, bot, events, exports):
self.bot = bot
self.events = events
events.on("received").on("message").on("channel").hook(
self.channel_message)
- events.on("postboot").on("configure").on(
- "channelset").assure_call(setting="sed",
- help="Disable/Enable sed in a channel",
- validate=Utils.bool_or_none)
- events.on("postboot").on("configure").on(
- "channelset").assure_call(setting="sed-sender-only",
- help="Disable/Enable sed only looking at the messages "
- "sent by the user", validate=Utils.bool_or_none)
+ exports.add("channelset", {"setting": "sed",
+ "help": "Disable/Enable sed in a channel",
+ "validate": Utils.bool_or_none})
+ exports.add("channelset", {"setting": "sed-sender-only",
+ "help": "Disable/Enable sed only looking at the messages "
+ "sent by the user", "validate": Utils.bool_or_none})
def channel_message(self, event):
sed_split = re.split(REGEX_SPLIT, event["message"], 3)