如何使用Telegram bot API发送文本图像?
我正在尝试使用Telegram API机器人发送消息。
我想提出一个get请求,这同时将文本和图像发送到我的电报频道。
现在取出看起来像这样:
telegram_msg = requests.get('https://api.telegram.org/<botname>:botAPI/sendMessage?chat_id=<chat_id>=some text')
我如何包括一个位于并在一条消息中同时发送文本和图像?
感谢您的帮助。
UPD:我可以使用SendPhoto发送图像,但是如何将这两个请求组合到一个请求中?这样我可以发送图像和文字?
I'm trying to send a message to telegram using Telegram API bot.
I want to make a GET request, that will send both text and image to my telegram channel.
Now fetch looks like that:
telegram_msg = requests.get('https://api.telegram.org/<botname>:botAPI/sendMessage?chat_id=<chat_id>=some text')
How can I include an image that is located here and send both text and image in one message?
Thank you for your help.
UPD: I can send image using sendPhoto, but how can I combine these two requests into one? So that I can send both image and text?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用@botfather 获得您的api token
After using @BotFather to get your API token
Post result with text and image in Telegram
在
use caption parameter in sendPhoto method