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