add a create
flag to IRCChannels.get_id() to optionally not create new ids
This commit is contained in:
parent
0578d9ef5b
commit
d973b547e1
1 changed files with 3 additions and 2 deletions
|
@ -25,8 +25,9 @@ class Channels(object):
|
|||
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)
|
||||
def get_id(self, channel_name: str, create: bool=True) -> int:
|
||||
if create:
|
||||
self._bot.database.channels.add(self._server.id, channel_name)
|
||||
return self._bot.database.channels.get_id(self._server.id, channel_name)
|
||||
|
||||
def _name_lower(self, channel_name: str) -> str:
|
||||
|
|
Loading…
Reference in a new issue