about.lua: stops all forwarded messages
floodcontrol.lua: logs to config.log_chat else console
This commit is contained in:
topkecleon 2016-01-14 23:08:49 -05:00
parent 77fd9b07a4
commit f2b243a47c
3 changed files with 8 additions and 3 deletions

View File

@ -68,10 +68,10 @@ telegram.me/otouto
realm_name = 'My Realm' realm_name = 'My Realm'
}, },
plugins = { plugins = {
'blacklist.lua',
'floodcontrol.lua',
'control.lua', 'control.lua',
'blacklist.lua',
'about.lua', 'about.lua',
'floodcontrol.lua',
'ping.lua', 'ping.lua',
'whoami.lua', 'whoami.lua',
'nick.lua', 'nick.lua',

View File

@ -7,6 +7,10 @@ local triggers = {
local action = function(msg) 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' 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 if msg.new_chat_participant and msg.new_chat_participant.id == bot.id then

View File

@ -31,7 +31,8 @@ local action = function(msg)
floodcontrol[input.groupid] = os.time() + input.duration 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 end