move echo-message to it's own module, eat events before they hit fake_echo.py
This commit is contained in:
parent
e76ea39c71
commit
032c67be66
2 changed files with 11 additions and 1 deletions
11
modules/ircv3_echo_message.py
Normal file
11
modules/ircv3_echo_message.py
Normal file
|
@ -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()
|
|
@ -12,7 +12,6 @@ CAPABILITIES = [
|
||||||
utils.irc.Capability("message-tags", "draft/message-tags-0.2"),
|
utils.irc.Capability("message-tags", "draft/message-tags-0.2"),
|
||||||
utils.irc.Capability("cap-notify"),
|
utils.irc.Capability("cap-notify"),
|
||||||
utils.irc.Capability("batch"),
|
utils.irc.Capability("batch"),
|
||||||
utils.irc.Capability("echo-message"),
|
|
||||||
utils.irc.Capability(None, "draft/rename"),
|
utils.irc.Capability(None, "draft/rename"),
|
||||||
utils.irc.Capability(None, "draft/setname")
|
utils.irc.Capability(None, "draft/setname")
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in a new issue