aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar jesopo2018-11-11 12:52:30 +0000
committerGravatar jesopo2018-11-11 12:52:30 +0000
commite29cc1c52cadae01ba146343aa34e51a52e06368 (patch)
tree75ac9386e82938a85387f4970f1440f986549c08
parentTypo in modules/line_handler.py, 'getl' -> 'get' (diff)
signature
Implement `__len__` on src/IRCChannel.py.Channels
-rw-r--r--src/IRCChannel.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/IRCChannel.py b/src/IRCChannel.py
index a88579f3..6e54726a 100644
--- a/src/IRCChannel.py
+++ b/src/IRCChannel.py
@@ -168,6 +168,8 @@ class Channels(object):
return (channel for channel in self._channels.values())
def __contains__(self, name: str) -> bool:
return self.contains(name)
+ def __len__(self) -> int:
+ return len(self._channels)
def _get_id(self, channel_name: str) -> int:
self._bot.database.channels.add(self._server.id, channel_name)