Minor improvements when sending image

This commit is contained in:
Tiago Danin 2016-01-17 15:39:00 -03:00
parent c697df1762
commit f56e2a4149
2 changed files with 5 additions and 2 deletions

View File

@ -24,8 +24,9 @@ local action = function(msg)
end
str = str:match('<img src="(.*)">')
local output = '[]('..str..')'
sendMessage(msg.chat.id, str)
sendMessage(msg.chat.id, output, false, nil, true)
end

View File

@ -59,11 +59,13 @@ local action = function(msg)
local i = math.random(jdat.queries.request[1].count)
local result = jdat.items[i].link
local output = '[]('..result..')'
if string.match(msg.text, '^/i[mage]*nsfw') then
sendReply(msg, result)
else
sendMessage(msg.chat.id, result, false, msg.message_id)
sendMessage(msg.chat.id, output, false, nil, true)
end
end