mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-29 13:27:47 +00:00
Update Filters.media
This commit is contained in:
parent
e760550f8b
commit
b747f87319
@ -174,6 +174,10 @@ class Filters:
|
|||||||
delete_chat_photo, group_chat_created, supergroup_chat_created, channel_chat_created, migrate_to_chat_id,
|
delete_chat_photo, group_chat_created, supergroup_chat_created, channel_chat_created, migrate_to_chat_id,
|
||||||
migrate_from_chat_id, pinned_message"""
|
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
|
@staticmethod
|
||||||
def command(command: str or list,
|
def command(command: str or list,
|
||||||
prefix: str or list = "/",
|
prefix: str or list = "/",
|
||||||
@ -310,22 +314,4 @@ class Filters:
|
|||||||
and not message.outgoing))
|
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))
|
dan = create("Dan", lambda _, m: bool(m.from_user and m.from_user.id == 23122162))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user