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.

                Source Files