From f2b243a47c9e5696d43811933d5e9134e3166ced Mon Sep 17 00:00:00 2001 From: topkecleon Date: Thu, 14 Jan 2016 23:08:49 -0500 Subject: [PATCH] "fixed" #17 about.lua: stops all forwarded messages floodcontrol.lua: logs to config.log_chat else console --- config.lua | 4 ++-- plugins/about.lua | 4 ++++ plugins/floodcontrol.lua | 3 ++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/config.lua b/config.lua index de56b10..943bc5b 100755 --- a/config.lua +++ b/config.lua @@ -68,10 +68,10 @@ telegram.me/otouto realm_name = 'My Realm' }, plugins = { - 'blacklist.lua', - 'floodcontrol.lua', 'control.lua', + 'blacklist.lua', 'about.lua', + 'floodcontrol.lua', 'ping.lua', 'whoami.lua', 'nick.lua', diff --git a/plugins/about.lua b/plugins/about.lua index 620ede8..687c4cb 100755 --- a/plugins/about.lua +++ b/plugins/about.lua @@ -7,6 +7,10 @@ local triggers = { local action = function(msg) + -- Filthy hack, but here is where we'll stop forwarded messages from hitting + -- other plugins. + if msg.forward_from then return end + local message = config.about_text .. '\nBased on otouto v'..version..' by topkecleon.\notouto v3 is licensed under the GPLv2.\ntopkecleon.github.io/otouto' if msg.new_chat_participant and msg.new_chat_participant.id == bot.id then diff --git a/plugins/floodcontrol.lua b/plugins/floodcontrol.lua index c8e05df..a25bb6c 100755 --- a/plugins/floodcontrol.lua +++ b/plugins/floodcontrol.lua @@ -31,7 +31,8 @@ local action = function(msg) floodcontrol[input.groupid] = os.time() + input.duration - print(input.groupid .. ' silenced for ' .. input.duration .. ' seconds.') + local output = input.groupid .. ' silenced for ' .. input.duration .. ' seconds.' + handle_exception('floodcontrol.lua', output) end