mirror of
https://github.com/TeamPGM/pyrogram.git
synced 2024-11-16 04:35:24 +00:00
Fix chat color parsing
This commit is contained in:
parent
82d9d9820e
commit
35f672095f
@ -48,7 +48,15 @@ class ChatColor(Object):
|
|||||||
if not color:
|
if not color:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
chat_color = getattr(color, "color", None)
|
||||||
|
|
||||||
|
if not chat_color is None:
|
||||||
|
if for_profile:
|
||||||
|
chat_color = enums.ProfileColor(color.color)
|
||||||
|
else:
|
||||||
|
chat_color = enums.ReplyColor(color.color)
|
||||||
|
|
||||||
return ChatColor(
|
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)
|
background_emoji_id=getattr(color, "background_emoji_id", None)
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user