diff options
Diffstat (limited to 'src/utils/irc/__init__.py')
| -rw-r--r-- | src/utils/irc/__init__.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/utils/irc/__init__.py b/src/utils/irc/__init__.py index 9577bcc1..12abc144 100644 --- a/src/utils/irc/__init__.py +++ b/src/utils/irc/__init__.py @@ -260,7 +260,7 @@ def parse_ctcp(s: str) -> typing.Optional[CTCPMessage]: class IRCBatch(object): def __init__(self, identifier: str, batch_type: str, args: typing.List[str], tags: typing.Dict[str, str]={}): - self.id = identifier + self.identifier = identifier self.type = batch_type self.args = args self.tags = tags @@ -301,5 +301,12 @@ class MessageTag(object): key = list(set([s])&self._names) return key[0] if key else None +class BatchType(object): + def __init__(self, name: typing.Optional[str], draft_name: str=None): + self._names = set([name, draft_name]) + def match(self, type: str) -> typing.Optional[str]: + t = list(set([type])&self._names) + return t[0] if t else None + def hostmask_match(hostmask: str, pattern: str) -> bool: return fnmatch.fnmatchcase(hostmask, pattern) |
