diff options
| author | 2016-04-10 17:40:58 +0100 | |
|---|---|---|
| committer | 2016-04-10 17:40:58 +0100 | |
| commit | 190d42fbb527a8710a8e710dc3260ad8054a9d1d (patch) | |
| tree | d69cfbac8105ff18230b9828bec1b412e42db7ea /modules/sed.py | |
| parent | added a confirmation of message save to in.py. (diff) | |
| signature | ||
simpler boolean channel settings
Diffstat (limited to 'modules/sed.py')
| -rw-r--r-- | modules/sed.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/modules/sed.py b/modules/sed.py index 6bdd1cb0..01bbdf4c 100644 --- a/modules/sed.py +++ b/modules/sed.py @@ -1,4 +1,5 @@ import re, traceback +import Utils REGEX_SPLIT = re.compile("(?<!\\\\)/") REGEX_SED = re.compile("^s/") @@ -10,13 +11,11 @@ class Module(object): bot.events.on("received").on("message").on("channel").hook( self.channel_message) - def validate_setchannel(self, s): - return s.lower() == "true" def boot_done(self, event): self.bot.events.on("postboot").on("configure").on( "channelset").call(setting="sed", help="Disable/Enable sed in a channel", - validate=self.validate_setchannel) + validate=Utils.bool_or_none) def channel_message(self, event): if event["action"] or not event["channel"].get_setting("sed", True): |
