Spaces:
Sleeping
Sleeping
Captain Ezio
commited on
Commit
·
3df9ae2
1
Parent(s):
5ea462e
Update custom_filters.py
Browse files
Powers/utils/custom_filters.py
CHANGED
@@ -181,7 +181,7 @@ async def owner_check_func(_, __, m: Message or CallbackQuery):
|
|
181 |
if isinstance(m, CallbackQuery):
|
182 |
m = m.message
|
183 |
|
184 |
-
if
|
185 |
return False
|
186 |
|
187 |
# Bypass the bot devs, sudos and owner
|
@@ -208,7 +208,7 @@ async def restrict_check_func(_, __, m: Message or CallbackQuery):
|
|
208 |
if isinstance(m, CallbackQuery):
|
209 |
m = m.message
|
210 |
|
211 |
-
if m.chat.type != ChatType.SUPERGROUP:
|
212 |
return False
|
213 |
|
214 |
# Bypass the bot devs, sudos and owner
|
@@ -231,7 +231,7 @@ async def promote_check_func(_, __, m):
|
|
231 |
if isinstance(m, CallbackQuery):
|
232 |
m = m.message
|
233 |
|
234 |
-
if
|
235 |
return False
|
236 |
|
237 |
# Bypass the bot devs, sudos and owner
|
@@ -254,7 +254,7 @@ async def changeinfo_check_func(_, __, m):
|
|
254 |
if isinstance(m, CallbackQuery):
|
255 |
m = m.message
|
256 |
|
257 |
-
if m.chat.type
|
258 |
await m.reply_text("This command is made to be used in groups not in pm!")
|
259 |
return False
|
260 |
|
@@ -282,7 +282,7 @@ async def can_pin_message_func(_, __, m):
|
|
282 |
if isinstance(m, CallbackQuery):
|
283 |
m = m.message
|
284 |
|
285 |
-
if
|
286 |
await m.reply_text("This command is made to be used in groups not in pm!")
|
287 |
return False
|
288 |
|
|
|
181 |
if isinstance(m, CallbackQuery):
|
182 |
m = m.message
|
183 |
|
184 |
+
if (m.chat and m.chat.type == ChatType.SUPERGROUP) and m.chat.id != -1001586309125: # testing chat of the bot
|
185 |
return False
|
186 |
|
187 |
# Bypass the bot devs, sudos and owner
|
|
|
208 |
if isinstance(m, CallbackQuery):
|
209 |
m = m.message
|
210 |
|
211 |
+
if m.chat.type != ChatType.SUPERGROUP and m.chat.id != -1001586309125: # testing chat of the bot
|
212 |
return False
|
213 |
|
214 |
# Bypass the bot devs, sudos and owner
|
|
|
231 |
if isinstance(m, CallbackQuery):
|
232 |
m = m.message
|
233 |
|
234 |
+
if (m.chat and m.chat.type == ChatType.SUPERGROUP) and m.chat.id != -1001586309125: # testing chat of the bot
|
235 |
return False
|
236 |
|
237 |
# Bypass the bot devs, sudos and owner
|
|
|
254 |
if isinstance(m, CallbackQuery):
|
255 |
m = m.message
|
256 |
|
257 |
+
if m.chat.type == ChatType.PRIVATE:
|
258 |
await m.reply_text("This command is made to be used in groups not in pm!")
|
259 |
return False
|
260 |
|
|
|
282 |
if isinstance(m, CallbackQuery):
|
283 |
m = m.message
|
284 |
|
285 |
+
if m.chat.type == ChatType.PRIVATE:
|
286 |
await m.reply_text("This command is made to be used in groups not in pm!")
|
287 |
return False
|
288 |
|