dsnotify

package module
v0.0.0-...-653e41e Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: MIT Imports: 10 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

dsnotify

Trivial golang stream event notifier for discord.

Setup

Two required config files must be provided.

  1. Auth config (default ./auth.yaml), which includes the token or oauth2 key for the application.
token: <authentication token>
  1. DSNotify config (default ./dsnotify.yaml), which contains the guilds on which to listen, channel/role to notify, and enablement/debug settings. Multiple servers may be provided.
<First Guild ID>:
  channel: <Channel ID to notify>
  role: <Role to mention>
  debug: False
  enabled: True
<Second Guild ID>:
  channel: <Channel ID to notify>
  role: <Role to mention>
  debug: False
  enabled: False

Run

$ ls
auth.yaml  dsnotify.yaml  main.go

$ go run main.go -h
Usage of /tmp/go-build1647414645/b001/exe/main:
  -auth string
        Auth config filename (default "./auth.yaml")
  -config string
        Server config filename (default "./dsnotify.yaml")
  -ready string
        Ready message (default "Discord Stream Notify")

$ go run main.go
2024/05/29 23:26:54 [INFO] DSNotify is now playing Discord Stream Notify.  Press CTRL-C to exit.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Listen

func Listen()

Types

type AuthConfig

type AuthConfig struct {
	Token  string `yaml:"token"`
	Bearer string `yaml:"oauth2"`
}

type DSNotifyConfig

type DSNotifyConfig struct {
	Auth   *AuthConfig
	Guilds map[string]*GuildConfig
}

type GuildConfig

type GuildConfig struct {
	Debug         bool   `yaml:"debug"`
	Enabled       bool   `yaml:"enabled"`
	NotifyChannel string `yaml:"channel"`
	NotifyRole    string `yaml:"role"`
}

type Streamer

type Streamer struct {
	User      string
	Nick      string
	Guild     string
	Channel   string
	Timestamp time.Time
}

Directories

Path Synopsis
cmd
dsnotify command

Jump to

Keyboard shortcuts

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