/
message_part.go
68 lines (55 loc) · 1.21 KB
/
message_part.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
package event
import (
"encoding/json"
)
type MessagePartType string
const (
PartTypeSticker MessagePartType = "sticker"
PartTypeMention MessagePartType = "mention"
PartTypeVoice MessagePartType = "voice"
PartTypeFile MessagePartType = "file"
PartTypeForward MessagePartType = "forward"
PartTypeReply MessagePartType = "reply"
)
//easyjson:json
type MessagePart struct {
Type MessagePartType `json:"type"`
Payload json.RawMessage `json:"payload"`
}
//easyjson:json
type MessagePartSticker struct {
FileID string `json:"fileId"`
}
//easyjson:json
type MessagePartMention struct {
User
}
//easyjson:json
type MessagePartVoice struct {
FileID string `json:"fileId"`
}
type FileType string
const (
FileTypeImage FileType = "image"
FileTypeAudio FileType = "audio"
FileTypeVideo FileType = "video"
)
//easyjson:json
type MessagePartMessage struct {
From User `json:"from"`
MessageID string `json:"msgId"`
Text string `json:"text"`
Timestamp uint64 `json:"timestamp"`
}
//easyjson:json
type MessagePartFile struct {
File
}
//easyjson:json
type MessagePartForward struct {
Message Message `json:"message"`
}
//easyjson:json
type MessagePartReply struct {
Message Message `json:"message"`
}