Versions in this module Expand all Collapse all v1 v1.0.0 Jul 15, 2026 Changes in this version + func ParseWebhookURL(webhookURL string) (id, token string, err error) + type APIError struct + Code int + Errors json.RawMessage + Message string + RateLimited bool + RawBody []byte + RetryAfter float64 + StatusCode int + func (e *APIError) Error() string + type ActionRow struct + Components []Component + ID int + Type ComponentType + func NewActionRow(children ...Component) *ActionRow + type AllowedMentions struct + Parse []MentionType + RepliedUser *bool + Roles []string + Users []string + func Mentions() *AllowedMentions + func (m *AllowedMentions) All() *AllowedMentions + func (m *AllowedMentions) None() *AllowedMentions + func (m *AllowedMentions) ParseTypes(types ...MentionType) *AllowedMentions + func (m *AllowedMentions) ReplyMention(mention bool) *AllowedMentions + func (m *AllowedMentions) RoleIDs(ids ...string) *AllowedMentions + func (m *AllowedMentions) UserIDs(ids ...string) *AllowedMentions + func (m AllowedMentions) MarshalJSON() ([]byte, error) + type Attachment struct + ContentType string + Description string + Ephemeral bool + Filename string + Flags int + Height *int + ID string + ProxyURL string + Size int + Title string + URL string + Width *int + type AttachmentRef struct + Description string + Filename string + ID any + IsSpoiler *bool + Title string + type Button struct + CustomID string + Disabled bool + Emoji *ComponentEmoji + ID int + Label string + SKUId string + Style ButtonStyle + Type ComponentType + URL string + func NewButton(style ButtonStyle, label, customID string) *Button + func NewLinkButton(label, url string) *Button + func (b *Button) SetDisabled(disabled bool) *Button + func (b *Button) WithEmoji(name, id string, animated bool) *Button + type ButtonStyle int + const ButtonDanger + const ButtonLink + const ButtonPremium + const ButtonPrimary + const ButtonSecondary + const ButtonSuccess + type ChannelSelect struct + ChannelTypes []int + CustomID string + DefaultValues []SelectDefaultValue + Disabled bool + ID int + MaxValues *int + MinValues *int + Placeholder string + Type ComponentType + func NewChannelSelect(customID string) *ChannelSelect + type Client struct + func New(id, token string, opts ...Option) (*Client, error) + func NewFromURL(webhookURL string, opts ...Option) (*Client, error) + func (c *Client) DeleteMessage(ctx context.Context, messageID string, opts *MessageOpts) error + func (c *Client) EditMessage(ctx context.Context, messageID string, in any, opts *EditOpts) (*WebhookMessage, error) + func (c *Client) GetMessage(ctx context.Context, messageID string, opts *MessageOpts) (*WebhookMessage, error) + func (c *Client) ID() string + func (c *Client) Send(ctx context.Context, in any) (*WebhookMessage, error) + func (c *Client) SendSlack(ctx context.Context, body any) error + func (c *Client) URL() string + type Component interface + type ComponentEmoji struct + Animated bool + ID string + Name string + type ComponentType int + const ComponentActionRow + const ComponentButton + const ComponentChannelSelect + const ComponentContainer + const ComponentFile + const ComponentLabel + const ComponentMediaGallery + const ComponentMentionableSelect + const ComponentRoleSelect + const ComponentSection + const ComponentSeparator + const ComponentStringSelect + const ComponentTextDisplay + const ComponentTextInput + const ComponentThumbnail + const ComponentUserSelect + type Container struct + AccentColor *int + Components []Component + ID int + Spoiler bool + Type ComponentType + func NewContainer(children ...Component) *Container + func (c *Container) WithAccentColor(color int) *Container + type EditOpts struct + ThreadID string + WithComponents *bool + type Embed struct + Author *EmbedAuthor + Color *int + Description string + Fields []EmbedField + Footer *EmbedFooter + Image *EmbedMedia + Thumbnail *EmbedMedia + Timestamp string + Title string + URL string + type EmbedAuthor struct + IconURL string + Name string + URL string + type EmbedBuilder struct + func NewEmbed() *EmbedBuilder + func (b *EmbedBuilder) AddFields(fields ...EmbedField) *EmbedBuilder + func (b *EmbedBuilder) Author(name, url, iconURL string) *EmbedBuilder + func (b *EmbedBuilder) Build() *Embed + func (b *EmbedBuilder) Color(color int) *EmbedBuilder + func (b *EmbedBuilder) Description(description string) *EmbedBuilder + func (b *EmbedBuilder) Field(name, value string, inline bool) *EmbedBuilder + func (b *EmbedBuilder) Footer(text, iconURL string) *EmbedBuilder + func (b *EmbedBuilder) Image(url string) *EmbedBuilder + func (b *EmbedBuilder) Thumbnail(url string) *EmbedBuilder + func (b *EmbedBuilder) Timestamp(t time.Time) *EmbedBuilder + func (b *EmbedBuilder) TimestampString(ts string) *EmbedBuilder + func (b *EmbedBuilder) Title(title string) *EmbedBuilder + func (b *EmbedBuilder) URL(url string) *EmbedBuilder + type EmbedField struct + Inline bool + Name string + Value string + type EmbedFooter struct + IconURL string + Text string + type EmbedMedia struct + URL string + type File struct + ContentType string + Description string + Name string + Reader io.Reader + Spoiler bool + Title string + func FileFromBytes(name string, data []byte) *File + func FileFromPath(path string) (*File, error) + func FileFromReader(name string, r io.Reader) *File + func (f *File) AsSpoiler() *File + func (f *File) WithContentType(ct string) *File + func (f *File) WithDescription(desc string) *File + func (f *File) WithTitle(title string) *File + type FileComponent struct + File UnfurledMediaItem + ID int + Spoiler bool + Type ComponentType + func NewFileComponent(attachmentURL string) *FileComponent + type MediaGallery struct + ID int + Items []MediaGalleryItem + Type ComponentType + func NewMediaGallery(items ...MediaGalleryItem) *MediaGallery + type MediaGalleryItem struct + Description string + Media UnfurledMediaItem + Spoiler bool + type MentionType string + const MentionEveryone + const MentionRoles + const MentionUsers + type MentionableSelect struct + CustomID string + DefaultValues []SelectDefaultValue + Disabled bool + ID int + MaxValues *int + MinValues *int + Placeholder string + Type ComponentType + func NewMentionableSelect(customID string) *MentionableSelect + type MessageBuilder struct + func EditMessage() *MessageBuilder + func Message() *MessageBuilder + func (b *MessageBuilder) AddFlags(flags MessageFlags) *MessageBuilder + func (b *MessageBuilder) AllowedMentions(m *AllowedMentions) *MessageBuilder + func (b *MessageBuilder) AppliedTags(tagIDs ...string) *MessageBuilder + func (b *MessageBuilder) AttachmentMeta(refs ...AttachmentRef) *MessageBuilder + func (b *MessageBuilder) AvatarURL(url string) *MessageBuilder + func (b *MessageBuilder) Build() (*Payload, error) + func (b *MessageBuilder) Component(components ...Component) *MessageBuilder + func (b *MessageBuilder) ComponentsV2() *MessageBuilder + func (b *MessageBuilder) Content(content string) *MessageBuilder + func (b *MessageBuilder) Embed(embeds ...any) *MessageBuilder + func (b *MessageBuilder) EnableComponents(enable bool) *MessageBuilder + func (b *MessageBuilder) File(files ...*File) *MessageBuilder + func (b *MessageBuilder) Poll(poll any) *MessageBuilder + func (b *MessageBuilder) SetFlags(flags MessageFlags) *MessageBuilder + func (b *MessageBuilder) SuppressEmbeds() *MessageBuilder + func (b *MessageBuilder) SuppressNotifications() *MessageBuilder + func (b *MessageBuilder) TTS(tts bool) *MessageBuilder + func (b *MessageBuilder) ThreadID(id string) *MessageBuilder + func (b *MessageBuilder) ThreadName(name string) *MessageBuilder + func (b *MessageBuilder) Username(username string) *MessageBuilder + func (b *MessageBuilder) Wait(wait bool) *MessageBuilder + type MessageFlags int + const FlagIsComponentsV2 + const FlagSuppressEmbeds + const FlagSuppressNotifications + type MessageOpts struct + ThreadID string + type Option func(*Client) + func WithBaseURL(base string) Option + func WithHTTPClient(c *http.Client) Option + func WithUserAgent(ua string) Option + type Payload struct + AllowedMentions *AllowedMentions + AppliedTags []string + Attachments []AttachmentRef + AvatarURL string + Components []Component + Content string + Embeds []*Embed + Files []*File + Flags MessageFlags + Poll *Poll + TTS bool + ThreadID string + ThreadName string + Username string + Wait *bool + WithComponents *bool + type PayloadBuilder interface + Build func() (*Payload, error) + type Poll struct + AllowMultiselect *bool + Answers []PollAnswer + Duration *int + LayoutType PollLayoutType + Question PollMedia + type PollAnswer struct + PollMedia PollMedia + type PollBuilder struct + func NewPoll(question string) *PollBuilder + func (b *PollBuilder) Answer(text string) *PollBuilder + func (b *PollBuilder) AnswerWithEmoji(text, emojiID, emojiName string) *PollBuilder + func (b *PollBuilder) Build() *Poll + func (b *PollBuilder) DurationHours(hours int) *PollBuilder + func (b *PollBuilder) Layout(layout PollLayoutType) *PollBuilder + func (b *PollBuilder) Multiselect(allow bool) *PollBuilder + type PollEmoji struct + Animated bool + ID string + Name string + type PollLayoutType int + const PollLayoutDefault + type PollMedia struct + Emoji *PollEmoji + Text string + type RawComponent struct + JSON json.RawMessage + func (r RawComponent) MarshalJSON() ([]byte, error) + type RoleSelect struct + CustomID string + DefaultValues []SelectDefaultValue + Disabled bool + ID int + MaxValues *int + MinValues *int + Placeholder string + Type ComponentType + func NewRoleSelect(customID string) *RoleSelect + type Section struct + Accessory Component + Components []Component + ID int + Type ComponentType + func NewSection(accessory Component, text ...*TextDisplay) *Section + type SelectDefaultValue struct + ID string + Type string + type SelectOption struct + Default bool + Description string + Emoji *ComponentEmoji + Label string + Value string + type Separator struct + Divider *bool + ID int + Spacing SeparatorSpacing + Type ComponentType + func NewSeparator(spacing SeparatorSpacing, divider bool) *Separator + type SeparatorSpacing int + const SeparatorLarge + const SeparatorSmall + type StringSelect struct + CustomID string + Disabled bool + ID int + MaxValues *int + MinValues *int + Options []SelectOption + Placeholder string + Type ComponentType + func NewStringSelect(customID string, options ...SelectOption) *StringSelect + type TextDisplay struct + Content string + ID int + Type ComponentType + func NewTextDisplay(content string) *TextDisplay + type Thumbnail struct + Description string + ID int + Media UnfurledMediaItem + Spoiler bool + Type ComponentType + func NewThumbnail(url string) *Thumbnail + type UnfurledMediaItem struct + URL string + type User struct + Avatar string + Bot bool + Discriminator string + GlobalName string + ID string + Username string + type UserSelect struct + CustomID string + DefaultValues []SelectDefaultValue + Disabled bool + ID int + MaxValues *int + MinValues *int + Placeholder string + Type ComponentType + func NewUserSelect(customID string) *UserSelect + type WebhookMessage struct + Attachments []Attachment + Author *User + ChannelID string + Components jsonComponents + Content string + EditedTimestamp string + Embeds []Embed + Flags MessageFlags + ID string + MentionEveryone bool + Pinned bool + TTS bool + Timestamp string + Type int + WebhookID string