|
9 | 9 | import time
|
10 | 10 | import asyncio
|
11 | 11 |
|
12 |
| -from pyrogram import Message, Filters, ChatPermissions |
| 12 | +from pyrogram import filters |
| 13 | +from pyrogram.types import Message, ChatPermissions |
13 | 14 | from pyrogram.errors import (
|
14 | 15 | FloodWait, UserAdminInvalid, UsernameInvalid, PeerIdInvalid, UserIdInvalid)
|
15 | 16 |
|
16 |
| -from assistant import bot, filters |
| 17 | +from assistant import bot, cus_filters |
17 | 18 | from assistant.utils import (
|
18 | 19 | is_dev, is_self, is_admin, sed_sticker, check_rights, check_bot_rights)
|
19 | 20 |
|
20 | 21 |
|
21 | 22 | @bot.on_message( # tban in queue
|
22 |
| - Filters.command("ban") & filters.auth_chats & filters.auth_users) |
| 23 | + filters.command("ban") & cus_filters.auth_chats & cus_filters.auth_users) |
23 | 24 | async def _ban_user(_, msg: Message):
|
24 | 25 | chat_id = msg.chat.id
|
25 | 26 | if not await check_rights(chat_id, msg.from_user.id, "can_restrict_members"):
|
@@ -74,7 +75,7 @@ async def _ban_user(_, msg: Message):
|
74 | 75 |
|
75 | 76 |
|
76 | 77 | @bot.on_message(
|
77 |
| - Filters.command("unban") & filters.auth_chats & filters.auth_users) |
| 78 | + filters.command("unban") & cus_filters.auth_chats & cus_filters.auth_users) |
78 | 79 | async def _unban_user(_, msg: Message):
|
79 | 80 | chat_id = msg.chat.id
|
80 | 81 | if not await check_rights(chat_id, msg.from_user.id, "can_restrict_members"):
|
@@ -110,7 +111,7 @@ async def _unban_user(_, msg: Message):
|
110 | 111 |
|
111 | 112 |
|
112 | 113 | @bot.on_message(
|
113 |
| - Filters.command("kick") & filters.auth_chats & filters.auth_users) |
| 114 | + filters.command("kick") & cus_filters.auth_chats & cus_filters.auth_users) |
114 | 115 | async def _kick_user(_, msg: Message):
|
115 | 116 | chat_id = msg.chat.id
|
116 | 117 | if not await check_rights(chat_id, msg.from_user.id, "can_restrict_members"):
|
@@ -165,7 +166,7 @@ async def _kick_user(_, msg: Message):
|
165 | 166 |
|
166 | 167 |
|
167 | 168 | @bot.on_message(
|
168 |
| - Filters.command("promote") & filters.auth_chats & filters.auth_users) |
| 169 | + filters.command("promote") & cus_filters.auth_chats & cus_filters.auth_users) |
169 | 170 | async def _promote_user(_, msg: Message):
|
170 | 171 | chat_id = msg.chat.id
|
171 | 172 | if not await check_rights(chat_id, msg.from_user.id, "can_promote_members"):
|
@@ -206,7 +207,7 @@ async def _promote_user(_, msg: Message):
|
206 | 207 |
|
207 | 208 |
|
208 | 209 | @bot.on_message(
|
209 |
| - Filters.command("demote") & filters.auth_chats & filters.auth_users) |
| 210 | + filters.command("demote") & cus_filters.auth_chats & cus_filters.auth_users) |
210 | 211 | async def _demote_user(_, msg: Message):
|
211 | 212 | chat_id = msg.chat.id
|
212 | 213 | if not await check_rights(chat_id, msg.from_user.id, "can_promote_members"):
|
@@ -250,7 +251,7 @@ async def _demote_user(_, msg: Message):
|
250 | 251 |
|
251 | 252 |
|
252 | 253 | @bot.on_message( # tmute in queue
|
253 |
| - Filters.command("mute") & filters.auth_chats & filters.auth_users) |
| 254 | + filters.command("mute") & cus_filters.auth_chats & cus_filters.auth_users) |
254 | 255 | async def _mute_user(_, msg: Message):
|
255 | 256 | chat_id = msg.chat.id
|
256 | 257 | if not await check_rights(chat_id, msg.from_user.id, "can_restrict_members"):
|
@@ -307,7 +308,7 @@ async def _mute_user(_, msg: Message):
|
307 | 308 |
|
308 | 309 |
|
309 | 310 | @bot.on_message(
|
310 |
| - Filters.command("unmute") & filters.auth_chats & filters.auth_users) |
| 311 | + filters.command("unmute") & cus_filters.auth_chats & cus_filters.auth_users) |
311 | 312 | async def _unmute_user(_, msg: Message):
|
312 | 313 | chat_id = msg.chat.id
|
313 | 314 | if not await check_rights(chat_id, msg.from_user.id, "can_restrict_members"):
|
@@ -356,7 +357,7 @@ async def _unmute_user(_, msg: Message):
|
356 | 357 |
|
357 | 358 |
|
358 | 359 | @bot.on_message(
|
359 |
| - Filters.command("zombies") & filters.auth_chats & filters.auth_users) |
| 360 | + filters.command("zombies") & cus_filters.auth_chats & cus_filters.auth_users) |
360 | 361 | async def _zombie_clean(_, msg: Message):
|
361 | 362 | chat_id = msg.chat.id
|
362 | 363 | if "clean" in msg.text.lower():
|
@@ -405,7 +406,7 @@ async def _zombie_clean(_, msg: Message):
|
405 | 406 |
|
406 | 407 |
|
407 | 408 | @bot.on_message(
|
408 |
| - Filters.command("pin") & filters.auth_chats & filters.auth_users) |
| 409 | + filters.command("pin") & cus_filters.auth_chats & cus_filters.auth_users) |
409 | 410 | async def _pin(_, msg: Message):
|
410 | 411 | chat_id = msg.chat.id
|
411 | 412 | if not await check_rights(chat_id, msg.from_user.id, "can_pin_messages"):
|
@@ -433,7 +434,7 @@ async def _pin(_, msg: Message):
|
433 | 434 |
|
434 | 435 |
|
435 | 436 | @bot.on_message(
|
436 |
| - Filters.command("unpin") & filters.auth_chats & filters.auth_users) |
| 437 | + filters.command("unpin") & cus_filters.auth_chats & cus_filters.auth_users) |
437 | 438 | async def _unpin(_, msg: Message):
|
438 | 439 | chat_id = msg.chat.id
|
439 | 440 | if not await check_rights(chat_id, msg.from_user.id, "can_pin_messages"):
|
|
0 commit comments