Add IRCServer.send_raw so modules don't have to parse messages before sending
them
This commit is contained in:
parent
959d6a067c
commit
ee8c7813f7
3 changed files with 4 additions and 3 deletions
|
@ -18,8 +18,7 @@ class Module(ModuleManager.BaseModule):
|
|||
:usage: <raw line>
|
||||
:permission: raw
|
||||
"""
|
||||
line = utils.irc.parse_line(event["args"])
|
||||
event["server"].send(line)
|
||||
event["server"].send_raw(event["args"])
|
||||
|
||||
@utils.hook("received.command.part")
|
||||
def part(self, event):
|
||||
|
|
|
@ -8,7 +8,7 @@ class Module(ModuleManager.BaseModule):
|
|||
for j, part in enumerate(command[:]):
|
||||
command[j] = part.replace("%nick%", server.nickname)
|
||||
command = "%".join(command)
|
||||
server.send(utils.irc.parse_line(command))
|
||||
server.send_raw(command)
|
||||
|
||||
@utils.hook("received.001", priority=EventManager.PRIORITY_URGENT)
|
||||
def on_connect(self, event):
|
||||
|
|
|
@ -252,6 +252,8 @@ class Server(IRCObject.Object):
|
|||
line_parsed)
|
||||
self.socket.send(line_obj)
|
||||
return line_obj
|
||||
def send_raw(self, line: str):
|
||||
return self.send(utils.irc.parse_line(line))
|
||||
|
||||
def _send(self):
|
||||
lines = self.socket._send()
|
||||
|
|
Loading…
Reference in a new issue