mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-08 04:52:30 +00:00
Fix typechecks and tests
This commit is contained in:
@@ -20,4 +20,4 @@ class Data(Combinable):
|
||||
|
||||
def __call__(self, event: Event) -> bool:
|
||||
data = getattr(event, "data", None)
|
||||
return self._data == data if data is not None else False
|
||||
return self._data == data if isinstance(data, bytes) else False
|
||||
|
@@ -79,9 +79,7 @@ class ButtonCallback(Event):
|
||||
"""
|
||||
|
||||
pid = peer_id(self._raw.peer)
|
||||
chat = self._chat_map.get(pid)
|
||||
if not chat:
|
||||
chat = await self._client._resolve_to_packed(pid)
|
||||
chat = self._chat_map.get(pid) or await self._client._resolve_to_packed(pid)
|
||||
|
||||
lst = CherryPickedList(self._client, chat, [])
|
||||
lst._ids.append(
|
||||
|
@@ -497,7 +497,7 @@ class Message(metaclass=NoPublicConstructor):
|
||||
else:
|
||||
return False
|
||||
|
||||
def __bool__(self):
|
||||
def __bool__(self) -> bool:
|
||||
return not isinstance(self._raw, types.MessageEmpty)
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user