Skip to content

Commit

Permalink
add feature
Browse files Browse the repository at this point in the history
  • Loading branch information
Hoshinonyaruko committed Nov 10, 2023
1 parent eb53e55 commit c11be54
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion handlers/send_group_msg.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func handleSendGroupMsg(client callapi.Client, api openapi.OpenAPI, apiv2 openap
// 使用RetrieveRowByIDv2还原真实的ChannelID
RChannelID, err := idmap.RetrieveRowByIDv2(message.Params.ChannelID)
if err != nil {
mylog.Printf("error retrieving real UserID: %v", err)
mylog.Printf("error retrieving real RChannelID: %v", err)
}
message.Params.ChannelID = RChannelID
//这一句是group_private的逻辑,发频道信息用的是channelid
Expand Down
10 changes: 5 additions & 5 deletions handlers/send_guild_channel_msg.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@ func handleSendGuildChannelMsg(client callapi.Client, api openapi.OpenAPI, apiv2
msgType = echo.GetMsgTypeByKey(echoStr)
}

//如果获取不到 就用user_id获取信息类型
if msgType == "" {
msgType = GetMessageTypeByUserid(config.GetAppIDStr(), message.Params.UserID)
}

//如果获取不到 就用group_id获取信息类型
if msgType == "" {
appID := config.GetAppIDStr()
Expand All @@ -44,6 +39,11 @@ func handleSendGuildChannelMsg(client callapi.Client, api openapi.OpenAPI, apiv2
mylog.Printf("msgType: %s\n", msgType)
}

//如果获取不到 就用user_id获取信息类型
if msgType == "" {
msgType = GetMessageTypeByUserid(config.GetAppIDStr(), message.Params.UserID)
}

switch msgType {
//原生guild信息
case "guild":
Expand Down
2 changes: 1 addition & 1 deletion handlers/send_msg.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func handleSendMsg(client callapi.Client, api openapi.OpenAPI, apiv2 openapi.Ope
// 使用RetrieveRowByIDv2还原真实的ChannelID
RChannelID, err := idmap.RetrieveRowByIDv2(message.Params.ChannelID)
if err != nil {
mylog.Printf("error retrieving real UserID: %v", err)
mylog.Printf("error retrieving real RChannelID: %v", err)
}
message.Params.ChannelID = RChannelID
handleSendGuildChannelMsg(client, api, apiv2, message)
Expand Down

0 comments on commit c11be54

Please sign in to comment.