@@ -214,7 +214,7 @@ class Filters:
214214
215215 from_scheduled = create (lambda _ , m : bool (m .from_scheduled ), "FromScheduledFilter" )
216216 """Filter new automatically sent messages that were previously scheduled."""
217-
217+
218218 # Messages from linked channels are forwarded automatically by Telegram and have no sender (from_user is None).
219219 linked_channel = create (lambda _ , m : bool (m .forward_from_chat and not m .from_user ), "LinkedChannelFilter" )
220220 """Filter messages that are automatically forwarded from the linked channel to the group chat."""
@@ -277,11 +277,11 @@ def func(flt, message):
277277
278278 return False
279279
280- commands = commands if type (commands ) is list else [commands ]
280+ commands = commands if isinstance (commands , list ) else [commands ]
281281 commands = {c if case_sensitive else c .lower () for c in commands }
282282
283283 prefixes = [] if prefixes is None else prefixes
284- prefixes = prefixes if type (prefixes ) is list else [prefixes ]
284+ prefixes = prefixes if isinstance (prefixes , list ) else [prefixes ]
285285 prefixes = set (prefixes ) if prefixes else {"" }
286286
287287 return create (
@@ -345,11 +345,11 @@ class user(Filter, set):
345345 """
346346
347347 def __init__ (self , users : int or str or list = None ):
348- users = [] if users is None else users if type (users ) is list else [users ]
348+ users = [] if users is None else users if isinstance (users , list ) else [users ]
349349
350350 super ().__init__ (
351351 "me" if u in ["me" , "self" ]
352- else u .lower ().strip ("@" ) if type ( u ) is str
352+ else u .lower ().strip ("@" ) if isinstance ( u , str )
353353 else u for u in users
354354 )
355355
@@ -376,11 +376,11 @@ class chat(Filter, set):
376376 """
377377
378378 def __init__ (self , chats : int or str or list = None ):
379- chats = [] if chats is None else chats if type (chats ) is list else [chats ]
379+ chats = [] if chats is None else chats if isinstance (chats , list ) else [chats ]
380380
381381 super ().__init__ (
382382 "me" if c in ["me" , "self" ]
383- else c .lower ().strip ("@" ) if type ( c ) is str
383+ else c .lower ().strip ("@" ) if isinstance ( c , str )
384384 else c for c in chats
385385 )
386386
0 commit comments