File tree Expand file tree Collapse file tree 3 files changed +25
-0
lines changed
Expand file tree Collapse file tree 3 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,9 @@ package wechatypuppet
33import (
44 "errors"
55 "fmt"
6+
67 lru "github.com/hashicorp/golang-lru"
8+
79 "github.com/wechaty/go-wechaty/wechaty-puppet/events"
810 "github.com/wechaty/go-wechaty/wechaty-puppet/filebox"
911 "github.com/wechaty/go-wechaty/wechaty-puppet/helper"
Original file line number Diff line number Diff line change @@ -93,6 +93,19 @@ type MessagePayloadBase struct {
9393
9494 // 小程序有些消息类型,wechaty服务端解析不处理,框架端解析。 xml type 36 是小程序
9595 FixMiniApp bool
96+
97+ ReferMessage * ReferMessagePayload
98+ }
99+
100+ // ReferMessagePayload refer message payload
101+ type ReferMessagePayload struct {
102+ Type MessageType // TODO: 确认是否和 MessageType 一致
103+ SourceMsgID string
104+ TalkerId string
105+ RoomId string
106+ DisplayName string
107+ Content string
108+ Timestamp time.Time
96109}
97110
98111type MessagePayloadRoom struct {
Original file line number Diff line number Diff line change @@ -147,6 +147,16 @@ func (m *Message) Date() time.Time {
147147 return m .payload .Timestamp
148148}
149149
150+ // ReferMessage get the refer message
151+ func (m * Message ) ReferMessage () * schemas.ReferMessagePayload {
152+ if m .payload .ReferMessage == nil {
153+ return nil
154+ }
155+
156+ copy := * m .payload .ReferMessage
157+ return & copy
158+ }
159+
150160// Say reply a Text or Media File message to the sender.
151161// Support msg:
152162// string
You can’t perform that action at this time.
0 commit comments