use utils.irc.MessageTag in ircv3_multiline.py

This commit is contained in:
jesopo 2019-06-19 22:36:24 +01:00
parent 4bb3eeb9f1
commit e55cd1e98e

View file

@ -2,6 +2,7 @@ from src import ModuleManager, utils
CAP = utils.irc.Capability(None, "bitbot.dev/multiline") CAP = utils.irc.Capability(None, "bitbot.dev/multiline")
BATCH = utils.irc.BatchType(None, "bitbot.dev/multiline") BATCH = utils.irc.BatchType(None, "bitbot.dev/multiline")
TAG = utils.irc.MessageTag(None, "+bitbot.dev/multiline-concat")
class Module(ModuleManager.BaseModule): class Module(ModuleManager.BaseModule):
@utils.hook("received.cap.ls") @utils.hook("received.cap.ls")
@ -32,7 +33,7 @@ class Module(ModuleManager.BaseModule):
lines = event["batch"].get_lines() lines = event["batch"].get_lines()
for line in lines: for line in lines:
message = line.args[1] message = line.args[1]
if line.has_tag("+bitbot.dev/multiline-concat"): if TAG.present(line.tags):
last_message = "" last_message = ""
if messages: if messages:
last_message = messages.pop(-1) last_message = messages.pop(-1)