Fix chat color parsing

This commit is contained in:
KurimuzonAkuma 2023-12-02 16:07:33 +03:00
parent 82d9d9820e
commit 35f672095f

View File

@ -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)
) )