mostr-zulip-bot/zulip_botserver
Prakhar Pratyush ccda105d1d bot_server: Support trigger private_message renamed to direct_message.
The JSON payload that Zulip server POST for outgoing webhooks
has 'trigger' as one of the fields.

In https://github.com/zulip/zulip/commit/c4e4737, we renamed
the 'private_message' value to 'direct_message'.

This commit adds support to the botserver for handling
'direct_message' as a trigger value. It still supports
'private_message' for self-hosted server compatibility.
2023-09-21 09:13:40 -07:00
..
tests api: Fetch server_settings when initializing Client. 2021-10-13 09:26:56 -07:00
zulip_botserver bot_server: Support trigger private_message renamed to direct_message. 2023-09-21 09:13:40 -07:00
README.md zulip-botserver: Document use of environment var in README.md 2021-01-07 00:31:26 -08:00
setup.py Remove Python 3.6; add Python 3.10. 2023-01-24 12:04:59 -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