spyglass-receiver

command module
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 1, 2021 License: BSL-1.0 Imports: 12 Imported by: 0

README

spyglass-receiver

Discord Boost License 1.0 Go Report Card GitHub Actions

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

  1. Download the example config file from this repo and name it config.yml.

  2. 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.

spyglass-receiver debug mode

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.

Format & lint code
$ gofmt -w -s .
$ golint -set_exit_status ./...

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL