diff --git a/handlers/send_group_msg.go b/handlers/send_group_msg.go index ac5508c9..696ff3a6 100644 --- a/handlers/send_group_msg.go +++ b/handlers/send_group_msg.go @@ -102,7 +102,7 @@ func HandleSendGroupMsg(client callapi.Client, api openapi.OpenAPI, apiv2 openap idInt64, err = idmap.GenerateRowID(message.Params.GroupID.(string), 9) // 临时的 msgType = "group" - } else if len(message.Params.UserID.(string)) == 32 { + } else if message.Params.UserID != nil && len(message.Params.UserID.(string)) == 32 { idInt64, err = idmap.GenerateRowID(message.Params.UserID.(string), 9) // 临时的 msgType = "group_private" diff --git a/handlers/send_group_msg_raw.go b/handlers/send_group_msg_raw.go index 5f91a6f7..601e0038 100644 --- a/handlers/send_group_msg_raw.go +++ b/handlers/send_group_msg_raw.go @@ -87,7 +87,7 @@ func HandleSendGroupMsgRaw(client callapi.Client, api openapi.OpenAPI, apiv2 ope idInt64, err = idmap.GenerateRowID(message.Params.GroupID.(string), 9) // 临时的 msgType = "group" - } else if len(message.Params.UserID.(string)) == 32 { + } else if message.Params.UserID != nil && len(message.Params.UserID.(string)) == 32 { idInt64, err = idmap.GenerateRowID(message.Params.UserID.(string), 9) // 临时的 msgType = "group_private" diff --git a/handlers/send_private_msg.go b/handlers/send_private_msg.go index b33a9005..fb929d93 100644 --- a/handlers/send_private_msg.go +++ b/handlers/send_private_msg.go @@ -81,7 +81,7 @@ func HandleSendPrivateMsg(client callapi.Client, api openapi.OpenAPI, apiv2 open var idInt64 int64 var err error - if len(message.Params.UserID.(string)) == 32 { + if message.Params.UserID != nil && len(message.Params.UserID.(string)) == 32 { idInt64, err = idmap.GenerateRowID(message.Params.UserID.(string), 9) // 临时的 msgType = "group_private"