Add filters.dice to filter Dice messages

This commit is contained in:
Dan 2021-03-17 13:18:16 +01:00
parent ee5f39374c
commit 6678af08aa

View File

@ -405,7 +405,7 @@ venue = create(venue_filter)
# region web_page_filter # region web_page_filter
async def web_page_filter(_, __, m: Message): async def web_page_filter(_, __, m: Message):
return m.web_page return bool(m.web_page)
web_page = create(web_page_filter) web_page = create(web_page_filter)
@ -416,13 +416,24 @@ web_page = create(web_page_filter)
# region poll_filter # region poll_filter
async def poll_filter(_, __, m: Message): async def poll_filter(_, __, m: Message):
return m.poll return bool(m.poll)
poll = create(poll_filter) poll = create(poll_filter)
"""Filter messages that contain :obj:`~pyrogram.types.Poll` objects.""" """Filter messages that contain :obj:`~pyrogram.types.Poll` objects."""
# endregion
# region dice_filter
async def dice_filter(_, __, m: Message):
return bool(m.dice)
dice = create(dice_filter)
"""Filter messages that contain :obj:`~pyrogram.types.Dice` objects."""
# endregion # endregion
# region private_filter # region private_filter