Skip to content

Commit

Permalink
Fix not having a channelid to join a room
Browse files Browse the repository at this point in the history
  • Loading branch information
Vaelor committed Nov 27, 2017
1 parent 2c44afd commit aa61bb1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion mattermost.plug
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 6 additions & 0 deletions src/mattermostRoom.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit aa61bb1

Please sign in to comment.