function sendTg(arg)
local token = (Сюда токен бота)
local chat_id = (Сюда твой ID, либо ID чата)
asyncHttpRequest("GET", "https://api.telegram.org/bot" .. token .. "/sendMessage?chat_id=" .. chat_id .. "&text=" .. u8:encode(arg:gsub(" ", "%+"):gsub("\n", "%%0A"), "CP1251"))
end
function asyncHttpRequest(method, url)
local request_thread = effil.thread(function(method, url)
local requests = require("requests")
local result, response = pcall(requests.request, method, url)
if result then
response.json, response.xml = nil, nil
return true, response
else
return false, response
end
end)(method, url)
end
sendTg("Привет")