diff --git a/bot.lua b/bot.lua index 2fbdc6d..7fa53b0 100755 --- a/bot.lua +++ b/bot.lua @@ -37,7 +37,7 @@ end on_msg_receive = function(msg) -- The fn run whenever a message is received. - if not msg.text then msg.text = '' end -- So about.lua works. + if not msg.text then msg.text = msg.caption or '' end -- So about.lua works. if msg.date < os.time() - 5 then return end -- Do not process old messages. msg.chat.id_str = tostring(msg.chat.id) diff --git a/plugins/chatter.lua b/plugins/chatter.lua index 5bd608d..c62b90f 100755 --- a/plugins/chatter.lua +++ b/plugins/chatter.lua @@ -8,6 +8,8 @@ local triggers = { local action = function(msg) + if msg.text == '' then return end + -- This is awkward, but if you have a better way, please share. if msg.text_lower:match('^' .. bot.first_name .. ',') then elseif msg.text_lower:match('^@' .. bot.username .. ',') then