aboutsummaryrefslogtreecommitdiff
path: root/src/core_modules/fake_echo.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/core_modules/fake_echo.py')
-rw-r--r--src/core_modules/fake_echo.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/core_modules/fake_echo.py b/src/core_modules/fake_echo.py
new file mode 100644
index 00000000..bb7fbf43
--- /dev/null
+++ b/src/core_modules/fake_echo.py
@@ -0,0 +1,13 @@
+from src import EventManager, IRCLine, ModuleManager, utils
+
+class Module(ModuleManager.BaseModule):
+ @utils.hook("raw.send.privmsg", priority=EventManager.PRIORITY_MONITOR)
+ @utils.hook("raw.send.notice", priority=EventManager.PRIORITY_MONITOR)
+ def send_message(self, event):
+ our_hostmask = IRCLine.parse_hostmask(event["server"].hostmask())
+
+ echo = IRCLine.ParsedLine(event["line"].command, event["line"].args,
+ source=our_hostmask, tags=event["line"].tags)
+ echo.id = event["line"].id
+
+ self.events.on("raw.received").call(line=echo, server=event["server"])