Add Filter.linked_channel

* filter messages coming from the channel connected to the chat

* Update filters.py

Co-authored-by: Dan <14043624+delivrance@users.noreply.github.com>
This commit is contained in:
Eric Solinas 2020-05-16 12:24:14 +02:00 committed by Dan
parent efc92715cc
commit 22eb42e1f3

View File

@ -215,6 +215,10 @@ class Filters:
from_scheduled = create(lambda _, m: bool(m.from_scheduled), "FromScheduledFilter")
"""Filter new automatically sent messages that were previously scheduled."""
# Messages from linked channels are forwarded automatically by Telegram and have no sender (from_user is None).
linked_channel = create(lambda _, m: bool(m.forward_from_chat and not m.from_user), "LinkedChannelFilter")
"""Filter messages that are automatically forwarded from the linked channel to the group chat."""
@staticmethod
def command(
commands: str or list,