aboutsummaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/irc.py9
1 files changed, 7 insertions, 2 deletions
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):