New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add method SendTaskCardMessage #59
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also update the README about the addition.
models.go
Outdated
Key string `json:"key"` | ||
Name string `json:"name"` | ||
ReplaceName string `json:"replace_name"` | ||
Color string `json:"color"` | ||
IsBold bool `json:"is_bold"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add field descriptions from official docs.
message.go
Outdated
btnByte, err := json.Marshal(btn) | ||
if err != nil { | ||
return errors.New("btn convert to json fail: " + err.Error()) | ||
} | ||
var btnSlice []map[string]interface{} | ||
err = json.Unmarshal(btnByte, &btnSlice) | ||
if err != nil { | ||
return errors.New("btn convert to []map fail: " + err.Error()) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't be necessary, a []TaskCardBtn
is an interface{}
after all, there's no custom marshaling logic at play.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是的,我已经删除了这部分代码
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assuming you tested the code yourself, it should be ready to go. I'd like to rename some fields and make the "button color" string an enum instead, but that can come later.
Thanks for your contribution!
bors r+
Build succeeded:
|
添加了发送任务卡片类型的消息