Skip to content

Commit

Permalink
Add AttachmentFlags
Browse files Browse the repository at this point in the history
  • Loading branch information
sebm253 committed Jul 6, 2023
1 parent 07e3134 commit 51191a4
Showing 1 changed file with 22 additions and 12 deletions.
34 changes: 22 additions & 12 deletions discord/attachment.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,34 @@ import (

// Attachment is used for files sent in a Message
type Attachment struct {
ID snowflake.ID `json:"id,omitempty"`
Filename string `json:"filename,omitempty"`
Description *string `json:"description,omitempty"`
ContentType *string `json:"content_type,omitempty"`
Size int `json:"size,omitempty"`
URL string `json:"url,omitempty"`
ProxyURL string `json:"proxy_url,omitempty"`
Height *int `json:"height,omitempty"`
Width *int `json:"width,omitempty"`
Ephemeral bool `json:"ephemeral,omitempty"`
DurationSecs *float64 `json:"duration_secs,omitempty"`
Waveform *string `json:"waveform,omitempty"`
ID snowflake.ID `json:"id,omitempty"`
Filename string `json:"filename,omitempty"`
Description *string `json:"description,omitempty"`
ContentType *string `json:"content_type,omitempty"`
Size int `json:"size,omitempty"`
URL string `json:"url,omitempty"`
ProxyURL string `json:"proxy_url,omitempty"`
Height *int `json:"height,omitempty"`
Width *int `json:"width,omitempty"`
Ephemeral bool `json:"ephemeral,omitempty"`
DurationSecs *float64 `json:"duration_secs,omitempty"`
Waveform *string `json:"waveform,omitempty"`
Flags AttachmentFlags `json:"flags"`
}

func (a Attachment) CreatedAt() time.Time {
return a.ID.Time()
}

type AttachmentFlags int

const (
AttachmentFlagIsClip AttachmentFlags = iota
AttachmentFlagIsThumbnail
AttachmentFlagIsRemix
AttachmentFlagsNone AttachmentFlags = 0
)

type AttachmentUpdate interface {
attachmentUpdate()
}
Expand Down

0 comments on commit 51191a4

Please sign in to comment.