commit
64735e2ff9
@ -30,8 +30,13 @@ local action = function(msg)
|
|||||||
local url = 'https://api.nasa.gov/planetary/apod?api_key=' .. config.nasa_api_key
|
local url = 'https://api.nasa.gov/planetary/apod?api_key=' .. config.nasa_api_key
|
||||||
|
|
||||||
if input then
|
if input then
|
||||||
url = url .. '&date=' .. URL.escape(input)
|
if input:match('(%d+)%-(%d+)%-(%d+)$') then
|
||||||
date = date .. input
|
url = url .. '&date=' .. URL.escape(input)
|
||||||
|
date = date .. input
|
||||||
|
else
|
||||||
|
sendMessage(msg.chat.id, doc, true, msg.message_id, true)
|
||||||
|
return
|
||||||
|
end
|
||||||
else
|
else
|
||||||
date = date .. os.date("%F")
|
date = date .. os.date("%F")
|
||||||
end
|
end
|
||||||
|
@ -26,10 +26,10 @@ local action = function(msg)
|
|||||||
local source
|
local source
|
||||||
if input then
|
if input then
|
||||||
if input:match('^r/.') then
|
if input:match('^r/.') then
|
||||||
url = 'http://www.reddit.com/' .. input .. '/.json?limit=' .. limit
|
url = 'http://www.reddit.com/' .. URL.escape(input) .. '/.json?limit=' .. limit
|
||||||
source = '*/r/' .. input:match('^r/(.+)') .. '*\n'
|
source = '*/r/' .. input:match('^r/(.+)') .. '*\n'
|
||||||
else
|
else
|
||||||
url = 'http://www.reddit.com/search.json?q=' .. input .. '&limit=' .. limit
|
url = 'http://www.reddit.com/search.json?q=' .. URL.escape(input) .. '&limit=' .. limit
|
||||||
source = '*reddit results for* _' .. input .. '_ *:*\n'
|
source = '*reddit results for* _' .. input .. '_ *:*\n'
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
Reference in New Issue
Block a user