Skip to content

goodbot: Configuration

qedk edited this page Jun 29, 2020 · 1 revision

The Python Zulip API expects the configuration file to be in the format:

[api]
email=emailaddress@zulipchat.com
key=topsecretapikey
site=https://wikimedia.zulipchat.com

This file is automatically generated in the "Your bots" section on Zulipchat but your system might complain if you try to modify it since the file name starts with a period (.), as they signify system-generated files. You can use any file name of your choice and pass it to the config_file argument and create a Zulip Client like:

self.client = zulip.Client(config_file=config_file)

All the REST API actions are done using this client.

You can also use environment variables to the same effect but goodbot does not use them, instead preferring to do environment-based configuration behind the scenes.