From b04f5f975339a56fe80f4213e84afdd2b8335ea8 Mon Sep 17 00:00:00 2001 From: PIG208 <359101898@qq.com> Date: Thu, 13 May 2021 19:38:29 +0800 Subject: [PATCH] terminal: Implement react for TerminalBotHandler. Fixes: #686 --- zulip_bots/zulip_bots/simple_lib.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zulip_bots/zulip_bots/simple_lib.py b/zulip_bots/zulip_bots/simple_lib.py index c466f2f..1a72464 100644 --- a/zulip_bots/zulip_bots/simple_lib.py +++ b/zulip_bots/zulip_bots/simple_lib.py @@ -53,7 +53,10 @@ class TerminalBotHandler: return BotIdentity("bot name", "bot-email@domain") def react(self, message, emoji_name): - raise NotImplementedError + print("""The bot reacts to message #{}: {}""".format(message["id"], emoji_name)) + return self.message_server.add_reaction(dict(message_id=message['id'], + emoji_name=emoji_name, + reaction_type='unicode_emoji')) def send_message(self, message): if message['type'] == 'stream':