diff options
| author | 2019-06-21 10:41:22 +0100 | |
|---|---|---|
| committer | 2019-06-21 10:41:22 +0100 | |
| commit | 032c67be66bb792a29cc90cb6882058b612f1a28 (patch) | |
| tree | c2f6381737088a7ec68f4bdee055af86671ee0d4 /modules/ircv3_echo_message.py | |
| parent | Don't listen to raw.send.privmsg in linehandler, emulate recv in fake_echo.py (diff) | |
| signature | ||
move echo-message to it's own module, eat events before they hit fake_echo.py
Diffstat (limited to 'modules/ircv3_echo_message.py')
| -rw-r--r-- | modules/ircv3_echo_message.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/modules/ircv3_echo_message.py b/modules/ircv3_echo_message.py new file mode 100644 index 00000000..3db7a6a9 --- /dev/null +++ b/modules/ircv3_echo_message.py @@ -0,0 +1,11 @@ +from src import EventManager, ModuleManager, utils + +CAP = utils.irc.Capability("echo-message") + +@utils.export("cap", CAP) +class Module(ModuleManager.BaseModule): + @utils.hook("raw.send.privmsg", priority=EventManager.PRIORITY_LOW) + @utils.hook("raw.send.notice", priority=EventManager.PRIORITY_LOW) + def send_message(self, event): + if event["server"].has_capability(CAP): + event.eat() |
