diff --git a/handlers/send_group_msg.go b/handlers/send_group_msg.go index 3160096b..876067df 100644 --- a/handlers/send_group_msg.go +++ b/handlers/send_group_msg.go @@ -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 diff --git a/handlers/send_guild_channel_msg.go b/handlers/send_guild_channel_msg.go index 6e2484d8..07614532 100644 --- a/handlers/send_guild_channel_msg.go +++ b/handlers/send_guild_channel_msg.go @@ -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() @@ -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": diff --git a/handlers/send_msg.go b/handlers/send_msg.go index fa43c488..df6d4477 100644 --- a/handlers/send_msg.go +++ b/handlers/send_msg.go @@ -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)