discord

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Embed added in v1.4.0

type Embed struct {
	Description string `json:"description"`
	Color       string `json:"color"`
}

Embed is a custom field for a Discord webhook payload.

type Payload added in v1.4.0

type Payload struct {
	Username  string  `json:"username"`
	AvatarURL string  `json:"avatar_url"`
	Embeds    []Embed `json:"embeds"`
}

Payload is the json sent to the Discord webhook endpoint.

type Provider

type Provider struct {
	WebhookURL string `yaml:"webhookURL"`
	AvatarURL  string `yaml:"avatarURL"`
	IsEnabled  bool   `yaml:"enabled"`
}

Provider is an implementation of the `go-aws-news/providers` Provider interface.

func (*Provider) Enabled

func (p *Provider) Enabled() bool

Enabled returns true if the provider is enabled in the config.

func (*Provider) GetName

func (*Provider) GetName() string

GetName returns the Provider's name.

func (*Provider) Notify

func (p *Provider) Notify(news news.Announcements)

Notify is the function executed to POST to a provider's webhook url.

Jump to

Keyboard shortcuts

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