0

我想弄清楚,我如何下载和上传带有独木舟库的 java.io.File。

https://github.com/augustjune/canoe

非常差的文档和一些例子。如果有人知道如何做到这一点,请帮助。

4

1 回答 1

0

好像找到了解决办法

def filePrepareResponse[F[_]: TelegramClient](semaphore: Semaphore[F]): Scenario[F, Unit] = {
   val in: InputFile.Upload = InputFile.fromBytes("file.pdf", Files.readAllBytes(new File("/home/dmitry/Downloads/Обращение.PDF").toPath))
   for {
     chat <- Scenario.expect(command("download").chat)
     _    <- Scenario.eval(chat.send(DocumentContent(in)))
   } yield ()}

为我工作

于 2021-04-23T11:29:14.960 回答