From bcb2fc630d3f20f317c1340ed8fe8ca452fb0f70 Mon Sep 17 00:00:00 2001 From: JuanPotato Date: Sun, 3 Apr 2016 15:18:25 -0400 Subject: [PATCH] support replied message's captions instead of text --- bot.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bot.lua b/bot.lua index 46faecf..bb926fb 100755 --- a/bot.lua +++ b/bot.lua @@ -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