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 APP
#35
(06.01.2024, 17:51)olegrz Wrote:
(03.06.2020, 18:40)Daniel Wrote: It will work in new FW 2.5.0 which should be available in a month time.

For older fw it will work like this

Code:
function request(url)
  local resp = {}
  local stat, code, hdrs = require('ssl.https').request({
    method = 'GET',
    url = url,
    protocol = 'tlsv12',
    sink = ltn12.sink.table(resp),
  })

  if stat then
    stat = table.concat(resp)
  end

  return stat, code, hdrs
end

local chat_id = '12345'
local token = 'wwwwwwwwwwwwwwwwwwwwwwwwww'
local telegram_url = 'https://api.telegram.org/bot' .. token .. '/sendMessage?'


message = "test"
message=require('socket.url').escape(message)
data_str = 'chat_id=' .. chat_id .. '&text=' .. message..''
stat, code, hdrs = request(telegram_url .. data_str)

Hello, Daniel!
I have LM2 upgraded to 20181002 version.
I used your code for older fw.
Unfortunately, I have reply:
------------
TGtest 06.01.2024 18:30:00
* arg: 1
  * nil
* arg: 2
  * string: Try again
* arg: 3
  * nil
TGtest 06.01.2024 18:30:04
* arg: 1
  * nil
* arg: 2
  * string: Try again
* arg: 3
  * nil
--------------
Could you advice me the right way :-)
Thank you in advance,
KR, Oleg
Hello Daniel!
I've found solution in your previous post "Check that you have DNS and gateway configured correctly in System config > Network > Interfaces. "
It works! Have a nice day! KR Oleg
Reply


Messages In This Thread
TELEGRAM APP - by Hosutech - 01.06.2020, 11:15
RE: TELEGRAM APP - by Daniel - 01.06.2020, 14:29
RE: TELEGRAM APP - by JRP - 03.06.2020, 17:18
RE: TELEGRAM APP - by JRP - 11.07.2020, 18:47
RE: TELEGRAM APP - by khalil - 04.03.2021, 10:36
RE: TELEGRAM APP - by olegrz - 04.09.2022, 12:32
RE: TELEGRAM APP - by Daniel - 03.06.2020, 18:02
RE: TELEGRAM APP - by JRP - 03.06.2020, 18:27
RE: TELEGRAM APP - by Daniel - 03.06.2020, 18:40
RE: TELEGRAM APP - by JRP - 03.06.2020, 18:57
RE: TELEGRAM APP - by Erwin van der Zwart - 03.06.2020, 21:06
RE: TELEGRAM APP - by olegrz - 06.01.2024, 17:51
RE: TELEGRAM APP - by olegrz - 07.01.2024, 09:09
RE: TELEGRAM APP - by admin - 04.06.2020, 04:36
RE: TELEGRAM APP - by baggins - 04.06.2020, 10:54
RE: TELEGRAM APP - by JRP - 04.06.2020, 07:35
RE: TELEGRAM APP - by admin - 04.06.2020, 11:17
RE: TELEGRAM APP - by phongvucba - 04.08.2020, 09:03
RE: TELEGRAM APP - by Daniel - 04.08.2020, 09:06
RE: TELEGRAM APP - by admin - 04.03.2021, 10:38
RE: TELEGRAM APP - by khalil - 04.03.2021, 10:44
RE: TELEGRAM APP - by khalil - 04.03.2021, 14:18
RE: TELEGRAM APP - by admin - 04.03.2021, 17:17
RE: TELEGRAM APP - by khalil - 08.03.2021, 14:28
RE: TELEGRAM APP - by admin - 09.03.2021, 07:08
RE: TELEGRAM APP - by khalil - 09.03.2021, 08:42
RE: TELEGRAM APP - by admin - 09.03.2021, 08:45
RE: TELEGRAM APP - by khalil - 09.03.2021, 09:24
RE: TELEGRAM APP - by edgars - 09.02.2022, 11:49
RE: TELEGRAM APP - by admin - 05.09.2022, 06:17
RE: TELEGRAM APP - by olegrz - 05.09.2022, 09:04
RE: TELEGRAM APP - by Daniel - 02.02.2023, 18:08
RE: TELEGRAM APP - by David - 26.04.2023, 07:28
RE: TELEGRAM APP - by admin - 26.04.2023, 07:28
RE: TELEGRAM APP - by David - 26.04.2023, 07:33

Forum Jump: