Add .message( and .notice( to IRCSendBatch

This commit is contained in:
jesopo 2019-02-19 15:41:17 +00:00
parent bc772ef5cc
commit 114d1054a5

View file

@ -326,7 +326,13 @@ class IRCBatch(object):
class IRCRecvBatch(IRCBatch):
pass
class IRCSendBatch(IRCBatch):
pass
def _add_line(self, line: IRCParsedLine):
line.tags["batch"] = self.id
self.lines.append(line)
def message(self, target: str, message: str, tags: dict=None):
self._add_line(utils.irc.protocol.message(target, message, tags))
def notice(self, target: str, message: str, tags: dict=None):
self._add_line(utls.irc.protocol.notice(target, message, tags))
def trailing(s: str) -> str:
if s[0] == ":" or " " in s: