通过电报机器人发送带有描述的文档
sending a document with description by telegram bot
我正在尝试使用 Telegram 机器人用户从我的服务器向 Telegram 组发送一个 pdf 文档和关于它的简短描述。我可以使用 /sendDocument 方法自行发送文档。然而,这并不是我想要的。我想知道这甚至可能吗?
curl -F chat_id="-xxxxxxxxxx" -F document=@"/home/telegram/someFile.pdf" -F text="Text Message with attachment" https://api.telegram.org/bot<token>/sendMessage
sendDocument 方法有一个键 caption
。你需要把描述放在那里。
curl -F chat_id="-xxxxxxxxxx" -F document=@"/home/telegram/someFile.pdf" -F caption="Text Message with attachment" https://api.telegram.org/bot<token>/sendDocument
我正在尝试使用 Telegram 机器人用户从我的服务器向 Telegram 组发送一个 pdf 文档和关于它的简短描述。我可以使用 /sendDocument 方法自行发送文档。然而,这并不是我想要的。我想知道这甚至可能吗?
curl -F chat_id="-xxxxxxxxxx" -F document=@"/home/telegram/someFile.pdf" -F text="Text Message with attachment" https://api.telegram.org/bot<token>/sendMessage
sendDocument 方法有一个键 caption
。你需要把描述放在那里。
curl -F chat_id="-xxxxxxxxxx" -F document=@"/home/telegram/someFile.pdf" -F caption="Text Message with attachment" https://api.telegram.org/bot<token>/sendDocument