mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-06-17 10:36:37 +00:00
Fix issues raising errors, media dl and reply markup (#4592)
This commit is contained in:
parent
c409d8c605
commit
3921914a96
@ -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)
|
||||||
|
|
||||||
|
@ -992,8 +992,8 @@ class DownloadMethods:
|
|||||||
)
|
)
|
||||||
|
|
||||||
# TODO Better way to get opened handles of files and auto-close
|
# TODO Better way to get opened handles of files and auto-close
|
||||||
kind, possible_names = self._get_kind_and_names(web.attributes)
|
kind, possible_names = cls._get_kind_and_names(web.attributes)
|
||||||
file = self._get_proper_filename(
|
file = cls._get_proper_filename(
|
||||||
file, kind, utils.get_extension(web),
|
file, kind, utils.get_extension(web),
|
||||||
possible_names=possible_names
|
possible_names=possible_names
|
||||||
)
|
)
|
||||||
|
@ -49,6 +49,7 @@ class Button:
|
|||||||
Returns `True` if the button belongs to an inline keyboard.
|
Returns `True` if the button belongs to an inline keyboard.
|
||||||
"""
|
"""
|
||||||
return isinstance(button, (
|
return isinstance(button, (
|
||||||
|
types.KeyboardButtonCopy,
|
||||||
types.KeyboardButtonBuy,
|
types.KeyboardButtonBuy,
|
||||||
types.KeyboardButtonCallback,
|
types.KeyboardButtonCallback,
|
||||||
types.KeyboardButtonGame,
|
types.KeyboardButtonGame,
|
||||||
|
Loading…
Reference in New Issue
Block a user