diff --git a/src/utils/irc.py b/src/utils/irc.py index 67597149..da9a0747 100644 --- a/src/utils/irc.py +++ b/src/utils/irc.py @@ -55,13 +55,18 @@ def seperate_hostmask(hostmask: str) -> IRCHostmask: class IRCArgs(object): def __init__(self, args: typing.List[str]): self._args = args - def __getitem__(self, index) -> str: - return self._args[index] + def get(self, index: int) -> typing.Optional[str]: if len(self._args) > index: return self._args[index] return None + def __len__(self) -> int: + return len(self._args) + def __getitem__(self, index) -> str: + return self._args[index] + + class IRCLine(object): def __init__(self, tags: dict, prefix: typing.Optional[str], command: str, args: IRCArgs):