diff --git a/README.md b/README.md index a2779d8..c9e4992 100644 --- a/README.md +++ b/README.md @@ -410,3 +410,4 @@ Contributions are appreciated in all forms. Monetary contributions will go towar | [n8 c00](http://telegram.me/n8_c00) | | [Alex](http://telegram.me/sandu) | | [Brayden](http://telegram.me/bb010g) | +| [Milad](http://telegram.me/thelad) | diff --git a/otouto/bindings.lua b/otouto/bindings.lua index b821722..5250422 100644 --- a/otouto/bindings.lua +++ b/otouto/bindings.lua @@ -22,10 +22,10 @@ local bindings = {} -local HTTPS = require('ssl.https') -local JSON = require('dkjson') +local https = require('ssl.https') +local json = require('dkjson') local ltn12 = require('ltn12') -local MP_ENCODE = require('multipart-post').encode +local mp_encode = require('multipart-post').encode function bindings.init(token) bindings.BASE_URL = 'https://api.telegram.org/bot' .. token .. '/' @@ -58,8 +58,8 @@ function bindings.request(method, parameters, file) parameters = {''} end local response = {} - local body, boundary = MP_ENCODE(parameters) - local success, code = HTTPS.request{ + local body, boundary = mp_encode(parameters) + local success, code = https.request{ url = bindings.BASE_URL .. method, method = 'POST', headers = { @@ -74,7 +74,7 @@ function bindings.request(method, parameters, file) print(method .. ': Connection error. [' .. code .. ']') return false, false else - local result = JSON.decode(data) + local result = json.decode(data) if not result then return false, false elseif result.ok then