python-zulip-api/zulip_botserver
PIG208 5b32b32914 botserver: Return a valid JSON that is acceptable to outgoing webhooks.
In zulip/zulip@b998138d3a, we introduce
a check for responses from outgoing webhooks that require them to be
a dictionary. This commit fixes the return value of the botserver view
function to accommodate with the change from the serverside.
2021-05-11 09:08:04 -07:00
..
tests mypy: Remove unused type: ignore comments. 2021-03-04 15:09:58 -08:00
zulip_botserver botserver: Return a valid JSON that is acceptable to outgoing webhooks. 2021-05-11 09:08:04 -07:00
README.md zulip-botserver: Document use of environment var in README.md 2021-01-07 00:31:26 -08:00
setup.py python-zulip-api: Drop python3.5 support. 2021-02-26 07:32:47 -08:00
zulip-botserver-supervisord.conf botserver: Rename zulip-bot-server to zulip-botserver. 2018-06-04 10:14:17 -07:00

zulip-botserver --config-file <path to botserverrc> --hostname <address> --port <port>

Example: zulip-botserver --config-file ~/botserverrc

This program loads the bot configurations from the config file (botserverrc, here) and loads the bot modules. It then starts the server and fetches the requests to the above loaded modules and returns the success/failure result.

The --hostname and --port arguments are optional, and default to 127.0.0.1 and 5002 respectively.

The format for a configuration file is:

[helloworld]
key=value
email=helloworld-bot@zulip.com
site=http://localhost
token=abcd1234

Is passed --use-env-vars instead of --config-file, the configuration can instead be provided via the ZULIP_BOTSERVER_CONFIG environment variable. This should be a JSON-formatted dictionary of bot names to dictionary of their configuration; for example:

ZULIP_BOTSERVER_CONFIG='{"helloworld":{"email":"helloworld-bot@zulip.com","key":"value","site":"http://localhost","token":"abcd1234"}}' \
  zulip-botserver --use-env-vars