电报Bot API文件下载路径返回404 [英] Telegram Bot API File Download Path Returns 404

查看:84
本文介绍了电报Bot API文件下载路径返回404的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在从事Telegram Bot项目,该项目要求我将用户发送的图像下载到机器人.

I am currently working on a Telegram Bot project which requires me to download Images send by users to the bot.

我遵循了API文档,该文档说使用getFile调用来访问file_path.然后,应使用路径( https://api.telegram.org/file/bot /)

I followed the API documentation which says to use the getFile call to access the file_path. The file should then be found using the path (https://api.telegram.org/file/bot/)

一切正常,直到我尝试使用上述地址访问文件为止.它始终返回404.但是,不是包含404消息的json,而是浏览器中的黑屏和页面响应中的404.

Everything works until I try to access the file using the address above. It always returns 404. However not a json containing the 404 message, but a black screen in the browser and 404 in the page response.

也许我缺少一些东西.

非常感谢您的帮助!

推荐答案

我遇到了同样的问题,这是我的错误:我正在使用 https://api.telegram.org/bot<token>/< file_path> 而不是 https://api.telegram.org/file/bot<token>/<file_path>

I had the same issue and this was my error: i was using https://api.telegram.org/bot<token>/<file_path> instead of https://api.telegram.org/file/bot<token>/<file_path>

这篇关于电报Bot API文件下载路径返回404的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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