fix: 修正 Unicode 转义序列解析问题,close #63

This commit is contained in:
CaIon
2024-02-02 20:02:40 +08:00
parent a0c4e9f10e
commit 1cde58c089
8 changed files with 21 additions and 13 deletions

View File

@@ -36,6 +36,14 @@ const (
ContentTypeImageURL = "image_url"
)
func (m Message) StringContent() string {
var stringContent string
if err := json.Unmarshal(m.Content, &stringContent); err == nil {
return stringContent
}
return string(m.Content)
}
func (m Message) ParseContent() []MediaMessage {
var contentList []MediaMessage
var stringContent string