Update description of update_color

This commit is contained in:
KurimuzonAkuma 2023-11-29 15:35:35 +03:00
parent a4cb8b30ab
commit 9f10b554f1

View File

@ -31,20 +31,20 @@ class UpdateColor:
) -> "types.Chat": ) -> "types.Chat":
"""Update color """Update color
.. include:: /_includes/usable-by/users-bots.rst .. include:: /_includes/usable-by/users.rst
Parameters: Parameters:
chat_id (``int`` | ``str``): chat_id (``int`` | ``str``):
Unique identifier (int) or username (str) of the target chat. Unique identifier (int) or username (str) of the target chat.
color (``int``): color (``int``):
Color Numeric color identifier.
background_emoji_id (``int``, *optional*): background_emoji_id (``int``, *optional*):
Background emoji Unique identifier of the custom emoji.
Returns: Returns:
``bool``: True on success. :obj:`~pyrogram.types.Chat`: On success, a chat object is returned.
Example: Example:
.. code-block:: python .. code-block:: python
@ -63,7 +63,7 @@ class UpdateColor:
) )
r = await self.invoke(raw.functions.users.GetUsers(id=[raw.types.InputPeerSelf()])) r = await self.invoke(raw.functions.users.GetUsers(id=[raw.types.InputPeerSelf()]))
return types.Chat._parse_user_chat(self, r[0]) chat = r[0]
else: else:
r = await self.invoke( r = await self.invoke(
raw.functions.channels.UpdateColor( raw.functions.channels.UpdateColor(
@ -72,5 +72,6 @@ class UpdateColor:
background_emoji_id=background_emoji_id background_emoji_id=background_emoji_id
) )
) )
chat = r.chats[0]
return types.Chat._parse_channel_chat(self, r.chats[0]) return types.Chat._parse_chat(self, chat)