Commit Graph

11 Commits

Author SHA1 Message Date
Rohitt Vashishtha 45f27cd058 bots: Allow optional config files for bots. 2017-06-21 16:43:58 -04:00
Abhijeet Kaur c42d935be8 bots: Move "EmbeddedBotHandler" class to "zerver/lib/bot_lib.py" file.
This would keep embedded classes for zulip at one place, that is, in
"zerver" directory. This also fixes break in PyPI package for bindings.
2017-06-21 16:01:16 -04:00
Abhijeet Kaur 55c0dee1c3 bots: Add a separate class "EmbeddedHandlerBots" in bot_lib.py.
Add another class for bot type as embedded bot, for bots that run directly
on Zulip server. This class uses internal 'internal_send_messages' from
actions.py instead of using the 'send_message' function from Zulip Client
class.

We haven't gone ahead with creating an abstract superclass right away.
We just have two versions for now, it would be easier to iterate a little
more on the interfaces, and then only add the superclass when we're ready
to lock down the interface.
2017-06-21 10:22:53 -04:00
Abhijeet Kaur 68777e93a0 bots: Rename BotHandlerApi class to ExternalBotHandler.
This change is done for better understanding of the class functionality
from its class name. Now there will be 3 different classes for bots,
namely 'ExternalBotHandler', 'FlaskBotHandler' and  'EmbeddedBotHandler'.
2017-06-21 10:22:53 -04:00
Tim Abbott 5f299328b0 mypy: Fix likely typeshed warning with readfp. 2017-06-15 03:42:05 -07:00
Robert Hönig 6b0aa7f345 bots: Check existance of config file in get_config_info(). 2017-06-15 02:17:31 -07:00
Robert Hönig af5a17540b bots: Add `get_config_info` function for bots. 2017-06-14 20:25:07 -07:00
Robert Hönig 6d47d1bdba bots: Add non-obligatory initialize func for bots.
A bot that implements `initialize(client)` has initial
access to the `client` object, before `handle_message`
is called.
2017-06-14 20:25:07 -07:00
Robert Hönig f9c5086658 bots: Rename BotHandlerApi object `client` to `bot_handler`. 2017-06-13 11:13:23 -07:00
Aditya Bansal 8d06b5d9d9 pep8: Add compliance with rule E261 bot_lib.py. 2017-06-04 15:00:42 +05:30
Rohitt Vashishtha db9918f3d6 bots: Move contrib_bots to api/bots*.
This will make it convenient to include these bots in Zulip API
releases on pypi.

Fix #5009.
2017-06-01 12:31:54 -07:00