-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nothing append when using answerInlineQuery to send photo. #59
Comments
Your code is wrong. |
Yes I have seen it but I don't understand, I have set inline_query_id and results, cache_time, is_personal and next_offset are optional. Do I have to set them? |
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
var pictureName = files[Math.floor(Math.random() * numberOfPics)];
var pictureData = fs.readFileSync('./img/' + pictureName);
picturesToSend.push({
type: 'photo',
id: i,
photo_url: pictureData,
thumb_url: pictureData
});
}
// send the array containing 3 pictures
bot.answerInlineQuery(query.id, picturesToSend);
}); I try this way, but nothing append |
|
Thank you for your help. For now it's not possible to send local file. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here is my code, very basic:
When using answerInlineQuery nothing append and I got no error.
Of course I have activate
/setinlineBot
with botfatherThe text was updated successfully, but these errors were encountered: