Merge pull request #46 from JuanPotato/master

support replied message's captions instead of text
This commit is contained in:
Drew 2016-04-03 23:33:11 -04:00
commit 52773136b0

View File

@ -73,6 +73,10 @@ on_msg_receive = function(msg) -- The fn run whenever a message is received.
if msg.date < os.time() - 5 then return end -- Do not process old messages.
if not msg.text then msg.text = msg.caption or '' end
if msg.reply_to_message and msg.reply_to_message.caption then
msg.reply_to_message.text = msg.reply_to_message.caption
end -- If the reply_to_msg contains a caption, set it as its text
if msg.text:match('^/start .+') then
msg.text = '/' .. msg.text:input()
end