discordwebhook

package
v1.1.8 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2019 License: CC0-1.0 Imports: 4 Imported by: 0

Documentation

Overview

Package discordwebhook is a simple low-level HTTP client wrapper around Discord webhooks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Send

func Send(whurl string, w Webhook) *http.Request

Send returns a request for a Discord webhook.

func Validate

func Validate(resp *http.Response) error

Validate validates the response from Discord.

Types

type EmbedField

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

EmbedField is an individual field being embedded in a message.

type EmbedFooter

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

EmbedFooter is the message footer.

type Embeds

type Embeds struct {
	Fields []EmbedField `json:"fields"`
	Footer EmbedFooter  `json:"footer"`
}

Embeds is a set of embed fields and a footer.

type Webhook

type Webhook struct {
	Content   string   `json:"content,omitifempty"`
	Username  string   `json:"username"`
	AvatarURL string   `json:"avatar_url"`
	Embeds    []Embeds `json:"embeds,omitifempty"`
}

Webhook is the parent structure fired off to Discord.

Jump to

Keyboard shortcuts

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