Skip to content

Commit

Permalink
Fix chat color parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
KurimuzonAkuma committed Dec 2, 2023
1 parent 97c9fa6 commit 9627d1c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pyrogram/types/user_and_chats/chat_color.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,15 @@ def _parse(color: "raw.types.PeerColor" = None, for_profile: bool = None) -> Opt
if not color:
return None

chat_color = getattr(color, "color", None)

if chat_color:
if for_profile:
chat_color = enums.ProfileColor(color.color)
else:
chat_color = enums.ReplyColor(color.color)

return ChatColor(
color=enums.ProfileColor(color.color) if for_profile else enums.ReplyColor(color.color) if color else None,
color=chat_color,
background_emoji_id=getattr(color, "background_emoji_id", None)
)

0 comments on commit 9627d1c

Please sign in to comment.