aboutsummaryrefslogtreecommitdiff
path: root/modules/ircv3_echo_message.py
blob: 3db7a6a900546e1b1919f95bf1c3aa738efe6030 (about) (plain) (blame)
1
2
3
4
5
6
7
8
9
10
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()