Skip to content
This repository was archived by the owner on Oct 14, 2018. It is now read-only.

Commit ffec87e

Browse files
committed
Prepare anti-flood plugin for supergorups. No channel_kick_user
1 parent 041be30 commit ffec87e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

plugins/anti-flood.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ local function kick_user(user_id, chat_id)
1313
end
1414

1515
local function run (msg, matches)
16-
if msg.to.type ~= 'chat' then
16+
if msg.to.type ~= 'chat' and msg.to.type ~= 'channel' then
1717
return 'Anti-flood works only on channels'
1818
else
1919
local chat = msg.to.id
@@ -53,7 +53,7 @@ local function pre_process (msg)
5353
local chat = msg.to.id
5454

5555
send_msg(receiver, text, ok_cb, nil)
56-
if msg.to.type ~= 'chat' then
56+
if msg.to.type ~= 'chat' and msg.to.type ~= 'channel' then
5757
print("Flood in not a chat group!")
5858
elseif user == tostring(our_id) then
5959
print('I won\'t kick myself')

0 commit comments

Comments
 (0)