forked from go-lark/lark
-
Notifications
You must be signed in to change notification settings - Fork 0
/
event_message_received.go
33 lines (31 loc) · 1.19 KB
/
event_message_received.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
package lark
// EventV2MessageReceived .
type EventV2MessageReceived struct {
Sender struct {
SenderID EventV2UserID `json:"sender_id,omitempty"`
SenderType string `json:"sender_type,omitempty"`
TenantKey string `json:"tenant_key,omitempty"`
} `json:"sender,omitempty"`
Message struct {
MessageID string `json:"message_id,omitempty"`
RootID string `json:"root_id,omitempty"`
ParentID string `json:"parent_id,omitempty"`
CreateTime string `json:"create_time,omitempty"`
ChatID string `json:"chat_id,omitempty"`
ChatType string `json:"chat_type,omitempty"`
MessageType string `json:"message_type,omitempty"`
Content string `json:"content,omitempty"`
Mentions []struct {
Key string `json:"key,omitempty"`
ID EventV2UserID `json:"id,omitempty"`
Name string `json:"name,omitempty"`
TenantKey string `json:"tenant_key,omitempty"`
} `json:"mentions,omitempty"`
} `json:"message,omitempty"`
}
// GetMessageReceived .
func (e EventV2) GetMessageReceived() (*EventV2MessageReceived, error) {
var body EventV2MessageReceived
err := e.GetEvent(EventTypeMessageReceived, &body)
return &body, err
}