diff --git a/src/IRCLine.py b/src/IRCLine.py index c0263d20..3a8f14b5 100644 --- a/src/IRCLine.py +++ b/src/IRCLine.py @@ -45,7 +45,7 @@ class ParsedLine(object): self._args = args self.args = IRCArgs(args) self.source = source - self.tags = {} if tags == None else tags + self.tags = tags or {} # type: typing.Dict[str, str] self._valid = True self._assured = False @@ -64,6 +64,9 @@ class ParsedLine(object): def assure(self): self._assured = True + def add_tag(self, tag: str, value: str=None): + self.tags[tag] = value or "" + def _tag_str(self, tags: typing.Dict[str, str]) -> str: tag_pieces = [] for tag, value in tags.items():