zulip / python-zulip-api

Python library for the Zulip API.
https://zulip.com/api/
Apache License 2.0
350 stars 352 forks source link

Implement react for TerminalBotHandler #688

Closed PIG208 closed 3 years ago

PIG208 commented 3 years ago

Fixes #686.

Enter your message: j

Reply from the bot is printed between the dotted lines:
-------
beep boop
-------
The bot reacts to message #1: wave
Enter your message: p

Reply from the bot is printed between the dotted lines:
-------
beep boop
-------
The bot reacts to message #3: wave
LoopThrough-i-j commented 3 years ago

I had a look and things look good. @neiljp would you mind reviewing?

timabbott commented 3 years ago

This lgtm, merged, thanks @PIG208 and @LoopThrough-i-j!

I think we should do a round of adding docstring/comment documentation to TerminalBotHandler explaining what's going on -- e.g. the send_message function looks like it's doing something twice now, basically because the context isn't clear that it's recording the data in the SimpleMessageServer mock server.

(We might also want to rename SimpleMessageServer toMockZulipServer`, for clarity).