add ChatType to exported filters; rename sender -> chat in ChatType.__call__

This commit is contained in:
apepenkov 2023-11-08 12:31:05 +03:00
parent ae44426a78
commit 3f39201d27
2 changed files with 4 additions and 3 deletions

View File

@ -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",

View File

@ -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)