Rename some enums

This commit is contained in:
Dan 2022-04-24 11:56:07 +02:00
parent bbc109d73e
commit 84f0b3a97a
7 changed files with 10 additions and 10 deletions

View File

@ -23,8 +23,8 @@ from .auto_name import AutoName
class ChatMembersFilter(AutoName):
"""Chat members filter enumeration used in :meth:`~pyrogram.Client.get_chat_members`"""
ANY = raw.types.ChannelParticipantsSearch
"Any kind of member"
SEARCH = raw.types.ChannelParticipantsSearch
"Search for members"
BANNED = raw.types.ChannelParticipantsKicked
"Banned members"

View File

@ -23,8 +23,8 @@ from .auto_name import AutoName
class MessagesFilter(AutoName):
"""Messages filter enumeration used in used in :meth:`~pyrogram.Client.search_messages` and used in :meth:`~pyrogram.Client.search_global`"""
ANY = raw.types.InputMessagesFilterEmpty
"Any kind of message"
EMPTY = raw.types.InputMessagesFilterEmpty
"Empty filter (any kind of messages)"
PHOTO = raw.types.InputMessagesFilterPhotos
"Photo messages"

View File

@ -28,7 +28,7 @@ class SearchGlobal:
async def search_global(
self: "pyrogram.Client",
query: str = "",
filter: "enums.MessagesFilter" = enums.MessagesFilter.ANY,
filter: "enums.MessagesFilter" = enums.MessagesFilter.EMPTY,
limit: int = 0,
) -> Optional[AsyncGenerator["types.Message", None]]:
"""Search messages globally from all of your chats.

View File

@ -24,7 +24,7 @@ class SearchGlobalCount:
async def search_global_count(
self: "pyrogram.Client",
query: str = "",
filter: "enums.MessagesFilter" = enums.MessagesFilter.ANY,
filter: "enums.MessagesFilter" = enums.MessagesFilter.EMPTY,
) -> int:
"""Get the count of messages resulting from a global search.

View File

@ -27,7 +27,7 @@ async def get_chunk(
client,
chat_id: Union[int, str],
query: str = "",
filter: "enums.MessagesFilter" = enums.MessagesFilter.ANY,
filter: "enums.MessagesFilter" = enums.MessagesFilter.EMPTY,
offset: int = 0,
limit: int = 100,
from_user: Union[int, str] = None
@ -64,7 +64,7 @@ class SearchMessages:
chat_id: Union[int, str],
query: str = "",
offset: int = 0,
filter: "enums.MessagesFilter" = enums.MessagesFilter.ANY,
filter: "enums.MessagesFilter" = enums.MessagesFilter.EMPTY,
limit: int = 0,
from_user: Union[int, str] = None
) -> Optional[AsyncGenerator["types.Message", None]]:

View File

@ -27,7 +27,7 @@ class SearchMessagesCount:
self: "pyrogram.Client",
chat_id: Union[int, str],
query: str = "",
filter: "enums.MessagesFilter" = enums.MessagesFilter.ANY,
filter: "enums.MessagesFilter" = enums.MessagesFilter.EMPTY,
from_user: Union[int, str] = None
) -> int:
"""Get the count of messages resulting from a search inside a chat.

View File

@ -843,7 +843,7 @@ class Chat(Object):
offset: int = 0,
limit: int = 200,
query: str = "",
filter: "enums.ChatMembersFilter" = enums.ChatMembersFilter.ANY
filter: "enums.ChatMembersFilter" = enums.ChatMembersFilter.SEARCH
) -> List["types.ChatMember"]:
"""Bound method *get_members* of :obj:`~pyrogram.types.Chat`.