aboutsummaryrefslogtreecommitdiff
path: root/src/core_modules/fake_echo.py
diff options
context:
space:
mode:
authorGravatar jesopo2019-12-10 05:27:35 +0000
committerGravatar jesopo2019-12-10 05:27:35 +0000
commit638eee0d685c06d258cb55287204ca97bca7c344 (patch)
tree33442439317ae2846f1efb7674b7a3758c8990a1 /src/core_modules/fake_echo.py
parentmove sys.exit() codes to an enum in utils.consts (diff)
signature
move core modules to src/core_modules, make them uneffected by white/black list
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"])