mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-07-13 17:42:29 +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 .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
|
from .messages import Command, Forward, Incoming, Media, Outgoing, Reply, Text, TextOnly
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
|
@ -9,6 +9,7 @@ __all__ = [
|
||||||
"Not",
|
"Not",
|
||||||
"Chats",
|
"Chats",
|
||||||
"Senders",
|
"Senders",
|
||||||
|
"ChatType",
|
||||||
"Command",
|
"Command",
|
||||||
"Forward",
|
"Forward",
|
||||||
"Incoming",
|
"Incoming",
|
||||||
|
|
|
@ -88,5 +88,5 @@ class ChatType(Combinable):
|
||||||
raise RuntimeError("unexpected case")
|
raise RuntimeError("unexpected case")
|
||||||
|
|
||||||
def __call__(self, event: Event) -> bool:
|
def __call__(self, event: Event) -> bool:
|
||||||
sender = getattr(event, "chat", None)
|
chat = getattr(event, "chat", None)
|
||||||
return isinstance(sender, self._type)
|
return isinstance(chat, self._type)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user