Add get_default_emoji_statuses method

This commit is contained in:
Dan 2022-09-03 14:06:46 +02:00
parent f7319858e1
commit 04b343f61b
3 changed files with 46 additions and 0 deletions

View File

@ -251,6 +251,7 @@ def pyrogram_api():
block_user
unblock_user
get_common_chats
get_default_emoji_statuses
""",
invite_links="""
Invite Links

View File

@ -21,6 +21,7 @@ from .delete_profile_photos import DeleteProfilePhotos
from .get_chat_photos import GetChatPhotos
from .get_chat_photos_count import GetChatPhotosCount
from .get_common_chats import GetCommonChats
from .get_default_emoji_statuses import GetDefaultEmojiStatuses
from .get_me import GetMe
from .get_users import GetUsers
from .set_profile_photo import SetProfilePhoto
@ -41,5 +42,6 @@ class Users(
GetChatPhotosCount,
UnblockUser,
UpdateProfile,
GetDefaultEmojiStatuses
):
pass

View File

@ -0,0 +1,43 @@
# Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pyrogram is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
import pyrogram
from pyrogram import raw
from pyrogram import types
class GetDefaultEmojiStatuses:
async def get_default_emoji_statuses(
self: "pyrogram.Client",
) -> types.List["types.EmojiStatus"]:
"""Get the default emoji statuses.
Returns:
List of :obj:`~pyrogram.types.EmojiStatus`: On success, a list of emoji statuses is returned.
Example:
.. code-block:: python
default_emoji_statuses = await app.get_default_emoji_statuses()
print(default_emoji_statuses)
"""
r = await self.invoke(
raw.functions.account.GetDefaultEmojiStatuses(hash=0)
)
return types.List([types.EmojiStatus._parse(self, i) for i in r.statuses])