Skip to content

Commit

Permalink
Document environment variable config
Browse files Browse the repository at this point in the history
  • Loading branch information
Will Nelson committed Mar 13, 2020
1 parent 62113aa commit 49c0337
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,14 @@ Usage of gateway:
log level for the client (default "info")
```

The config file is required.
The gateway can be configured using either a config file or environment variables. Environment
variables take precedence over their corresponding entry in the config file.

### Config file

```toml
token = "" # Discord token
events = [] # array of event names to publish
events = [] # array of gateway event names to publish

# everything below is optional

Expand All @@ -59,3 +62,23 @@ message_timeout = "2m" # this is the default value
address = ":8080"
endpoint = "/metrics"
```

### Environment variables

Each of the below environment variables corresponds exactly to the config file above.

- `DISCORD_TOKEN`
- `EVENTS`: comma-separated list of gateway events

Optional:

- `DISCORD_INTENTS`: comma-separated list of gateway intents
- `DISCORD_RAW_INTENTS`: bitfield containing raw intent flags
- `DISCORD_SHARD_COUNT`
- `DISCORD_SHARD_IDS`: comma-separated list of shard IDs
- `BROKER_TYPE`
- `BROKER_URL`
- `BROKER_GROUP`
- `BROKER_MESSAGE_TIMEOUT`: https://golang.org/pkg/time/#ParseDuration
- `PROMETHEUS_ADDRESS`
- `PROMETHEUS_ENDPOINT`

0 comments on commit 49c0337

Please sign in to comment.