fix Channel.pack()'s PackedType check

This commit is contained in:
apepenkov 2023-12-17 22:39:53 +03:00
parent 508a0ab59e
commit f726d1dcc4

View File

@ -54,10 +54,13 @@ class Channel(Chat, metaclass=NoPublicConstructor):
if self._raw.access_hash is None: if self._raw.access_hash is None:
return None return None
else: else:
ty = PackedType.BROADCAST
if getattr(self._raw, "megagroup", False):
ty = PackedType.MEGAGROUP
elif getattr(self._raw, "gigagroup", False):
ty = PackedType.GIGAGROUP
return PackedChat( return PackedChat(
ty=PackedType.GIGAGROUP ty=ty,
if getattr(self._raw, "gigagroup", False)
else PackedType.BROADCAST,
id=self._raw.id, id=self._raw.id,
access_hash=self._raw.access_hash, access_hash=self._raw.access_hash,
) )