Fix is_forum field for supergroups only

This commit is contained in:
KurimuzonAkuma 2023-12-16 21:52:43 +03:00
parent d8f3795afc
commit 3c694293f4

View File

@ -299,7 +299,7 @@ class Chat(Object):
return Chat(
id=peer_id,
type=enums.ChatType.SUPERGROUP if getattr(channel, "megagroup", None) else enums.ChatType.CHANNEL,
is_forum=getattr(channel, "forum", None),
is_forum=getattr(channel, "forum", None) if getattr(channel, "megagroup", None) else None,
is_verified=getattr(channel, "verified", None),
is_restricted=getattr(channel, "restricted", None),
is_creator=getattr(channel, "creator", None),