Add media_spoiler filter

This commit is contained in:
Dan 2022-12-30 15:09:21 +01:00 committed by wulan17
parent 65b045ff2d
commit 28307ca58e
No known key found for this signature in database
GPG key ID: 318CD6CD3A6AC0A5

View file

@ -425,6 +425,17 @@ dice = create(dice_filter)
"""Filter messages that contain :obj:`~pyrogram.types.Dice` objects."""
# endregion
# region media_spoiler
async def media_spoiler_filter(_, __, m: Message):
return bool(m.has_media_spoiler)
media_spoiler = create(media_spoiler_filter)
"""Filter media messages that contain a spoiler."""
# endregion
# region private_filter
@ -731,6 +742,7 @@ async def linked_channel_filter(_, __, m: Message):
linked_channel = create(linked_channel_filter)
"""Filter messages that are automatically forwarded from the linked channel to the group chat."""
# endregion