2
0
mirror of https://github.com/pyrogram/pyrogram synced 2025-08-29 13:27:47 +00:00

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): class ChatMembersFilter(AutoName):
"""Chat members filter enumeration used in :meth:`~pyrogram.Client.get_chat_members`""" """Chat members filter enumeration used in :meth:`~pyrogram.Client.get_chat_members`"""
ANY = raw.types.ChannelParticipantsSearch SEARCH = raw.types.ChannelParticipantsSearch
"Any kind of member" "Search for members"
BANNED = raw.types.ChannelParticipantsKicked BANNED = raw.types.ChannelParticipantsKicked
"Banned members" "Banned members"

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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