I'm using Rundeck for some automation and i already use it to send messages with a bot to a specific Telegram Grops.
I do it using a
"HTTP Request Step" with "https://api.telegram.org/<BOT>/sendMessage"
and 2 input options
{ "chat_id": "${option.chatid}", "text": "${option.corpo}" }
It works perfectly!
Now I'm trying to evolve it sending photos with:
https://api.telegram.org/<BOT>/sendPhoto And this 3 input options
{ "chat_id": "${option.chatid}", "text": "${option.corpo}", "file": "${file.file}" }
The file option is a "File" type.
the error that appears is:
{ "ok": false, "error_code": 400, "description": "Bad Request: there is no photo in the request" } Error when sending request: Attempted read from closed stream.
Do you have some tips? Thank you!
Miglio
I've tried to use "photo" and not "file" in the body of the option, but it doesn't works.
sendPhotomethod does not have afileparamater, you'll need to pass the photo to thephotoparameter.textparameter, that's calledcaptiononsendPhotoNot an rundeck expect but seems like you'll need something like:
file→phototext→caption