Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Beta128 #298

Merged
merged 7 commits into from
Jan 12, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
beta124
Hoshinonyaruko committed Jan 11, 2024
commit ea41561628f1d01fd60b334592e65bb3cef4c156
5 changes: 4 additions & 1 deletion handlers/send_msg.go
Original file line number Diff line number Diff line change
@@ -42,13 +42,15 @@ func HandleSendMsg(client callapi.Client, api openapi.OpenAPI, apiv2 openapi.Ope
msgType = GetMessageTypeByUseridV2(message.Params.UserID)
}

var idInt64 int64
var idInt64, idInt642 int64
var err error

if message.Params.GroupID != "" {
idInt64, err = ConvertToInt64(message.Params.GroupID)
idInt642, err = ConvertToInt64(message.Params.UserID)
} else if message.Params.UserID != "" {
idInt64, err = ConvertToInt64(message.Params.UserID)
idInt642, err = ConvertToInt64(message.Params.GroupID)
}

//设置递归 对直接向gsk发送action时有效果
@@ -101,6 +103,7 @@ func HandleSendMsg(client callapi.Client, api openapi.OpenAPI, apiv2 openapi.Ope
//重置递归类型
if echo.GetMapping(idInt64) <= 0 {
echo.AddMsgType(config.GetAppIDStr(), idInt64, "")
echo.AddMsgType(config.GetAppIDStr(), idInt642, "")
}
echo.AddMapping(idInt64, echo.GetMapping(idInt64)-1)

12 changes: 6 additions & 6 deletions handlers/send_private_msg.go
Original file line number Diff line number Diff line change
@@ -29,14 +29,14 @@ func HandleSendPrivateMsg(client callapi.Client, api openapi.OpenAPI, apiv2 open
msgType = echo.GetMsgTypeByKey(echoStr)
}

//如果获取不到 就用group_id获取信息类型
if msgType == "" {
msgType = GetMessageTypeByGroupid(config.GetAppIDStr(), message.Params.GroupID)
}
//如果获取不到 就用user_id获取信息类型
if msgType == "" {
msgType = GetMessageTypeByUserid(config.GetAppIDStr(), message.Params.UserID)
}
//顺序,私聊优先从UserID推断类型会更准确
if msgType == "" {
msgType = GetMessageTypeByGroupid(config.GetAppIDStr(), message.Params.GroupID)
}
//新增 内存获取不到从数据库获取
if msgType == "" {
msgType = GetMessageTypeByUseridV2(message.Params.UserID)
@@ -68,7 +68,7 @@ func HandleSendPrivateMsg(client callapi.Client, api openapi.OpenAPI, apiv2 open
}

switch msgType {
case "group_private","group":
case "group_private", "group":
//私聊信息
var UserID string
if config.GetIdmapPro() {
@@ -266,7 +266,7 @@ func HandleSendPrivateMsg(client callapi.Client, api openapi.OpenAPI, apiv2 open
retmsg, _ = SendResponse(client, err, &message)
}
}
case "guild_private","guild":
case "guild_private", "guild":
//当收到发私信调用 并且来源是频道
retmsg, _ = HandleSendGuildChannelPrivateMsg(client, api, apiv2, message, nil, nil)
default: