gpt4 book ai didi

telegram-bot - 如何通过 Telegram Bot 发送文件

转载 作者:行者123 更新时间:2023-12-01 13:15:34 25 4
gpt4 key购买 nike

我需要使用 TelegramBot API 发送 txt 文件。

我已经试过了 https://api.telegram.org/botMYT0KEN/sendDocument?chat_id=569502265&document=/Users/users/Desktop/file.txt

并有问题:

{"ok":false,"error_code":400,"description":"Bad Request: wrong remote file id specified: Wrong string length”}

最佳答案

为了完成唐尼的回答,我想添加一个发送 .txt 的例子。文件作为文件。

看起来您正在使用 OS X 作为操作系统,它具有 curl实用程序预装。

打开终端并发出如下请求:

curl -v -F "chat_id=569502265" -F document=@/Users/users/Desktop/file.txt https://api.telegram.org/bot<TOKEN>/sendDocument

关于telegram-bot - 如何通过 Telegram Bot 发送文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55470047/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com