Skip to content

Commit

Permalink
add: MessageContentCardTemplate
Browse files Browse the repository at this point in the history
  • Loading branch information
chyroc committed Dec 18, 2023
1 parent 8abd67e commit f17e617
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
11 changes: 11 additions & 0 deletions card/template.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package card

import "github.com/chyroc/lark"

// Template ...
func Template(id string, variable map[string]interface{}) *lark.MessageContentCardTemplate {
return &lark.MessageContentCardTemplate{
TemplateID: id,
TemplateVariable: variable,
}
}
16 changes: 16 additions & 0 deletions type_message_card.go
Original file line number Diff line number Diff line change
Expand Up @@ -1146,3 +1146,19 @@ type I18NText struct {
EnUs string `json:"en_us"`
JaJp string `json:"ja_jp"`
}

// MessageContentCardTemplate ...
//
// docs: https://open.feishu.cn/document/ukTMukTMukTM/uYzM3QjL2MzN04iNzcDN/send-message-card/send-message-using-card-id
type MessageContentCardTemplate struct {
TemplateID string `json:"template_id"`
TemplateVariable map[string]interface{} `json:"template_variable"`
}

// String ...
func (r MessageContentCardTemplate) String() string {
return jsonString(map[string]interface{}{
"type": "template",
"data": r,
})
}

0 comments on commit f17e617

Please sign in to comment.