Describe the problem/error/question
I’m trying to create a workflow that uses the Telegram node.
First using the Telegram trigger to get an inline request, then doing some web searching then returning results via inline callback. I’ve already been able to receive/send text messages with the Telegram node but now trying inline.
Trying to send InlineQueryResultPhotos (Telegram Bot API)
So each one needs “photo”, id, url_to_photo, url_to_thumbnail.
So after doing my websearch I have the following function block:
const results = [];
for (const item of $input.all()) {
item.json.items.forEach(grabimages);
item.json.imagelist = results;
}
function grabimages(result, index) {
results.push(["photo", index, result.link, result.image.thumbnailLink]);
}
return $input.all();
I successfully get an array of results in imagelist into the input of the last node:
And here is my input to the Telegram node but then I get the error.
I’ve also tried to JSON.stringify the imagelist but that didn’t do it either.
I think I’m missing something very basic here. Any help would be appreciated!
What is the error message (if any)?
ERROR: Bad request - please check your parameters
Bad Request: can’t parse inline query result: Inline query result must be an object