From be8e8c53ce9de3f3c4461f2a5dd9c40fdb68952b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bienvenido=20Sa=CC=81ez=20Muelas?= Date: Wed, 13 Apr 2016 17:25:38 +0200 Subject: [PATCH] Add from field to notification --- hypchat/restobject.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hypchat/restobject.py b/hypchat/restobject.py index c94d21b..8cea291 100644 --- a/hypchat/restobject.py +++ b/hypchat/restobject.py @@ -147,7 +147,7 @@ def message(self, message): data = {'message': message} self._requests.post(self.url + '/message', data=data) - def notification(self, message, color=None, notify=False, format=None): + def notification(self, message, color=None, notify=False, format=None, from=None): """ Send a message to a room. """ @@ -157,6 +157,8 @@ def notification(self, message, color=None, notify=False, format=None): else: format = 'html' data = {'message': message, 'notify': notify, 'message_format': format} + if from: + data['from'] = from if color: data['color'] = color self._requests.post(self.url + '/notification', data=data)