x: within.website/x/web/discordwebhook Index | Files

package discordwebhook

import "within.website/x/web/discordwebhook"

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

Index

Package Files

webhook.go

func Send Uses

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

Send returns a request for a Discord webhook.

func Validate Uses

func Validate(resp *http.Response) error

Validate validates the response from Discord.

type EmbedField Uses

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 Uses

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

EmbedFooter is the message footer.

type Embeds Uses

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

Embeds is a set of embed fields and a footer.

type Webhook Uses

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.

Package discordwebhook imports 4 packages (graph) and is imported by 2 packages. Updated 2019-06-07. Refresh now. Tools for package owners.