17.01.2025, 12:43
(17.01.2025, 12:19)admin Wrote: You can run a HTTP server or even a simple TCP server that will forward messages to telegram as needed. You can use any programming language to implement this. Don't forget to run this server automatically when the system starts.
I'm not quite sure I understand.
Where would I have to run this HTTP server? On the remote server that I now ssh to there runs already an http server. How do I get it to forward messages to telegram? As you can guess I am not familiar with this stuff...
I used to run the following script on this LM before telegram changed their policy (and I could not upgrade the firmware):
Code:
require 'ssl.https'
local telegram_url = 'https://api.telegram.org/mybot/sendMessage?'
local chat_id = 'XXXXX'
function telegram(message)
local data_str = 'chat_id=' .. chat_id .. '&text=' .. message..''
local res, code, headers, status = ssl.https.request(telegram_url, data_str)
end