Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
Will Nelson committed Dec 27, 2021
1 parent 79de390 commit 32790be
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ event being output to STDOUT.
$ docker run --rm -it
-e DISCORD_TOKEN="your token"
-e DISCORD_EVENTS=MESSAGE_CREATE
-e DISCORD_INTENTS=GUILD,GUILD_MESSAGES
spectacles/gateway
```

Expand All @@ -53,37 +54,39 @@ variables take precedence over their corresponding entry in the config file.
token = "" # Discord token
events = [] # array of gateway event names to publish

# everything below is optional

# https://discord.com/developers/docs/topics/gateway#gateway-intents
intents = [] # array of gateway intents to send when identifying
# https://gist.github.com/msciotti/223272a6f976ce4fda22d271c23d72d9

# everything below is optional

[shards]
count = 2
ids = [0, 1]

[broker]
type = "amqp" # only supported type; any other value sends/receives from STDIN/STDOUT
type = "redis" # can also use "amqp"
group = "gateway"
message_timeout = "2m" # this is the default value: https://golang.org/pkg/time/#ParseDuration

# exposes Prometheus-compatible statistics
[prometheus]
address = ":8080"
endpoint = "/metrics"

[shard_store]
type = "redis" # only supported type
type = "redis" # if left empty, shard info is stored locally
prefix = "gateway" # string to prefix shard-store keys

[presence]
# https://discord.com/developers/docs/topics/gateway#update-status

[amqp]
url = "amqp://localhost"

[redis]
url = "localhost:6379"
pool_size = 5 # size of Redis connection pool

# required for AMQP broker type
[amqp]
url = "amqp://localhost"
```

Example presence:
Expand Down Expand Up @@ -132,24 +135,24 @@ message broker. Your application is completely unaware of the existence of shard
on handling incoming messages.

By default, the Spectacles Gateway sends and receives data through standard input and output. For
optimal use, you should use one of the available message broker protocols (currently only AMQP) to
send output to an external message broker (we recommend RabbitMQ). Your application can then
optimal use, you should use one of the available message broker protocols (Redis or AMQP) to
send output to an external message broker (we recommend Redis). Your application can then
consume messages from the message broker.

Logs are output to STDERR and can be used to inspect the state of the gateway at any point. The
Spectacles Gateway also offers integration with Prometheus to enable detailed stats collection.

If you configure a shard storage solution (currently only Redis), shard information will be stored
there and used if/when the Spectacles Gateway restarts. If the Gateway restarts quickly enough, it
will be able to resume sessions without re-identifying to Discord.
will be able to resume sessions without re-identifying to Discord. If you do not configure shard
storage, the gateway will just store the info in local memory.

## Goals

- [ ] Multiple output destinations
- [x] Multiple output destinations
- [x] STDIO
- [x] AMQP
- [ ] Redis
- [ ] ???
- [x] Redis
- [x] Sharding
- [x] Internal
- [x] External
Expand Down

0 comments on commit 32790be

Please sign in to comment.