diff options
| author | 2019-06-18 15:18:44 +0100 | |
|---|---|---|
| committer | 2019-06-18 15:18:44 +0100 | |
| commit | 51cac7d9b5a97e6cafd4c24e920bce968edbc95c (patch) | |
| tree | 076da5ff880d2e346a65508b84a7f56839f31262 /src | |
| parent | message-tags count for a different character limit than the rest of the line (diff) | |
| signature | ||
add has_tag() and get_tag() to IRCLine.ParsedLine
Diffstat (limited to 'src')
| -rw-r--r-- | src/IRCLine.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/IRCLine.py b/src/IRCLine.py index 666977f9..9b028a17 100644 --- a/src/IRCLine.py +++ b/src/IRCLine.py @@ -66,6 +66,10 @@ class ParsedLine(object): def add_tag(self, tag: str, value: str=None): self.tags[tag] = value or "" + def has_tag(self, tag: str) -> bool: + return "tag" in self.tags + def get_tag(self, tag: str) -> typing.Optional[str]: + return self.tags[tag] def _tag_str(self, tags: typing.Dict[str, str]) -> str: tag_pieces = [] |
