09.02.2022, 11:49
In case you need to have several Telegram users to access your bot, use the following user library:
Code:
require('ssl.https')
local token = 'token' -- your token
local chat_id_1 = '1234567' -- your chat id 1
local chat_id_2 = '7654321' -- your chat id 2
function telegram(message)
local url = 'https://api.telegram.org/bot' .. token .. '/sendMessage'
local msg = socket.url.escape(message)
ssl.https.request(url, 'chat_id=' .. chat_id_1 .. '&text=' .. msg)
ssl.https.request(url, 'chat_id=' .. chat_id_2 .. '&text=' .. msg)
end