mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-10 19:46:36 +03:00
Fix pack implementations
This commit is contained in:
parent
34dffe978e
commit
4465644aa1
|
@ -61,7 +61,7 @@ class Channel(Chat, metaclass=NoPublicConstructor):
|
|||
if getattr(self._raw, "gigagroup", False)
|
||||
else PackedType.BROADCAST,
|
||||
id=self._raw.id,
|
||||
access_hash=None,
|
||||
access_hash=self._raw.access_hash,
|
||||
)
|
||||
|
||||
# endregion Overrides
|
||||
|
|
|
@ -65,7 +65,9 @@ class Group(Chat, metaclass=NoPublicConstructor):
|
|||
return None
|
||||
else:
|
||||
return PackedChat(
|
||||
ty=PackedType.MEGAGROUP, id=self._raw.id, access_hash=None
|
||||
ty=PackedType.MEGAGROUP,
|
||||
id=self._raw.id,
|
||||
access_hash=self._raw.access_hash,
|
||||
)
|
||||
|
||||
# endregion Overrides
|
||||
|
|
|
@ -90,14 +90,14 @@ class User(Chat, metaclass=NoPublicConstructor):
|
|||
return self._raw.username
|
||||
|
||||
def pack(self) -> Optional[PackedChat]:
|
||||
if self._raw.access_hash is not None:
|
||||
if self._raw.access_hash is None:
|
||||
return None
|
||||
else:
|
||||
return PackedChat(
|
||||
ty=PackedType.BOT if self._raw.bot else PackedType.USER,
|
||||
id=self._raw.id,
|
||||
access_hash=self._raw.access_hash,
|
||||
)
|
||||
else:
|
||||
return None
|
||||
|
||||
# endregion Overrides
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user