This refactor makes the nested class 'StateHandler' in the
file /contrib_bots/bot_lib.py independent class. It previously
was nested in 'run_message_handler_for_bot' function.
This is done to write a cleaner test file for contrib_bots using
mock library.
The converter bot depended on past.utils.old_div,
which is not supported anymore. Updating the code
to use the // operator, which provides the same
functionality.
Instead of using the `scripts` keyword, we now use the
`console_scripts` entry point to point to the zulip-send script
to be installed. This is what the Python Packaging User Guide
recommends for better cross-platform compatibility.
run.py requires that the location of the provided bot matches the location
of run.py. However, run.py previously failed in the case where the location
included a symlink.
The regex used for parsing .crypt-table didn't allow colons in class
names. This commit changes the [^:] token with \S, meaning that class
names can now contain colons but can no longer contain whitespace.
I think this should be fine, since zcrypt is only used for MIT zephyr,
where (by convention) class names do not contain whitespace.
Additionally, it should not be possible for us to accidentally consume a
field-separating colon as part of the class capture group because the
regex enforces that all field-separating colons are followed by one or
more whitespace characters, whereas the class name cannot contain
whitespace.
Now this bot follows our latest structure for contrib_bots.
Switched the dependencies instructions, to install "google" rather than
"google-api-python-client".
Added all the search terms to the query (not only the first one).
Add one function (get_bot_botname_response()) that generates response
from the given input and replies back to the handle_message with the final
content of response to be sent. Also add code to bots(except followup) to
reply to private messages along with stream messages.