简体   繁体   English

错误:400:错误请求:请求中没有照片

[英]Error: 400: Bad Request: there is no photo in the request

I use telegraf and when send photo by url become such problem but when I use local photo(../img.jpg) it is okey.我使用电报,当通过 url 发送照片时会出现这样的问题,但是当我使用本地照片(../img.jpg)时它是好的。 Code:代码:

 bot.hears(/\/pic/, ctx=> { let photo = 'https://img-9gag-fun.9cache.com/photo/azmpDRN_460s.jpg'; bot.telegram.sendPhoto(chatId, {source: photo}, {caption: "Hello"}); });

I need to change 'source' to 'url':我需要将“来源”更改为“网址”:

 bot.hears(/\/pic/, ctx=> { let photo = 'https://img-9gag-fun.9cache.com/photo/azmpDRN_460s.jpg'; bot.telegram.sendPhoto(chatId, {url: photo}, {caption: "Hello"}); });

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM