Update session.py

This commit is contained in:
orShadxw 2025-03-31 23:16:38 +03:30 committed by GitHub
parent 9157c8d9ac
commit 1c38359bae
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,7 +1,7 @@
from typing import Optional, Tuple from typing import Optional, Tuple
from enum import IntEnum from enum import IntEnum
from ..tl.types import InputPeerUser, InputPeerChat, InputPeerChannel from ..tl.types import InputPeerUser, InputPeerChat, InputPeerChannel
import struct
class SessionState: class SessionState:
""" """
@ -173,7 +173,7 @@ class Entity:
try: try:
ty, id, hash = struct.unpack('<Bqq', blob) ty, id, hash = struct.unpack('<Bqq', blob)
except struct.error: except struct.error:
raise ValueError(f'malformed entity data, got {string!r}') from None raise ValueError(f'malformed entity data, got {blob!r}') from None
return cls(EntityType(ty), id, hash) return cls(EntityType(ty), id, hash)