电报机器人如何获取上传文件的file_id? [英] How telegram bot can get file_id of uploaded file?

查看:33
本文介绍了电报机器人如何获取上传文件的file_id?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在电报 API 文档中,我看到:您可以将 file_id 作为字符串传递以重新发送已经在电报服务器上的照片",但我找不到获取 file_id 的方法上传的文件.我怎样才能得到它?

In telegram API documentation I see: "You can either pass a file_id as String to resend a photo that is already on the Telegram servers", but I can't find ways to get file_id of uploaded file. How can I get it?

推荐答案

这取决于你的 content_types ,例如:

Its depended to your content_types ,for example:

视频:

message.video.file_id

音频:

message.audio.file_id

照片:

message.photo[2].file_id

有关更多信息,请参阅链接.

For more see this link.

这篇关于电报机器人如何获取上传文件的file_id?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆