From 3f2b11c345028ac9d9454f496fb3bce9f59fbc55 Mon Sep 17 00:00:00 2001 From: Roger Souza Date: Mon, 17 Dec 2018 20:27:23 -0300 Subject: [PATCH] api: Implement POST /realm/emoji. --- zulip/zulip/__init__.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/zulip/zulip/__init__.py b/zulip/zulip/__init__.py index aab08b7..4823dd8 100644 --- a/zulip/zulip/__init__.py +++ b/zulip/zulip/__init__.py @@ -864,6 +864,20 @@ class Client(object): method='GET' ) + def upload_custom_emoji(self, emoji_name, file_obj): + # type: (str, IO[Any]) -> Dict[str, Any] + ''' + Example usage: + + >>> client.upload_custom_emoji(emoji_name, file_obj) + {'result': 'success', 'msg': ''} + ''' + return self.call_endpoint( + 'realm/emoji/{}'.format(emoji_name), + method='POST', + files=[file_obj] + ) + def get_realm_filters(self): # type: () -> Dict[str, Any] '''