diff options
| author | 2018-11-11 12:52:30 +0000 | |
|---|---|---|
| committer | 2018-11-11 12:52:30 +0000 | |
| commit | e29cc1c52cadae01ba146343aa34e51a52e06368 (patch) | |
| tree | 75ac9386e82938a85387f4970f1440f986549c08 | |
| parent | Typo in modules/line_handler.py, 'getl' -> 'get' (diff) | |
| signature | ||
Implement `__len__` on src/IRCChannel.py.Channels
| -rw-r--r-- | src/IRCChannel.py | 2 |
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) |
