diff --git a/hypchat/restobject.py b/hypchat/restobject.py index c94d21b..73161ad 100644 --- a/hypchat/restobject.py +++ b/hypchat/restobject.py @@ -145,9 +145,10 @@ def message(self, message): Allows a user to send a message to a room. """ data = {'message': message} - self._requests.post(self.url + '/message', data=data) + resp = self._requests.post(self.url + '/message', data=data) + return Linker._obj_from_text(resp.text, self._requests) - def notification(self, message, color=None, notify=False, format=None): + def notification(self, message, color=None, notify=False, format=None, card=None, attach_to=None): """ Send a message to a room. """ @@ -159,6 +160,10 @@ def notification(self, message, color=None, notify=False, format=None): data = {'message': message, 'notify': notify, 'message_format': format} if color: data['color'] = color + if card: + data['card'] = card + if attach_to: + data['attach_to'] = attach_to self._requests.post(self.url + '/notification', data=data) def topic(self, text):