-
Notifications
You must be signed in to change notification settings - Fork 35
/
attachment.go
42 lines (33 loc) · 1.05 KB
/
attachment.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package discord
import (
"time"
"github.com/disgoorg/snowflake/v2"
)
//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"`
}
func (a Attachment) CreatedAt() time.Time {
return a.ID.Time()
}
type AttachmentUpdate interface {
attachmentUpdate()
}
type AttachmentKeep struct {
ID snowflake.ID `json:"id,omitempty"`
}
func (AttachmentKeep) attachmentUpdate() {}
type AttachmentCreate struct {
ID int `json:"id"`
Description string `json:"description"`
}
func (AttachmentCreate) attachmentUpdate() {}