TextContent set text notification
(text string, title string, copytext string, autocopy string)
| 91 | |
| 92 | // TextContent set text notification |
| 93 | func (m *Message) TextContent(text string, title string, copytext string, autocopy string) *Message { |
| 94 | ctx := &pb.MsgContent{ |
| 95 | Type: pb.MsgType_Text, |
| 96 | Text: text, |
| 97 | } |
| 98 | if len(title) > 0 { |
| 99 | ctx.Title = title |
| 100 | } |
| 101 | if len(copytext) > 0 { |
| 102 | ctx.Copytext = copytext |
| 103 | } |
| 104 | if len(autocopy) > 0 { |
| 105 | ctx.Flags = 1 |
| 106 | } |
| 107 | m.Content, _ = proto.Marshal(ctx) |
| 108 | return m |
| 109 | } |
| 110 | |
| 111 | // ActionContent set custom action notification |
| 112 | func (m *Message) ActionContent(text string, title string, actions []string) *Message { |