mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-01-26 12:48:41 +08:00
25 lines
427 B
Go
25 lines
427 B
Go
|
package feishu
|
||
|
|
||
|
type TextMessage struct {
|
||
|
MsgType MsgType `json:"msg_type"`
|
||
|
Content Content `json:"content"`
|
||
|
}
|
||
|
|
||
|
type Content struct {
|
||
|
Text string `json:"text"`
|
||
|
}
|
||
|
|
||
|
func (m *TextMessage) Body() map[string]interface{} {
|
||
|
m.MsgType = MsgTypeText
|
||
|
return structToMap(m)
|
||
|
}
|
||
|
|
||
|
func NewTextMessage() *TextMessage {
|
||
|
return &TextMessage{}
|
||
|
}
|
||
|
|
||
|
func (m *TextMessage) SetText(text string) *TextMessage {
|
||
|
m.Content.Text = text
|
||
|
return m
|
||
|
}
|