From 7ccb615b2fe151226dd60888ce4ce9a97ab32768 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Pl=C3=BCmer?= Date: Sun, 15 Oct 2017 20:50:02 +0200 Subject: [PATCH] Fix not being able to send cards to other rooms #28 --- mattermost.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mattermost.py b/mattermost.py index 68eb8a3..c4aa0c6 100644 --- a/mattermost.py +++ b/mattermost.py @@ -392,6 +392,10 @@ def send_card(self, card: Card): 'attachments': [attachment] } + if card.to: + if isinstance(card.to, MattermostRoom): + data['channel'] = card.to.name + try: log.debug('Sending data:\n%s', data) # We need to send a webhook - mattermost has no api endpoint for attachments/cards