微信恢复优化
This commit is contained in:
parent
e95e248842
commit
c11cc18ab5
@ -56,6 +56,18 @@ func (gmh *GroupMessageHandler) ReplyText(msg *openwechat.Message) error {
|
|||||||
log.Println(text)
|
log.Println(text)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
// 如果在提问的时候没有包含?,AI会自动在开头补充个?看起来很奇怪
|
||||||
|
result := *reply
|
||||||
|
if strings.HasPrefix(result, "?") {
|
||||||
|
result = strings.Replace(result, "?", "", -1)
|
||||||
|
}
|
||||||
|
if strings.HasPrefix(result, "?") {
|
||||||
|
result = strings.Replace(result, "?", "", -1)
|
||||||
|
}
|
||||||
|
// 微信不支持markdown格式,所以把反引号直接去掉
|
||||||
|
if strings.HasPrefix(result, "`") {
|
||||||
|
result = strings.Replace(result, "`", "", -1)
|
||||||
|
}
|
||||||
|
|
||||||
if reply != nil {
|
if reply != nil {
|
||||||
_, err = msg.ReplyText(*reply)
|
_, err = msg.ReplyText(*reply)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user