discord

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2026 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package discord delivers Console events to a Discord channel via a channel Webhook URL. Discord webhooks need no bot token or scopes — just the URL — which keeps setup trivial for self-hosters, the same way the Slack sink does.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Notifier

type Notifier struct {
	// WebhookURL is the Discord channel Webhook endpoint.
	WebhookURL string
	// HTTP issues the POST. If nil, a client with a sane timeout is used.
	HTTP *http.Client
}

Notifier posts events to a Discord channel Webhook.

func New

func New(webhookURL string, opts ...Option) *Notifier

New builds a Discord notifier for the given channel Webhook URL.

func (*Notifier) Name

func (n *Notifier) Name() string

Name identifies the sink.

func (*Notifier) Notify

func (n *Notifier) Notify(ctx context.Context, ev core.Event) error

Notify posts ev to the configured webhook as a single colored embed.

type Option

type Option func(*Notifier)

Option configures a Notifier.

func WithHTTPClient

func WithHTTPClient(c *http.Client) Option

WithHTTPClient sets the HTTP client.

Jump to

Keyboard shortcuts

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