diff --git a/README.md b/README.md index d28a33b..793a472 100755 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ #otouto The plugin-wielding, multipurpose Telegram bot. -The public bot runs on [@mokubot](https://telegram.me/otouto). +The public bot runs on [@mokubot](https://telegram.me/mokubot). otouto is licensed under the GNU General Public License. A copy of the license has been included in [LICENSE](https://github.com/topkecleon/otouto/blob/master/LICENSE). diff --git a/bot.lua b/bot.lua index 7fa53b0..873ef78 100755 --- a/bot.lua +++ b/bot.lua @@ -37,8 +37,8 @@ end on_msg_receive = function(msg) -- The fn run whenever a message is received. - 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. + if not msg.text then msg.text = msg.caption or '' end msg.chat.id_str = tostring(msg.chat.id) msg.from.id_str = tostring(msg.from.id) diff --git a/plugins/about.lua b/plugins/about.lua index ad766e1..2c1cbcd 100755 --- a/plugins/about.lua +++ b/plugins/about.lua @@ -15,7 +15,7 @@ local action = function(msg) sendMessage(msg.chat.id, message) return elseif string.match(msg.text_lower, '^/about[@'..bot.username..']*') then - sendReply(msg, message) + sendMessage(msg.chat.id, message) return end diff --git a/plugins/echo.lua b/plugins/echo.lua index 53a256a..5db8dc6 100755 --- a/plugins/echo.lua +++ b/plugins/echo.lua @@ -12,7 +12,7 @@ local action = function(msg) local input = msg.text:input() if input then - sendReply(msg, latcyr(input)) + sendMessage(msg.chat.id, latcyr(input)) else sendReply(msg, doc) end diff --git a/plugins/eightball.lua b/plugins/eightball.lua index 00e9fde..fddc34b 100755 --- a/plugins/eightball.lua +++ b/plugins/eightball.lua @@ -47,7 +47,7 @@ local action = function(msg) local message - if msg.text:match('y/n%p?$') then + if msg.text_lower:match('y/n%p?$') then message = yesno_answers[math.random(#yesno_answers)] else message = ball_answers[math.random(#ball_answers)]