nothing append when using answerInlineQuery to send photo.
See original GitHub issueHere is my code, very basic:
bot.on('inline_query', function(query) {
picturesToSend = [];
// open the folder and get the number of pictures in
var files = fs.readdirSync('./img/');
var numberOfPics = files.length;
// get 3 random pictures from my folder
for (var i = 0; i < 3; i++) {
// get a random picture name in my folder
pictureName = files[Math.floor(Math.random() * numberOfPics)];
// open this picture and add it to and array
picturesToSend.push(fs.readFileSync('./img/' + pictureName));
}
// send the array containing 3 pictures
bot.answerInlineQuery(query.id, picturesToSend);
});
When using answerInlineQuery nothing append and I got no error.
Of course I have activate /setinlineBot with botfather
Issue Analytics
- State:
- Created 8 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Send a local photo from inline mode in a telegram bot
The bot can message you the photo, get that information and use what you need. Another option is creating a private channel where...
Read more >telepot reference — telepot 12.7 documentation - Read the Docs
When you are dealing with a particular chat, it is tedious to have to supply the same chat_id every time to send a...
Read more >amanobot Documentation - Read the Docs
Parameters audio – Same as photo in amanobot.Bot.sendPhoto(). sendDocument(chat_id: Union[int, str], document, thumb=None, caption: str ...
Read more >Telegram Bot API
New incoming channel post of any kind - text, photo, sticker, etc. ... that happened when trying to synchronize available updates with Telegram...
Read more >Frequently Asked Questions - Midjourney Documentation
A: Use /relax in a bot channel. This will cost you nothing but images will take longer to generate.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Your code is wrong. Take a look on answerInlineQuery
Thank you for your help. For now it’s not possible to send local file.