From b747f87319080d084c201fa46aad753c9b484f9e Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Thu, 8 Nov 2018 10:50:52 +0100 Subject: [PATCH] Update Filters.media --- pyrogram/client/filters/filters.py | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/pyrogram/client/filters/filters.py b/pyrogram/client/filters/filters.py index b847543a..f3d2ec56 100644 --- a/pyrogram/client/filters/filters.py +++ b/pyrogram/client/filters/filters.py @@ -174,6 +174,10 @@ class Filters: delete_chat_photo, group_chat_created, supergroup_chat_created, channel_chat_created, migrate_to_chat_id, migrate_from_chat_id, pinned_message""" + media = create("Media", lambda _, m: bool(m.media)) + """Filter messages containing any of these fields set: audio, document, photo, sticker, video, animation, voice, + video_note, contact, location, venue""" + @staticmethod def command(command: str or list, prefix: str or list = "/", @@ -310,22 +314,4 @@ class Filters: and not message.outgoing)) ) - media = create( - "Media", - lambda _, m: bool( - Filters.audio(m) - or Filters.document(m) - or Filters.photo(m) - or Filters.sticker(m) - or Filters.video(m) - or Filters.animation(m) - or Filters.voice(m) - or Filters.video_note(m) - or Filters.contact(m) - or Filters.location(m) - or Filters.venue(m) - ) - ) - """Filter all media messages.""" - dan = create("Dan", lambda _, m: bool(m.from_user and m.from_user.id == 23122162))