Implement __len__ on src/IRCChannel.py.Channels

This commit is contained in:
jesopo 2018-11-11 12:52:30 +00:00
parent c50622c1a4
commit e29cc1c52c

View file

@ -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)