mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-23 01:46:35 +03:00
Support more filter types for convenience (#745)
This commit is contained in:
parent
3b2d065d35
commit
e69c186782
|
@ -84,7 +84,8 @@ from .tl.types import (
|
|||
InputMessageEntityMentionName, DocumentAttributeVideo,
|
||||
UpdateEditMessage, UpdateEditChannelMessage, UpdateShort, Updates,
|
||||
MessageMediaWebPage, ChannelParticipantsSearch, PhotoSize, PhotoCachedSize,
|
||||
PhotoSizeEmpty, MessageService, ChatParticipants
|
||||
PhotoSizeEmpty, MessageService, ChatParticipants,
|
||||
ChannelParticipantsBanned, ChannelParticipantsKicked
|
||||
)
|
||||
from .tl.types.messages import DialogsSlice
|
||||
from .tl.types.account import PasswordInputSettings, NoPassword
|
||||
|
@ -1211,6 +1212,11 @@ class TelegramClient(TelegramBareClient):
|
|||
or :tl:`ChatParticipants` for normal chats.
|
||||
"""
|
||||
if isinstance(filter, type):
|
||||
if filter in (ChannelParticipantsBanned, ChannelParticipantsKicked,
|
||||
ChannelParticipantsSearch):
|
||||
# These require a `q` parameter (support types for convenience)
|
||||
filter = filter('')
|
||||
else:
|
||||
filter = filter()
|
||||
|
||||
entity = self.get_input_entity(entity)
|
||||
|
|
Loading…
Reference in New Issue
Block a user