diff --git a/mattermost.plug b/mattermost.plug index 211b863..ce87144 100644 --- a/mattermost.plug +++ b/mattermost.plug @@ -5,5 +5,5 @@ Module = mattermost [Documentation] Description = A Mattermost backend for errbot. Author = Christian Plümer -Version = 2.0.1 +Version = 2.0.2 Website = https://github.com/Vaelor/errbot-mattermost-backend diff --git a/src/mattermostRoom.py b/src/mattermostRoom.py index 5600094..59e2f90 100644 --- a/src/mattermostRoom.py +++ b/src/mattermostRoom.py @@ -23,6 +23,12 @@ def __init__(self, name=None, channelid=None, teamid=None, bot=None): self._teamid = teamid self._id = None if channelid is None else channelid + if self._id is None and name is not None: + try: + self._id = bot.channelname_to_channelid(name) + except RoomDoesNotExistError as e: + # If the room does not exist, maybe it will be created. + log.info(e) self._bot = bot self.driver = bot.driver