Skip to content

Commit 482a99e

Browse files
authored
Update return types for chat methods
1 parent 8158216 commit 482a99e

1 file changed

Lines changed: 6 additions & 12 deletions

File tree

  • pyrogram/types/user_and_chats

pyrogram/types/user_and_chats/chat.py

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1342,8 +1342,7 @@ async def unarchive(self):
13421342
"""
13431343
return await self._client.unarchive_chats(self.id)
13441344

1345-
# TODO: Remove notes about "All Members Are Admins" for basic groups, the attribute doesn't exist anymore
1346-
async def set_title(self, title: str) -> bool:
1345+
async def set_title(self, title: str) -> "types.Message":
13471346
"""Bound method *set_title* of :obj:`~pyrogram.types.Chat`.
13481347
13491348
Use as a shortcut for:
@@ -1360,17 +1359,12 @@ async def set_title(self, title: str) -> bool:
13601359
13611360
await chat.set_title("Lounge")
13621361
1363-
.. note::
1364-
1365-
In regular groups (non-supergroups), this method will only work if the "All Members Are Admins"
1366-
setting is off.
1367-
13681362
Parameters:
13691363
title (``str``):
13701364
New chat title, 1-255 characters.
13711365
13721366
Returns:
1373-
``bool``: True on success.
1367+
:obj:`~pyrogram.types.Message`: On success, the sent service message is returned.
13741368
13751369
Raises:
13761370
RPCError: In case of Telegram RPC error.
@@ -1420,7 +1414,7 @@ async def set_photo(
14201414
photo: Union[str, BinaryIO] = None,
14211415
video: Union[str, BinaryIO] = None,
14221416
video_start_ts: float = None,
1423-
) -> bool:
1417+
) -> "types.Message":
14241418
"""Bound method *set_photo* of :obj:`~pyrogram.types.Chat`.
14251419
14261420
Use as a shortcut for:
@@ -1463,7 +1457,7 @@ async def set_photo(
14631457
The timestamp in seconds of the video frame to use as photo profile preview.
14641458
14651459
Returns:
1466-
``bool``: True on success.
1460+
:obj:`~pyrogram.types.Message`: On success, the sent service message is returned.
14671461
14681462
Raises:
14691463
RPCError: In case of a Telegram RPC error.
@@ -1825,7 +1819,7 @@ async def add_members(
18251819
self,
18261820
user_ids: Union[Union[int, str], List[Union[int, str]]],
18271821
forward_limit: int = 100
1828-
) -> bool:
1822+
) -> List["types.FailedToAddMember"]:
18291823
"""Bound method *add_members* of :obj:`~pyrogram.types.Chat`.
18301824
18311825
Use as a shortcut for:
@@ -1840,7 +1834,7 @@ async def add_members(
18401834
await chat.add_members(user_id)
18411835
18421836
Returns:
1843-
``bool``: On success, True is returned.
1837+
List of :obj:`~pyrogram.types.FailedToAddMember`: On success, an empty list is returned, otherwise a list of :obj:`~pyrogram.types.FailedToAddMember` is returned.
18441838
"""
18451839
return await self._client.add_chat_members(
18461840
self.id,

0 commit comments

Comments
 (0)