diff options
author | Jordan <me@jordan.im> | 2022-03-17 09:43:29 -0700 |
---|---|---|
committer | Jordan <me@jordan.im> | 2022-03-17 09:43:29 -0700 |
commit | 66bfe530b4fd5cb9755337ce718df26ee81f1b77 (patch) | |
tree | 9dfc8a79183b8bffc12db5a92f957e3bfd37d4f2 /vendor/github.com/bwmarrin/discordgo/webhook.go | |
parent | 2f0b35e3c25bc4394f3288e1baa77d250cb510ed (diff) | |
download | keep-66bfe530b4fd5cb9755337ce718df26ee81f1b77.tar.gz keep-66bfe530b4fd5cb9755337ce718df26ee81f1b77.zip |
misc: go get -u ./... ; go mod vendor
Diffstat (limited to 'vendor/github.com/bwmarrin/discordgo/webhook.go')
-rw-r--r-- | vendor/github.com/bwmarrin/discordgo/webhook.go | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/vendor/github.com/bwmarrin/discordgo/webhook.go b/vendor/github.com/bwmarrin/discordgo/webhook.go new file mode 100644 index 0000000..f54a45c --- /dev/null +++ b/vendor/github.com/bwmarrin/discordgo/webhook.go @@ -0,0 +1,49 @@ +package discordgo + +// Webhook stores the data for a webhook. +type Webhook struct { + ID string `json:"id"` + Type WebhookType `json:"type"` + GuildID string `json:"guild_id"` + ChannelID string `json:"channel_id"` + User *User `json:"user"` + Name string `json:"name"` + Avatar string `json:"avatar"` + Token string `json:"token"` + + // ApplicationID is the bot/OAuth2 application that created this webhook + ApplicationID string `json:"application_id,omitempty"` +} + +// WebhookType is the type of Webhook (see WebhookType* consts) in the Webhook struct +// https://discord.com/developers/docs/resources/webhook#webhook-object-webhook-types +type WebhookType int + +// Valid WebhookType values +const ( + WebhookTypeIncoming WebhookType = 1 + WebhookTypeChannelFollower WebhookType = 2 +) + +// WebhookParams is a struct for webhook params, used in the WebhookExecute command. +type WebhookParams struct { + Content string `json:"content,omitempty"` + Username string `json:"username,omitempty"` + AvatarURL string `json:"avatar_url,omitempty"` + TTS bool `json:"tts,omitempty"` + Files []*File `json:"-"` + Components []MessageComponent `json:"components"` + Embeds []*MessageEmbed `json:"embeds,omitempty"` + AllowedMentions *MessageAllowedMentions `json:"allowed_mentions,omitempty"` + // NOTE: Works only for followup messages. + Flags uint64 `json:"flags,omitempty"` +} + +// WebhookEdit stores data for editing of a webhook message. +type WebhookEdit struct { + Content string `json:"content,omitempty"` + Components []MessageComponent `json:"components"` + Embeds []*MessageEmbed `json:"embeds,omitempty"` + Files []*File `json:"-"` + AllowedMentions *MessageAllowedMentions `json:"allowed_mentions,omitempty"` +} |