Comments (5)
Your code is wrong.
Take a look on answerInlineQuery
from node-telegram-bot-api.
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?
from node-telegram-bot-api.
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
from node-telegram-bot-api.
photo_url
is a simple web URL
from node-telegram-bot-api.
Thank you for your help. For now it's not possible to send local file.
from node-telegram-bot-api.
Related Issues (20)
- issue with inline photos
- security warnings with 0.64.0 HOT 2
- How to get GroupID (how use switch_inline_query to get groupID)?
- ETELEGRAM: 403 Forbidden: the group chat was deleted
- Failed to sendMessage() with nodejs 20 and ubuntu 22 HOT 1
- New features HOT 1
- How to copy text to the clipboard after clicking on it HOT 4
- My bot can't get 'new_chat_members' event - only working for bots created with botfather for testing, not real users HOT 32
- Telgram
- Telgarm booy
- setChatMenuButton not working (Web app) HOT 3
- Impossible opjects
- Deprecated dependencies: @cypress/request-promise HOT 1
- full screen HOT 1
- bot.getChatMenuButton HOT 2
- Does the API not support:Message about members leaving the group? HOT 1
- How to get call on setmenubutton ?
- Stop listening for new message events and crash app
- how to create sticker with pack, i'm new with this library so i got many error while trying
- sendMediaGroup - InputMediaDocument HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-telegram-bot-api.