webhook

package
Version: v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2021 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Webhook

type Webhook struct {
	Content         string                 `json:"content"`
	Username        string                 `json:"username,omitempty"`
	AvatarURL       string                 `json:"avatar_url,omitempty"`
	TTS             bool                   `json:"tts,omitempty"`
	Embeds          []*embed.Embed         `json:"embeds"`
	AllowedMentions *embed.AllowedMentions `json:"allowed_mentions"`
}

Webhook is a Discord webhook

func (*Webhook) Request

func (w *Webhook) Request(ctx context.Context, webhookURL string) (*http.Request, error)

Request returns the Webhook as an *http.Request payload

Useful if using with a custom http.Client

func (*Webhook) Send

func (w *Webhook) Send(ctx context.Context, webhookURL string) (*http.Response, error)

Send is a basic convenience for sending a Webhook

type WebhookEdit

type WebhookEdit struct {
	Content         string                 `json:"content"`
	Embeds          []*embed.Embed         `json:"embeds"`
	AllowedMentions *embed.AllowedMentions `json:"allowed_mentions"`
}

WebhookEdit https://discord.com/developers/docs/resources/webhook#edit-webhook-message

Source Files

Jump to

Keyboard shortcuts

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