Implement +bitbot.dev/mulitline-concat to concat line to previous line

This commit is contained in:
jesopo 2019-06-18 15:18:56 +01:00
parent 51cac7d9b5
commit 3c51348fec

View file

@ -31,7 +31,13 @@ class Module(ModuleManager.BaseModule):
messages = []
lines = event["batch"].get_lines()
for line in lines:
messages.append(line.args[1])
message = line.args[1]
if line.has_tag("+bitbot.dev/multiline-concat"):
last_message = ""
if messages:
last_message = messages.pop(-1)
message = last_message+message
messages.append(message)
target = event["batch"].args[0]
message = "\n".join(messages)