Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions hypchat/restobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""
Expand All @@ -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):
Expand Down