discord

package
v4.23.0 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(config *model.NotifDiscord, meta model.Meta) notifier.Notifier

New creates a new discord notification instance

Types

type Client

type Client struct {
	*notifier.Notifier
	// contains filtered or unexported fields
}

Client represents an active discord notification object

func (*Client) Name

func (c *Client) Name() string

Name returns notifier's name

func (*Client) Send

func (c *Client) Send(entry model.NotifEntry) error

Send creates and sends a discord notification with an entry https://discord.com/developers/docs/resources/webhook#execute-webhook

type Embed

type Embed struct {
	Title       string         `json:"title,omitempty"`
	Description string         `json:"description,omitempty"`
	URL         string         `json:"url,omitempty"`
	Color       int            `json:"color,omitempty"`
	Footer      EmbedFooter    `json:"footer,omitempty"`
	Image       EmbedImage     `json:"image,omitempty"`
	Thumbnail   EmbedThumbnail `json:"thumbnail,omitempty"`
	Author      EmbedAuthor    `json:"author,omitempty"`
	Fields      []EmbedField   `json:"fields,omitempty"`
}

Embed contains all the information for an embed object

type EmbedAuthor

type EmbedAuthor struct {
	Name    string `json:"name"`
	URL     string `json:"url"`
	IconURL string `json:"icon_url"`
}

EmbedAuthor contains all the information for an embed author object

type EmbedField

type EmbedField struct {
	Name   string `json:"name"`
	Value  string `json:"value"`
	Inline bool   `json:"inline,omitempty"`
}

EmbedField contains all the information for an embed field object

type EmbedFooter

type EmbedFooter struct {
	Text    string `json:"text"`
	IconURL string `json:"icon_url"`
}

EmbedFooter contains all the information for an embed footer object

type EmbedImage

type EmbedImage struct {
	URL string `json:"url"`
}

EmbedImage contains all the information for an embed image object

type EmbedThumbnail

type EmbedThumbnail struct {
	URL string `json:"url"`
}

EmbedThumbnail contains all the information for an embed thumbnail object

type Message

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

Message contains all the information for a message

Jump to

Keyboard shortcuts

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