pass ParsedLine on message and formatted.* message events

This commit is contained in:
jesopo 2019-06-21 20:20:28 +01:00
parent a783e71ad4
commit 0a302dfd21
3 changed files with 5 additions and 5 deletions

View file

@ -42,19 +42,19 @@ class Module(ModuleManager.BaseModule):
line = self._privmsg(event, event["channel"], user, nickname)
self._event("message.channel", event["server"], line,
event["channel"].name, channel=event["channel"], user=user,
from_self=event["from_self"])
parsed_line=event["line"])
def _on_notice(self, event, sender):
return "(notice) <%s> %s" % (sender, event["message"])
def _channel_notice(self, event, sender, channel):
line = self._on_notice(event, sender)
self._event("notice.channel", event["server"], line,
event["channel"].name, from_self=event["from_self"])
event["channel"].name, parsed_line=event["line"])
def _private_notice(self, event, sender, target):
line = self._on_notice(event, sender)
self._event("notice.private", event["server"], line, None,
from_self=event["from_self"])
parsed_line=event["line"])
@utils.hook("received.notice.channel", priority=EventManager.PRIORITY_HIGH)
def channel_notice(self, event):

View file

@ -11,7 +11,7 @@ class Module(ModuleManager.BaseModule):
default_event = any(default_events)
kwargs = {"command": line.command, "args": line.args, "tags": line.tags,
"server": server, "source": line.source,
"server": server, "source": line.source, "line": line,
"direction": utils.Direction.Recv}
self.events.on("raw.received").on(line.command).call_unsafe(**kwargs)

View file

@ -53,7 +53,7 @@ def message(events, event):
kwargs = {"server": event["server"], "target": target_obj,
"target_str": target_str, "user": user, "tags": event["tags"],
"is_channel": is_channel, "from_self": from_self}
"is_channel": is_channel, "from_self": from_self, "line": event["line"]}
action = False