From 22eb42e1f362be05a2c9acb5aed3b01722f26145 Mon Sep 17 00:00:00 2001 From: Eric Solinas Date: Sat, 16 May 2020 12:24:14 +0200 Subject: [PATCH] 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> --- pyrogram/client/filters/filters.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pyrogram/client/filters/filters.py b/pyrogram/client/filters/filters.py index 83493965..d740d3c7 100644 --- a/pyrogram/client/filters/filters.py +++ b/pyrogram/client/filters/filters.py @@ -214,6 +214,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(