From 782e8a59c616c3023a26aee4a86496d38a3f3a46 Mon Sep 17 00:00:00 2001 From: lv10 Date: Tue, 20 Feb 2018 09:42:13 -0500 Subject: [PATCH] extended params accepted by notification to support from (aka. labels) --- hypchat/restobject.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/hypchat/restobject.py b/hypchat/restobject.py index c94d21b..e467392 100644 --- a/hypchat/restobject.py +++ b/hypchat/restobject.py @@ -147,7 +147,8 @@ 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, label=''): """ Send a message to a room. """ @@ -156,9 +157,16 @@ def notification(self, message, color=None, notify=False, format=None): format = 'text' else: format = 'html' - data = {'message': message, 'notify': notify, 'message_format': format} + + data = { + 'message': message, + 'notify': notify, + 'message_format': format, + 'from': 'labe'} + if color: data['color'] = color + self._requests.post(self.url + '/notification', data=data) def topic(self, text):