1
0
mirror of https://github.com/Mrs4s/go-cqhttp.git synced 2025-05-08 13:06:04 +08:00

fix: 解决原本的 isAnonymous 判断错误

This commit is contained in:
nnnewb 2021-02-13 18:24:20 +08:00
parent fba4819adc
commit 3bfdc4d8a2

View File

@ -805,7 +805,7 @@ func (bot *CQBot) CQGetStrangerInfo(userID int64) MSG {
func (bot *CQBot) CQHandleQuickOperation(context, operation gjson.Result) MSG { func (bot *CQBot) CQHandleQuickOperation(context, operation gjson.Result) MSG {
postType := context.Get("post_type").Str postType := context.Get("post_type").Str
anonymous := context.Get("anonymous") anonymous := context.Get("anonymous")
isAnonymous := anonymous.Type == gjson.Null isAnonymous := anonymous.Type != gjson.Null
switch postType { switch postType {
case "message": case "message":
@ -830,8 +830,9 @@ func (bot *CQBot) CQHandleQuickOperation(context, operation gjson.Result) MSG {
}, },
}) })
err := json.UnmarshalFromString(reply.Raw, replySegments) err := json.UnmarshalFromString(reply.Raw, &replySegments)
if err != nil { if err != nil {
log.WithError(err).Warnf("处理 at_sender 过程中发生错误")
return Failed(-1, "处理 at_sender 过程中发生错误", err.Error()) return Failed(-1, "处理 at_sender 过程中发生错误", err.Error())
} }
@ -839,6 +840,7 @@ func (bot *CQBot) CQHandleQuickOperation(context, operation gjson.Result) MSG {
modified, err := json.MarshalToString(segments) modified, err := json.MarshalToString(segments)
if err != nil { if err != nil {
log.WithError(err).Warnf("处理 at_sender 过程中发生错误")
return Failed(-1, "处理 at_sender 过程中发生错误", err.Error()) return Failed(-1, "处理 at_sender 过程中发生错误", err.Error())
} }