Add .keys()/.values()/.items to src/IRCChannels.py

This commit is contained in:
jesopo 2018-11-13 11:36:44 +00:00
parent 36048be2fb
commit e9c9ec778c

View file

@ -18,6 +18,13 @@ class Channels(object):
def __getitem__(self, name: str):
return self.get(name)
def keys(self):
return self._channels.keys()
def values(self):
return self._channels.values()
def items(self):
return self._channels.items()
def _get_id(self, channel_name: str) -> int:
self._bot.database.channels.add(self._server.id, channel_name)
return self._bot.database.channels.get_id(self._server.id, channel_name)