Answer the question
In order to leave comments, you need to log in
How to make a telegram bot that sends a picture by url?
I'm using telegraf and when I send a photo to a url it becomes a problem because I get this error: Error: 400: Bad Request: there is no photo in the request, but when I use a local photo (../ img.jpg ), this is normal. And yes, at first I did not connect telegraf and used the standard telegram api and therefore used the following command: bot.sendPhoto (chatId, url_photo, {caption: 'Picture'}), where I can call the image by URL and there was no error, but now I take telegraf, as it is easier to use, but sending by url does not work. The code:
let photo = 'https://img-9gag-fun.9cache.com/photo/azmpDRN_460s.jpg';
bot.telegram.sendPhoto(chatId,
{source: photo},
{caption: "Hello"});
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question