administration.lua: Added antiflood flag.

bible.lua: Some better error handling.
hearthstone.lua: Corrected help message.
utilities.lua: Added string:index() to succeed get_word().
This commit is contained in:
topkecleon
2016-03-31 07:53:12 -04:00
parent 3063df56c9
commit b643154df8
5 changed files with 174 additions and 29 deletions

View File

@ -29,12 +29,12 @@ local action = function(msg)
local message, res = HTTP.request(url)
if message:len() == 0 then
if not message or res ~= 200 or message:len() == 0 then
url = 'http://api.biblia.com/v1/bible/content/KJVAPOC.txt?key=' .. config.biblia_api_key .. '&passage=' .. URL.escape(input)
message, res = HTTP.request(url)
end
if res ~= 200 then
if not message or res ~= 200 or message:len() == 0 then
message = config.errors.results
end