ActionContent set custom action notification
(text string, title string, actions []string)
| 110 | |
| 111 | // ActionContent set custom action notification |
| 112 | func (m *Message) ActionContent(text string, title string, actions []string) *Message { |
| 113 | ctx := &pb.MsgContent{ |
| 114 | Type: pb.MsgType_Action, |
| 115 | Actions: parseActions(actions), |
| 116 | } |
| 117 | if len(title) > 0 { |
| 118 | ctx.Title = title |
| 119 | } |
| 120 | if len(text) > 0 { |
| 121 | ctx.Text = text |
| 122 | } |
| 123 | m.Content, _ = proto.Marshal(ctx) |
| 124 | return m |
| 125 | } |
| 126 | |
| 127 | // FileContent set file notification |
| 128 | func (m *Message) FileContent(path string, filename string, desc string, size int, actions []string) *Message { |