MiraiForum

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

    ForwardMessageBuilder如何判断是否超出大小限制

    开发交流
    2
    3
    372
    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.
    • 4o4E
      4o4E last edited by

      构建并发送转发消息的时候经常会报错显示过大
      *** is too large. Allow up to 50 images or 5000 chars
      我如何判断构建的消息是否超过大小,有没有自带的方法判断
      另外如果我统计添加的消息时,需要统计的字符数量是否需要包含发送者的信息

      1 Reply Last reply Reply Quote 0
      • Nambers
        Nambers 摸鱼 last edited by

        应该是这里 https://github.com/mamoe/mirai/blob/2730c80d2db2390e15b8b4b72549c4325accae3f/mirai-core/src/commonMain/kotlin/contact/util.kt#L46
        你对着代码抄过去在发送前检查应该就好了

        4o4E 1 Reply Last reply Reply Quote 0
        • 4o4E
          4o4E @Nambers last edited by

          @nambers 感谢

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