This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Telegram Image
#1
Hello,

I have this function created to send image with Telegram's BOT.

local telegram_url_sendphototo = 'https://api.telegram.org/BOT/sendPhoto?'


function TelegramPhoto(photo)
   local data_str = 'chat_id=' .. chat_id .. '&photo=' .. photo ..''
   local res, code, headers, status = ssl.https.request(telegram_url_sendphototo,data_str)
   log (res,code,headers,status)
end


I try to send LogicMachine Icon Image but it gives me an error.

--TelegramPhoto("http://logicmachineurl:port/scada/resources/icons/door.png")

If I take an image URL from google images there is no problem..

Is posible to get image from LogicMachine icons?

Thanks
Reply
#2
This won't work because LM web server cannot be reached from the outside. You need to send image using multipart/form-data request (https://core.telegram.org/bots/api#inputfile). See this thread for an example that can be used: https://forum.logicmachine.net/showthrea...50#pid7150
Reply


Forum Jump: