spyglass-receiver
An AMQP consumer for handling Twitch stream events from Spyglass.
Upon receiving an event, spyglass-receiver fetches data from Twitch about the stream and sends out Discord messages to the relevant channels.
Building
Pre-built binaries for Linux and Windows are included with each GitHub release.
A public Docker image is also available on Docker Hub.
However, if you want to build spyglass-receiver yourself, you can run the following:
$ CGO_ENABLED=0 GOARCH=amd64 GOOS=linux go build -o spyglass-receiver main.go
Setup
-
Download the example config file from this repo and name it config.yml
.
-
Insert the required credentials:
- AMQP server URL and queue name
- Discord bot token
- MongoDB server URL, database, and collection
- RethinkDB hosts, username, password, and databases
- Twitch client ID & client secret
...and you're done!
Debug mode
Setting the debug
property on config.yml to true
will enable the addition of an extra embed field on notification online messages.
This embed field contains the current game, notification, stream, and Twitch user IDs.
Running with Docker
A Dockerfile and example docker-compose.yml
are included for your convenience.
Spyglass-receiver is also available on Docker Hub.
To build a Docker image, run the following:
$ docker build -t streamcord/spyglass-receiver:latest .
Then create a container as such:
$ sudo docker run -d \
--name spyglass-receiver \
--volume "PATH/TO/config.yml:/app/config.yml:ro" \
--restart unless-stopped \
streamcord/spyglass-receiver:latest
Contributing
Pull requests and issues are welcome.
$ gofmt -w -s .
$ golint -set_exit_status ./...