mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-04-20 09:01:59 +03:00
add ChatType to exported filters; rename sender -> chat in ChatType.__call__
This commit is contained in:
parent
ae44426a78
commit
3f39201d27
|
@ -1,5 +1,5 @@
|
|||
from .combinators import All, Any, Filter, Not
|
||||
from .common import Chats, Senders
|
||||
from .common import Chats, Senders, ChatType
|
||||
from .messages import Command, Forward, Incoming, Media, Outgoing, Reply, Text, TextOnly
|
||||
|
||||
__all__ = [
|
||||
|
@ -9,6 +9,7 @@ __all__ = [
|
|||
"Not",
|
||||
"Chats",
|
||||
"Senders",
|
||||
"ChatType",
|
||||
"Command",
|
||||
"Forward",
|
||||
"Incoming",
|
||||
|
|
|
@ -88,5 +88,5 @@ class ChatType(Combinable):
|
|||
raise RuntimeError("unexpected case")
|
||||
|
||||
def __call__(self, event: Event) -> bool:
|
||||
sender = getattr(event, "chat", None)
|
||||
return isinstance(sender, self._type)
|
||||
chat = getattr(event, "chat", None)
|
||||
return isinstance(chat, self._type)
|
||||
|
|
Loading…
Reference in New Issue
Block a user