MCPcopy Create free account
hub / github.com/chanify/chanify / ActionContent

Method ActionContent

model/message.go:112–125  ·  view source on GitHub ↗

ActionContent set custom action notification

(text string, title string, actions []string)

Source from the content-addressed store, hash-verified

110
111// ActionContent set custom action notification
112func (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
128func (m *Message) FileContent(path string, filename string, desc string, size int, actions []string) *Message {

Callers 2

TestActionContentFunction · 0.95
makeActionContentMethod · 0.80

Calls 2

parseActionsFunction · 0.85
MarshalMethod · 0.80

Tested by 1

TestActionContentFunction · 0.76