goose

command module
v0.0.0-...-17c7e8b Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2023 License: MPL-2.0 Imports: 22 Imported by: 0

README

Goose

Discord bot that announces new items on RSS feeds 🪿 honk!

⚠️ Not appropriate for production use ⚠️

This application is not designed to scale horizontally:

  • Discord bot sharding is not implemented.
  • Notification persisted state is stored in a table and not a queue, so if there was another goose process running there's a big chance they would race and potentially duplicate notifications.

Usage

When goose is first added to the server, it will install the following slash commands such that only the server administrator may invoke them.

The server administrator can add overrides in the server settings to allow individual members or members with a given role access to the slash commands.

Command Arguments Description
/subscribe channel, URL to feed, collection name Subscribes the server to the feed at the given URL identified by the given collection name. New items are announced on the supplied channel.
/unsubscribe collection name Unsubscribes the server from the feed identified by collection name.
/test collection name Emits the last published item on the feed identified by collection name.

Outside of that, goose will automatically announce new items on feeds that the server is subscribed to.

Usage screencast

Building

Prerequisites:

  1. A Go toolchain

Simply run go build.

Running

Prerequisites:

  1. Valid Discord bot token with the "bot" and "applications.commands" scopes
  2. PostgreSQL database
  3. goose binary (see "Building")
  4. migrate

Once you have a valid Postgres DSN, make sure you run the migrations with migrate so that all of the tables are set up:

$ migrate -database=$GOOSE_POSTGRES_DSN -path ./migrations/postgres up

goose needs to be configured to use the Discord token and a valid Postgres DSN. You can supply these at the command line:

$ goose -discord-token <SECRET_BOT_DISCORD_TOKEN> \
        -postgres-dsn <SECRET_POSTGRES_DSN>

Or you can supply them as environment variables. These override any values set at the command line:

$ export GOOSE_DISCORD_TOKEN="SECRET_BOT_DISCORD_TOKEN"
$ export GOOSE_POSTGRES_DSN="postgres://goose:goose@localhost:55432/goose?sslmode=disable"
$ goose

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