MiraiForum

    • Register
    • Login
    • Search
    • Popular
    • Recent
    • Unsolved
    • Tags
    • Groups
    • 友情链接

    求助 获取好友漫游消息时收到了400状态码+无效参数的回复

    HTTP API和第三方SDK
    2
    7
    410
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Vkriee
      Vkriee last edited by

      我的mirai http插件版本是mirai-api-http-2.10.0.mirai2.jar
      我用python的websockets库连接mirai http的ws适配器
      我发送的json消息是:
      {"syncId": 0, "command": "roamingMessages", "subCommand": null, "content": {"timeStart": 1744524555, "timeEnd": 1744524565, "target": 2956718371}}
      收到了:{'code': 400, 'msg': '无效参数'}
      timeStart是好友撤回的消息的发送时间(我要获取好友撤回的消息之后的所有消息),timeEnd是我发起请求前用round(time.time())获取的,target确实是好友,api文档里也写了这三个参数都要以数字形式发送,为什么说我参数无效呢?

      1 Reply Last reply Reply Quote 0
      • Mr.喜
        Mr.喜 ⭐2021⭐ last edited by

        sessionKey参数呢

        Vkriee 1 Reply Last reply Reply Quote 0
        • Vkriee
          Vkriee @Mr.喜 last edited by

          @Mr-喜 ws适配器不是连接之后就会绑定sessionKey吗,后续不需要发送sessionKey,而且我调用发送消息的api时也没传sessionKey

          1 Reply Last reply Reply Quote 0
          • Vkriee
            Vkriee last edited by

            @Mr-喜 {"syncId": 0, "command": "roamingMessages", "subCommand": null, "content": {"timeStart": 1744549937, "timeEnd": 9223372036854775807, "target": 2956718371}, "sessionKey": "ASFbv0cn"}
            {"syncId": 0, "command": "roamingMessages", "subCommand": null, "content": {"timeStart": 1744549862, "timeEnd": 9223372036854775807, "target": 2956718371, "sessionKey": "m33RQqVj"}}
            试了加上sessionKey也还是响应码400+无效参数

            Mr.喜 1 Reply Last reply Reply Quote 0
            • Mr.喜
              Mr.喜 ⭐2021⭐ @Vkriee last edited by

              @Vkriee 抱歉,我看不出问题了

              1 Reply Last reply Reply Quote 0
              • Mr.喜
                Mr.喜 ⭐2021⭐ last edited by

                我在issue里找到了这条 https://github.com/project-mirai/mirai-api-http/issues/765

                landall created this issue in project-mirai/mirai-api-http

                open 获取漫游消息API 文档bug #765

                Vkriee 1 Reply Last reply Reply Quote 0
                • Vkriee
                  Vkriee @Mr.喜 last edited by

                  @Mr-喜 谢谢,确实是这个问题

                  1 Reply Last reply Reply Quote 0
                  • 1 / 1
                  • First post
                    Last post
                  Powered by Mamoe Technologies & NodeBB | 友情链接 | 服务监控 | Contact