From b61051109597c405824d46b3b00df33f678a6bba Mon Sep 17 00:00:00 2001 From: yago Date: Wed, 11 Feb 2015 22:01:31 +0100 Subject: [PATCH] updated version --- bot/bot.lua | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/bot/bot.lua b/bot/bot.lua index 3f4fb11..7ed6756 100644 --- a/bot/bot.lua +++ b/bot/bot.lua @@ -5,7 +5,7 @@ json = (loadfile "./libs/JSON.lua")() serpent = (loadfile "./libs/serpent.lua")() require("./bot/utils") -VERSION = '0.8.5' +VERSION = '0.8.6' function on_msg_receive (msg) vardump(msg) @@ -63,12 +63,18 @@ end function do_action(msg) local receiver = get_receiver(msg) local text = msg.text + if msg.text == nil then - -- Not a text message, make text the same as what tg shows so - -- we can match on it. The plugin is resposible for handling - text = '['..msg.media.type..']' + -- Not a text message, make text the same as what tg shows so + -- we can match on it. The plugin is resposible for handling + if msg.media ~= nil then + text = '['..msg.media.type..']' + end end + -- We can't do anything + if msg.text == nil return false end + msg.text = do_lex(msg, text) for name, desc in pairs(plugins) do