Skip to content

Commit

Permalink
Beta130 (#303)
Browse files Browse the repository at this point in the history
* beta122

* beta123

* beta124

* beta124

* beta124

* beta127

* beta128

* beta129

* beta130
  • Loading branch information
Hoshinonyaruko authored Jan 15, 2024
1 parent 5857ab2 commit 5095b95
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions handlers/message_parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ func parseMessageContent(paramsMessage callapi.ParamsContent, message callapi.Ac
segmentContent = "[CQ:at,qq=" + qqNumber + "]"
case "markdown":
mdContent, _ := segmentMap["data"].(map[string]interface{})["data"].(string)
segmentContent = "[CQ:markdown,data=" + mdContent + "]"
encoded := "base64://" + base64.StdEncoding.EncodeToString([]byte(mdContent))
segmentContent = "[CQ:markdown,data=" + encoded + "]"
}

messageText += segmentContent
Expand All @@ -145,7 +146,8 @@ func parseMessageContent(paramsMessage callapi.ParamsContent, message callapi.Ac
messageText = "[CQ:at,qq=" + qqNumber + "]"
case "markdown":
mdContent, _ := message["data"].(map[string]interface{})["data"].(string)
messageText = "[CQ:markdown,data=" + mdContent + "]"
encoded := "base64://" + base64.StdEncoding.EncodeToString([]byte(mdContent))
messageText = "[CQ:markdown,data=" + encoded + "]"
}
default:
mylog.Println("Unsupported message format: params.message field is not a string, map or slice")
Expand Down

0 comments on commit 5095b95

Please sign in to comment.