copas.lua: tlsv1 alert protocol version

lorgon

Известный
Автор темы
657
268
Версия MoonLoader
.027.0-preview
Предисловие, я тупой. В чём проблема?
Lua:
function main()
    while not isSampAvailable() do wait(200) end
    msg()
    while true do wait(0)

    end
end

function msg()
    httpRequest('https://api.telegram.org/bot*****/sendMessage?chat_id=****&text=test', nil, function(response) end)
end

function switchCopasStatus()
    if not copas.running then
        copas.running = true
        lua_thread.create(function()
            wait(0)
            while not copas.finished() do
                local ok, err = copas.step(0)
                if ok == nil then error(err) end
                wait(0)
            end
            copas.running = false
        end)
    end
end

function httpRequest(request, body, handler) -- Author: FYP
    switchCopasStatus()
    if handler then
        return copas.addthread(function(r, b, h)
            copas.setErrorHandler(function(err) h(nil, err) end)
            h(chttp.request(r, b))
        end, request, body, handler)
    else
        local results
        local thread = copas.addthread(function(r, b)
            copas.setErrorHandler(function(err) results = {nil, err} end)
            results = table.pack(chttp.request(r, b))
        end, request, body)
        while coroutine.status(thread) ~= 'dead' do wait(0) end
        return table.unpack(results)
    end
end
Ошибка: copas.lua:382: tlsv1 alert protocol version
Как ее исправить?



UPD: Проблема решена, просто обновил файлы либы с гит хаб
 
Последнее редактирование: