diff options
| author | 2019-06-16 17:17:50 +0100 | |
|---|---|---|
| committer | 2019-06-16 17:20:31 +0100 | |
| commit | 75f60caaf8ed9f40c07f0597d7a9248821a26d66 (patch) | |
| tree | f09251032e7812421b027f0e971b588f22f9cea2 /modules/ircv3_multi_line.py | |
| parent | 'timeout' -> 'cooldown'. closes #60 (diff) | |
'multi-line' -> 'multiline'
Diffstat (limited to 'modules/ircv3_multi_line.py')
| -rw-r--r-- | modules/ircv3_multi_line.py | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/modules/ircv3_multi_line.py b/modules/ircv3_multi_line.py deleted file mode 100644 index e8b65c3b..00000000 --- a/modules/ircv3_multi_line.py +++ /dev/null @@ -1,38 +0,0 @@ -from src import ModuleManager, utils - -CAP = utils.irc.Capability(None, "bitbot.dev/multi-line") -BATCH = utils.irc.BatchType(None, "bitbot.dev/multi-line") - -class Module(ModuleManager.BaseModule): - @utils.hook("received.cap.ls") - @utils.hook("received.cap.new") - def on_cap(self, event): - return CAP.copy() - - @utils.hook("preprocess.send.privmsg") - def preprocess_send_privmsg(self, event): - if len(event["line"].args) > 1: - if ("\n" in event["line"].args[1] and - event["server"].has_capability(CAP)): - event["line"].invalidate() - - target = event["line"].args[0] - lines = event["line"].args[1].split("\n") - batch = utils.irc.IRCSendBatch("bitbot.dev/multi-line", - [target]) - for line in lines: - batch.add_line(utils.irc.protocol.privmsg(target, line)) - for line in batch.get_lines(): - event["server"].send(line) - - @utils.hook("received.batch.end") - def batch_end(self, event): - if BATCH.match(event["batch"].type): - messages = [] - lines = event["batch"].get_lines() - for line in lines: - messages.append(line.args[1]) - - target = event["batch"].args[0] - message = "\n".join(messages) - return [IRCLine.ParsedLine("PRIVMSG", [target, message])] |
