MiraiForum

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

    大佬们,请问如何上传本地文件夹的图片

    开发交流
    3
    3
    214
    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.
    • PiCpo
      PiCpo last edited by

      这段代码没怎么看懂,不知道sendImage()里面该填哪些参数

      * ### 上传和发送图片
       * - [Contact.uploadImage] 上传 [资源文件][ExternalResource] 并得到 [Image] 消息
       * - [Contact.sendImage] 上传 [资源文件][ExternalResource] 并发送返回的 [Image] 作为一条消息
       *
       * - [ExternalResource.uploadAsImage]
       * - [ExternalResource.sendAsImageTo]
       * - [Contact.sendImage]
      
      1 Reply Last reply Reply Quote 0
      • RainChan
        RainChan 摸鱼 last edited by

        参考ExternalResource内的注释

        1 Reply Last reply Reply Quote 1
        • J
          jiyeme last edited by

          仅供参考,代码并非最佳:
          JAVA参考:https://github.com/jiyeme/mirai-example/blob/master/src/main/java/net/mamoe/exampleJava/eventHandle/common/ImageJava.java
          Kotlin参考:https://github.com/jiyeme/mirai-example/blob/master/src/main/kotlin/net/mamoe/exampleKotlin/eventHandle/common/ImageKotlin.kt

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