GithubHelp home page GithubHelp logo

Comments (2)

KomeiDiSanXian avatar KomeiDiSanXian commented on August 29, 2024

定位到问题在zerobot/api.go中, L549

// GettLatestGroupMessageHistory 获取最新群消息历史记录
func (ctx *Ctx) GetLatestGroupMessageHistory(groupID int64) gjson.Result {
	return ctx.CallAction("get_group_msg_history", Params{
		"group_id": groupID,
	}).Data
}

拉格兰文档中写明该api需要以下参数

字段 类型 说明
group_id uint 群组 ID
message_id int 要获取的消息的最后一条的 ID
count int 获取的消息数量

测试时发送示例如下

正向ws

{
    "action": "get_group_msg_history",
    "params": {
        "group_id": 820309545,
        "count": 100,
        "message_id": 562894955
    }
}

拉格兰返回如下

trce: Lagrange.Core.BotContext[0]
      [2024-05-16 22:44:56] [ServiceContext] [DEBUG]: Outgoing SSOFrame: OidbSvcTrpcTcp.0xfe7_3
trce: Lagrange.Core.BotContext[0]
      [2024-05-16 22:44:56] [ServiceContext] [DEBUG]: Incoming SSOFrame: OidbSvcTrpcTcp.0xfe7_3
warn: Lagrange.OneBot.Core.Operation.OperationService[0]
      Unexpected error encountered while handling message.
      System.Exception: Group member not found
         at Lagrange.OneBot.Message.MessageService.ConvertToGroupMsg(UInt32 uin, MessageChain chain)
         at Lagrange.OneBot.Core.Operation.Message.GetGroupMessageHistoryOperation.<>c__DisplayClass3_0.<HandleOperation>b__2(MessageChain x)
         at System.Linq.Enumerable.SelectListIterator`2.Fill(ReadOnlySpan`1 source, Span`1 destination, Func`2 func)
         at System.Linq.Enumerable.SelectListIterator`2.ToList()
         at Lagrange.OneBot.Core.Operation.Message.GetGroupMessageHistoryOperation.HandleOperation(BotContext context, JsonNode payload)
         at Lagrange.OneBot.Core.Operation.OperationService.HandleOperation(MsgRecvEventArgs e)
trce: Lagrange.OneBot.Core.Network.Service.ForwardWSService[13]
      Send(5d880f9f-d52a-44ce-8bd7-32a1c28887a6) {"status":"failed","retcode":200,"data":null,"echo":null}

似乎此api仍有bug? 等待进一步测试

from remiliabot.

KomeiDiSanXian avatar KomeiDiSanXian commented on August 29, 2024

定位到问题在zerobot/api.go中, L549

// GettLatestGroupMessageHistory 获取最新群消息历史记录
func (ctx *Ctx) GetLatestGroupMessageHistory(groupID int64) gjson.Result {
	return ctx.CallAction("get_group_msg_history", Params{
		"group_id": groupID,
	}).Data
}

拉格兰文档中写明该api需要以下参数
字段 类型 说明
group_id uint 群组 ID
message_id int 要获取的消息的最后一条的 ID
count int 获取的消息数量

测试时发送示例如下

正向ws

{
    "action": "get_group_msg_history",
    "params": {
        "group_id": 820309545,
        "count": 100,
        "message_id": 562894955
    }
}

拉格兰返回如下

trce: Lagrange.Core.BotContext[0]
      [2024-05-16 22:44:56] [ServiceContext] [DEBUG]: Outgoing SSOFrame: OidbSvcTrpcTcp.0xfe7_3
trce: Lagrange.Core.BotContext[0]
      [2024-05-16 22:44:56] [ServiceContext] [DEBUG]: Incoming SSOFrame: OidbSvcTrpcTcp.0xfe7_3
warn: Lagrange.OneBot.Core.Operation.OperationService[0]
      Unexpected error encountered while handling message.
      System.Exception: Group member not found
         at Lagrange.OneBot.Message.MessageService.ConvertToGroupMsg(UInt32 uin, MessageChain chain)
         at Lagrange.OneBot.Core.Operation.Message.GetGroupMessageHistoryOperation.<>c__DisplayClass3_0.<HandleOperation>b__2(MessageChain x)
         at System.Linq.Enumerable.SelectListIterator`2.Fill(ReadOnlySpan`1 source, Span`1 destination, Func`2 func)
         at System.Linq.Enumerable.SelectListIterator`2.ToList()
         at Lagrange.OneBot.Core.Operation.Message.GetGroupMessageHistoryOperation.HandleOperation(BotContext context, JsonNode payload)
         at Lagrange.OneBot.Core.Operation.OperationService.HandleOperation(MsgRecvEventArgs e)
trce: Lagrange.OneBot.Core.Network.Service.ForwardWSService[13]
      Send(5d880f9f-d52a-44ce-8bd7-32a1c28887a6) {"status":"failed","retcode":200,"data":null,"echo":null}

似乎此api仍有bug? 等待进一步测试

更改参数 count 为 10 以后能正常获取,15 也能正常获取. 出现这一问题可能是读取到的消息没100导致的?
进一步的测试表明,获取消息最大数量为 30.

需要等待拉格兰那边回复

from remiliabot.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.