Skip to content

Commit 04b343f

Browse files
committed
Add get_default_emoji_statuses method
1 parent f731985 commit 04b343f

File tree

3 files changed

+46
-0
lines changed

3 files changed

+46
-0
lines changed

compiler/docs/compiler.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ def get_title_list(s: str) -> list:
251251
block_user
252252
unblock_user
253253
get_common_chats
254+
get_default_emoji_statuses
254255
""",
255256
invite_links="""
256257
Invite Links

pyrogram/methods/users/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
from .get_chat_photos import GetChatPhotos
2222
from .get_chat_photos_count import GetChatPhotosCount
2323
from .get_common_chats import GetCommonChats
24+
from .get_default_emoji_statuses import GetDefaultEmojiStatuses
2425
from .get_me import GetMe
2526
from .get_users import GetUsers
2627
from .set_profile_photo import SetProfilePhoto
@@ -41,5 +42,6 @@ class Users(
4142
GetChatPhotosCount,
4243
UnblockUser,
4344
UpdateProfile,
45+
GetDefaultEmojiStatuses
4446
):
4547
pass
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Pyrogram - Telegram MTProto API Client Library for Python
2+
# Copyright (C) 2017-present Dan <https://github.com/delivrance>
3+
#
4+
# This file is part of Pyrogram.
5+
#
6+
# Pyrogram is free software: you can redistribute it and/or modify
7+
# it under the terms of the GNU Lesser General Public License as published
8+
# by the Free Software Foundation, either version 3 of the License, or
9+
# (at your option) any later version.
10+
#
11+
# Pyrogram is distributed in the hope that it will be useful,
12+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
# GNU Lesser General Public License for more details.
15+
#
16+
# You should have received a copy of the GNU Lesser General Public License
17+
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
18+
19+
import pyrogram
20+
from pyrogram import raw
21+
from pyrogram import types
22+
23+
24+
class GetDefaultEmojiStatuses:
25+
async def get_default_emoji_statuses(
26+
self: "pyrogram.Client",
27+
) -> types.List["types.EmojiStatus"]:
28+
"""Get the default emoji statuses.
29+
30+
Returns:
31+
List of :obj:`~pyrogram.types.EmojiStatus`: On success, a list of emoji statuses is returned.
32+
33+
Example:
34+
.. code-block:: python
35+
36+
default_emoji_statuses = await app.get_default_emoji_statuses()
37+
print(default_emoji_statuses)
38+
"""
39+
r = await self.invoke(
40+
raw.functions.account.GetDefaultEmojiStatuses(hash=0)
41+
)
42+
43+
return types.List([types.EmojiStatus._parse(self, i) for i in r.statuses])

0 commit comments

Comments
 (0)