"fixed" #17
about.lua: stops all forwarded messages floodcontrol.lua: logs to config.log_chat else console
This commit is contained in:
parent
77fd9b07a4
commit
f2b243a47c
@ -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',
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user