Spaces:
Sleeping
Sleeping
Captain Ezio
commited on
Commit
·
36e5ee7
1
Parent(s):
9a4f289
Update flood.py
Browse files- Powers/plugins/flood.py +36 -1
Powers/plugins/flood.py
CHANGED
@@ -116,7 +116,21 @@ async def flood_action(c: Gojo, m: Message):
|
|
116 |
await m.reply_text("Switch on the flood protection first.")
|
117 |
return
|
118 |
|
119 |
-
@Gojo.on_message(command(['
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
120 |
async def flood_set(c: Gojo, m: Message):
|
121 |
bot = await c.get_chat_member(m.chat.id, Config.BOT_ID)
|
122 |
status = bot.status
|
@@ -399,3 +413,24 @@ async def flood_watcher(c: Gojo, m: Message):
|
|
399 |
else:
|
400 |
return
|
401 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
116 |
await m.reply_text("Switch on the flood protection first.")
|
117 |
return
|
118 |
|
119 |
+
@Gojo.on_message(command(['isflood', 'flood']) & ~filters.bot)
|
120 |
+
async def flood_set(c: Gojo, m: Message):
|
121 |
+
if m.chat.type == CT.PRIVATE:
|
122 |
+
return await m.reply_text("This command is ment to be used in groups.")
|
123 |
+
c_id = m.chat.id
|
124 |
+
is_flood = Flood.is_chat(c_id)
|
125 |
+
c_id = m.chat.id
|
126 |
+
if is_flood:
|
127 |
+
saction = is_flood[2]
|
128 |
+
slimit = is_flood[0]
|
129 |
+
swithin = is_flood[1]
|
130 |
+
return await m.reply_text(f"Flood is on for this chat\n**Action**:{saction}\n**Messages**:{slimit} within {swithin} sec")
|
131 |
+
return await m.reply_text("Flood protection is off of this chat.")
|
132 |
+
|
133 |
+
@Gojo.on_message(command(['setflood']) & ~filters.bot & admin_filter)
|
134 |
async def flood_set(c: Gojo, m: Message):
|
135 |
bot = await c.get_chat_member(m.chat.id, Config.BOT_ID)
|
136 |
status = bot.status
|
|
|
413 |
else:
|
414 |
return
|
415 |
|
416 |
+
|
417 |
+
__PLUGIN__ = "anti-flood"
|
418 |
+
__alt_name__ = [
|
419 |
+
"anit-flood",
|
420 |
+
"flood",
|
421 |
+
"spam",
|
422 |
+
"anti-spam",
|
423 |
+
]
|
424 |
+
__HELP__ = """
|
425 |
+
**Anti Flood**
|
426 |
+
**User Commands:**
|
427 |
+
• /flood: to check weather the group is protected from spam or not.
|
428 |
+
|
429 |
+
**Admin only:**
|
430 |
+
• /setflood `on/off`: To activate or deactivate the flood protection
|
431 |
+
• /floodaction: To customize the flood settings.
|
432 |
+
|
433 |
+
**Example:**
|
434 |
+
`/setflood on`
|
435 |
+
"""
|
436 |
+
|