From 6f74d5414a7f03fad600fea5dcbb82423910d228 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yago=20Gonz=C3=A1lez?= Date: Tue, 7 Aug 2018 19:20:34 +0200 Subject: [PATCH] api: Implement POST /messages//reactions. --- zulip/zulip/__init__.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/zulip/zulip/__init__.py b/zulip/zulip/__init__.py index b186633..3042572 100644 --- a/zulip/zulip/__init__.py +++ b/zulip/zulip/__init__.py @@ -773,6 +773,24 @@ class Client(object): method='GET' ) + def add_reaction(self, reaction_data): + # type: (Dict[str, str]) -> Dict[str, Any] + ''' + Example usage: + + >>> client.add_emoji_reaction({ + 'message_id': '100', + 'emoji_name': 'joy', + 'emoji_code': '1f602', + 'emoji_type': 'unicode_emoji' + }) + {'result': 'success', 'msg': ''} + ''' + return self.call_endpoint( + url='messages/{}/reactions'.format(reaction_data['message_id']), + method='POST', + ) + def remove_reaction(self, reaction_data): # type: (Dict[str, str]) -> Dict[str, Any] '''