From 9f10b554f17ee0b572cd4f449c420346781bcef5 Mon Sep 17 00:00:00 2001 From: KurimuzonAkuma Date: Wed, 29 Nov 2023 15:35:35 +0300 Subject: [PATCH] Update description of update_color --- pyrogram/methods/chats/update_color.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pyrogram/methods/chats/update_color.py b/pyrogram/methods/chats/update_color.py index 59e99b3a..8fb57dc1 100644 --- a/pyrogram/methods/chats/update_color.py +++ b/pyrogram/methods/chats/update_color.py @@ -31,20 +31,20 @@ class UpdateColor: ) -> "types.Chat": """Update color - .. include:: /_includes/usable-by/users-bots.rst + .. include:: /_includes/usable-by/users.rst Parameters: chat_id (``int`` | ``str``): Unique identifier (int) or username (str) of the target chat. color (``int``): - Color + Numeric color identifier. background_emoji_id (``int``, *optional*): - Background emoji + Unique identifier of the custom emoji. Returns: - ``bool``: True on success. + :obj:`~pyrogram.types.Chat`: On success, a chat object is returned. Example: .. code-block:: python @@ -63,7 +63,7 @@ class UpdateColor: ) 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: r = await self.invoke( raw.functions.channels.UpdateColor( @@ -72,5 +72,6 @@ class UpdateColor: 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)