Skip to content

Instantly share code, notes, and snippets.

@appendhc
Created March 13, 2016 12:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save appendhc/5fed07f38cc4cd628a3c to your computer and use it in GitHub Desktop.
Save appendhc/5fed07f38cc4cd628a3c to your computer and use it in GitHub Desktop.
free google translate api
do
local function run(msg, matches)
if not matches[3] then
t = http.request("http://lsdbot.noip.me/tr/?key=free-api&from=auto&to=en&text="..URL.escape(matches[2]))
return t
else
t = http.request("http://lsdbot.noip.me/tr/?key=free-api&from=auto&to="..matches[2].."&text="..URL.escape(matches[3]))
return t
end
end
return {patterns = {"^[#!/](tr) (.*) (.+)$","^[#!/](tr) (.+)$",}, run = run}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment